Commit graph

75 commits

Author SHA1 Message Date
Christian Dywan
2e35f1718b Never filter the main page itself with adblock
Fixes: https://bugs.launchpad.net/midori/+bug/706862
2011-01-30 19:25:50 +01:00
Christian Dywan
40dc38fd21 Implement and use KATZE_ARRAY_FOREACH_ITEM
Iterating an array by a GList is considerably faster than
continuously retrieving items, however it is also a lot
more complicated. So the new macro takes care of that and
uses a new semi-private function to avoid copying the list.

Note that the macro can't be nested, which basically isn't
useful in practise anyway.
2010-09-12 00:59:24 +02:00
Alexander Butenko
a04bf24b5e Properly disconnect add-tab on destruction in adblock 2010-06-30 22:41:32 +02:00
Alexander Butenko
3d972f11e4 Skip '+' sign in adblock rules 2010-06-30 21:09:55 +02:00
Alexander Butenko
633b7ed294 Inline functions in adblock for 0.5 percent speedup 2010-06-19 16:22:16 +02:00
Enrico Tröger
bab6124cff Guard debug variables in Adblock with G_ENABLE_DEBUG 2010-05-15 01:06:17 +02:00
Christian Dywan
779c582058 Guard WebKitDownload to WebKitGTK+ 1.1.2 2010-04-24 23:59:07 +02:00
Christian Dywan
efc5252048 Revise MIDORI_ADBLOCK so 1 is parsing and 2 is timing
Huge amounts of console output affect performance, so timing
should be taken separately.
2010-04-10 00:58:15 +02:00
Christian Dywan
63a5eeb0f0 Output adblock debug if variable MIDORI_ADBLOCK set
If Midori is compiled with full debug mode, and the environment
variable MIDORI_ADBLOCK is set, Adblock will output a lot of
debugging information.
This spares testers from editing code. grep is recommended.
2010-04-08 21:39:05 +02:00
Christian Dywan
95358acc82 Handle https:// URIs in Adblock properly
We mark URIs as 'disabled' by replacing the : with a -. This
fails if there is an https:// URI and we want to restore it.

For clarity, the macros ADBLOCK_FILTER_SET and
ADBLOCK_FILTER_IS_SET are introduced to handle the details.
2010-04-06 02:41:29 +02:00
Arno Renevier
dc90c7f093 Use midori_view_get_web_view in extensions 2010-03-31 00:18:42 +02:00
Christian Dywan
458252d053 Localize 'Block image' and 'Block link' menuitems in adblock 2010-02-06 17:32:09 +01:00
Alexander Butenko
c550d36649 Implement an 'Edit rule' dialogue when blocking images 2010-02-03 18:58:07 +01:00
Alexander Butenko
27653d6670 Only connect liststore after populating the model with filters
We don't want to reload the rules for each row.
2010-02-03 18:30:48 +01:00
Alexander Butenko
de7818b7aa Don't cache local adblock filters, and remove disabled filter files 2010-02-03 18:26:44 +01:00
Alexander Butenko
62dac745d6 Rebuild adblock js after download a new filter file 2010-02-02 21:26:05 +01:00
Alexander Butenko
7b42792caf Prevent styles with a "'" character from breaking adblock 2010-01-26 22:07:57 +01:00
Alexander Butenko
57865955dc Simpler element hiding and some adblock optimizations
1. Less hungry and simpler blocked element hider

2. We are now also adding a context menuitem for uris in
preparation for creating rules from the web inspector

3. Removed old hack for blocked element hider

4. Element hider javascript fixes

5. Unit test for small sized rules

6. Removed unneeded WebKitWebView casts
2010-01-17 20:04:17 +01:00
Enrico Tröger
e6163a761f Only define adblock_prepare_urihider_js() if it is used 2010-01-15 07:07:00 +01:00
Alexander Butenko
bb4c381b43 Use a script to hide images and frames that are blocked 2010-01-14 02:19:38 +01:00
Enrico Tröger
27567de620 Guard image with #define to prevent unused variable warnings 2010-01-14 02:01:30 +01:00
Alexander Butenko
4dae65d802 Speedup adblock by removing greedy regex if we have 1 or 2 signatures 2010-01-14 01:52:43 +01:00
Alexander Butenko
089315bcaa Speedup adblock with blacklists and reorganize unit tests
1. Blacklist for pattern matching. 1 regexp has more than 1
signature. If the 1st match failed, there is no need to
match with the same regex a second time if the signature matched.
This gives us 20% speedup.

2. Cleanup for performance tests.

3. Tests reorganized. now we are checking pattern validation
plus performance timing. Simlifies testing.

