Bug 270356 - AdBlock problems with some sites
Summary: AdBlock problems with some sites
Status: RESOLVED FIXED
Alias: None
Product: rekonq
Classification: Applications
Component: general (show other bugs)
Version: latest git snapshot
Platform: Compiled Sources Linux
: NOR normal
Target Milestone: ---
Assignee: Andrea Diamantini
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2011-04-07 20:21 UTC by Alberto Mattea
Modified: 2011-04-22 16:50 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alberto Mattea 2011-04-07 20:21:54 UTC
Version:           latest git snapshot (using KDE 4.6.2) 
OS:                Linux

Hi, since rekonq 0.7 adblock seems to have problems with some websites. Sometimes ads are removed but not hidden, and sometimes they aren't even removed.
When this happens, I get on the command line:
(<unknown>:13080): Gdk-CRITICAL **: IA__gdk_window_get_origin: assertion `GDK_IS_WINDOW (window)' failed

(<unknown>:13080): Gdk-WARNING **: /build/buildd/gtk+2.0-2.22.0/gdk/x11/gdkdrawable-x11.c:952 drawable is not a pixmap or window

Both konqueror-webkit and firefox don't exhibit the problem.
A site that triggers this is h-online.com (you can see the place for the ad on the top-right)

Reproducible: Always

Steps to Reproduce:
1) Open rekonq
2) Visit one of the affected websites

Actual Results:  
Sometimes ads are removed but not hidden, sometimes they aren't even removed

Expected Results:  
Ads should be removed, as in the oher sites
Comment 1 Alberto Mattea 2011-04-08 19:35:28 UTC
Bisecting leads to:

fd1f2205b673a41bedb3959c99b8958f99a7b269 is the first bad commit
commit fd1f2205b673a41bedb3959c99b8958f99a7b269
Author: Andrea Diamantini <adjam7@gmail.com>
Date:   Mon Feb 21 19:21:04 2011 +0100

    AdBlock: adding a Null Rule to match all the unimplemented filters.
    
    BUG:248045
    BUG:253329
    BUG:265909

:040000 040000 87a98584eae44258ca0c3f576b5d6ad77952715b 5a072666a577f9dac85e4bac97f4891dfd7bc504 M      src
Comment 2 Alberto Mattea 2011-04-09 10:20:44 UTC
The origin of this seems in this rule in adblockrulenullimpl.cpp (line 113):

// third_party
if (option == QL1S("third-party"))
    return true;

With it commented everything works as expected.
However, this page stops working:
http://code.google.com/apis/adwords/docs/developer/index.html
Comment 3 Andrea Diamantini 2011-04-09 15:00:39 UTC
Hi Alberto,
and many thanks for your bug report and your interesting debugging about ;)
I'm testing the changes you suggest. And I'll see what we can do for the third-party adblock rules.
Comment 4 Andrea Diamantini 2011-04-10 01:15:41 UTC
Git commit 4b9753d82fceacfdd6db5d6e3f671aed7cc390ba by Andrea Diamantini.
Committed on 10/04/2011 at 01:22.
Pushed by adjam into branch 'master'.

AdBlock Improvements:
- implemented "third party" support
- do NOT block first requests (you cannot even see a blank page, sometimes...)

BUG:270356

PS:
Alberto, can you pls check this really works for you before backporting to
0.7 and let me know about?
Many thanks for.

M  +23   -2    src/adblock/adblockrulefallbackimpl.cpp     
M  +2    -0    src/adblock/adblockrulefallbackimpl.h     
M  +2    -2    src/adblock/adblockrulenullimpl.cpp     
M  +7    -1    src/adblock/adblockruletextmatchimpl.cpp     

http://commits.kde.org/rekonq/4b9753d82fceacfdd6db5d6e3f671aed7cc390ba
Comment 5 Alberto Mattea 2011-04-10 18:37:53 UTC
It works perfectly here. Thanks!
Comment 6 Andrea Diamantini 2011-04-22 16:50:09 UTC
Git commit c8f8c2990489c6808a93bb29a2e4bbf42ddbb43b by Andrea Diamantini.
Committed on 10/04/2011 at 01:22.
Pushed by adjam into branch '0.7-branch'.

AdBlock Improvements:
- implemented "third party" support
- do NOT block first requests (you cannot even see a blank page, sometimes...)

BUG:270356

PS:
Alberto, can you pls check this really works for you before backporting to
0.7 and let me know about?
Many thanks for.

M  +23   -2    src/adblock/adblockrulefallbackimpl.cpp     
M  +2    -0    src/adblock/adblockrulefallbackimpl.h     
M  +2    -2    src/adblock/adblockrulenullimpl.cpp     
M  +7    -1    src/adblock/adblockruletextmatchimpl.cpp     

http://commits.kde.org/rekonq/c8f8c2990489c6808a93bb29a2e4bbf42ddbb43b