Commit graph

91 commits

Author SHA1 Message Date
Alexander Butenko 15a06bbfe1 Integrate Adblock preferences with extension list 2011-06-24 23:55:08 +02:00
Alexander Butenko 4d7424adc4 Fix length calculation and typos in fixup function 2011-06-24 21:48:03 +02:00
Alexander Butenko 60cb44c846 Remove legacy code from adblock 2011-06-24 21:42:32 +02:00
Alexander Butenko bd10649982 Ignore rules with subdocument property 2011-06-24 21:26:05 +02:00
Alexander Butenko f093e55f85 Skip empty lines in adblock rules files 2011-06-24 21:20:08 +02:00
Alexander Butenko 092834f65e Inline parsing functions. 10% speedup during load 2011-06-08 20:05:28 +02:00
Alexander Butenko c71f3b37e4 Remove legacy webkit bug workaround 2011-06-08 20:03:37 +02:00
Paweł Forysiuk f46f3f0be0 Speed-up JS generator function in Adblock 2011-06-08 20:02:48 +02:00
Alexander Butenko 5f1cd907ad Some tiny Adblock speed-ups with regex optimization 2011-06-08 19:59:18 +02:00
Alexander Butenko 4e656cc127 10x speed-up in loading of CSS rules for Adblock 2011-06-08 19:51:26 +02:00
Alexander Butenko fc842d9751 Add URL cache in adblock extension
We can bypass all tests on the second load of the URL.
2011-06-02 00:48:02 +02:00
Christian Dywan f97395dab1 Validate URIs and render entry red if invalid
Fixes: https://bugs.launchpad.net/midori/+bug/710855
2011-05-15 16:46:23 +02:00
Alexander Butenko 6885c35886 Fix loading of lists from https
Fixes: https://bugs.launchpad.net/midori/+bug/699978
2011-05-15 13:17:25 +02:00
Paweł Forysiuk bbfa7f6030 Fix GCC 4.6 warnings about set but unused variables 2011-04-29 04:03:33 +02:00
Paweł Forysiuk 5cdbf5e814 Free uri in adblock_is_matched_by_key after printing 2011-02-13 18:35:46 +01:00
Christian Dywan 90e11d3713 Only no adblock if main frame in provisional state 2011-02-01 01:52:39 +01:00
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