4. Bump version to 0.5. The next patch will add option matching
so we will bump it to 1.0 once it is tested.
2010-01-10 22:52:06 +01:00
Alexander Butenko
22f347ca38 Increase filter line buffer, revise css block matching, use strchr 2010-01-03 23:37:44 +01:00
Christian Dywan
7383a647c9 Use mnemonic _o instead of _l for 'Block image' 2010-01-02 22:04:50 +01:00
Christian Dywan
cf9dec176c Refactor adblock_reload_rules to handle filters versus only custom 2010-01-02 21:34:17 +01:00
Alexander Butenko
b0de3f35df Block and hide images by domain and relative path 2010-01-02 21:15:58 +01:00
Alexander Butenko
20059d74b9 Hide images blocked with 'Block image' via element hiding 2010-01-02 04:11:44 +01:00
Alexander Butenko
5452c7c71d Implement 'Block image' menuitem in adblock, adding URIs to custom list
For now it only has effect after reloading the page.
2010-01-02 03:47:56 +01:00
Enrico Tröger
9183f8e16d Connect callbacks for gtk_widget_destroy where signature differs
Apparently dependent on architecture and compiler, mismatching
callback signatures can cause segmentation faults.
2009-12-29 23:49:10 +01:00
Enrico Tröger
d0a52ac09c Use g_strndup as opposed to strndup in Adblock 2009-12-28 23:59:54 +01:00
Alexander Butenko
05601be635 Use id to avoid inserting adblock/ form history style more than once 2009-12-23 15:35:09 +01:00
Alexander Butenko
1c424106f1 Don't test file existence in adblock, katze_mkdir and check download status
It is enough to see if g_fopen fails, thus we don't need g_access
to test file existence additionally.

katze_mkdir_with_parents is optimized for existing folders.

We need to check the status, to see if file downloads are finished.

For Windows, we need to use g_strndup instead of strndup.
2009-12-22 00:07:39 +01:00
Alexander Butenko
045cc81b45 Use g_access instead of g_file_test consistently 2009-12-19 11:28:46 +01:00
Alexander Butenko
12ed2da768 Refactor Adblock to use simpler checks with optional pattern matching
The style is only added once. Match checks are simpler so they can
be a lot faster. And slow pattern matching is optional, albeit
it currently is hardcoded in the source.
2009-12-18 21:21:56 +01:00
Christian Dywan
c94be155f5 Open the link in the adblock filter dialogue inside Midori 2009-12-05 01:28:58 +01:00
Alexander Butenko
27e28080b8 Do not free the SoupURI obtained from soup_message_get_uri 2009-12-01 22:35:28 +01:00
Alexander Butenko
a64a583c4a Don't free opt because it is inserted into the hash table as-is 2009-11-30 22:04:32 +01:00
Christian Dywan
183878db8c Omit Help in Adblock and Search Engines dialogues on Hildon 2009-11-29 14:09:28 +01:00
Alexander Butenko
ce1013e622 Support differences in rule syntax and refactor the URL parser
Apparently some lists use a different syntax than what is
recommended, so we take that into account.
2009-11-27 00:37:20 +01:00
Christian Dywan
e5cb4bb383 Be sure to define image in adblock, even if unused and move disconnect 2009-11-23 20:40:05 +01:00
Christian Dywan
f14b711901 Implement 'Edit' in adblock to activate the cell in the list 2009-11-21 02:35:15 +01:00
Alexander Butenko
2d514bfb6c Refactor adblock simplify parsing and to honor matching options
There is a known flaw in that URL rules may erroneously match domains.

The code path for WebKitGTK+ < 1.1.14 is now crashing.
2009-11-20 01:00:48 +01:00
Christian Dywan
5238431d84 Disable statusbar button showing adblock status
It doesn't work that well currently and it's not clear how it should
change, so we're disabling it for the moment.
2009-11-13 18:37:00 +01:00
Alexander Butenko
d86e03a34e Implement an adblock info icon showing blocked URIs in a tooltip 2009-10-19 23:31:41 +02:00
Alexander Butenko
02d6f806e2 Implement div, a, ul and per domain element adblock rules
element hiding is supported. And instead of creating a javascript
function for each rule, we generate one script for everything.

On my machine only 650 out of 4500 rules are skipped.
2009-10-19 23:16:05 +02:00
Christian Dywan
b7f90f1a51 Add entry for a filter list address and an explanation to the dialog 2009-10-14 23:23:45 +02:00
Christian Dywan
0d65588651 Support Adblock with earlier Webit versions
With WebKit < 1.1.14 we use libSoup directly.
2009-10-14 21:51:32 +02:00
Christian Dywan
6a590a3125 Implement tick marks to enable/ disable adblock filters 2009-10-14 03:35:40 +02:00
Christian Dywan
fa030cbaca Use the correct counter when storing adblock filters
This crash was tricky since 'length' looked correct while in fact
it is the number of items including invalid items, which can be
more than we store.
2009-10-14 03:17:23 +02:00