Page 1 of 1

[Fixed] AdBlock for Chrome pollutes DOM of original page

PostPosted: Mon Nov 21, 2011 7:22 am
by ayanamist
AdBlock for Chrome will pollute DOM of original page, because it adds style tags to the page in order to hide elements. But these elements will make page larger and have bad effects when dumping pages.
Can it just delete that elements or use following codes which will NOT add additional elements to DOM:
Code: Select all
document.styleSheets[0].insertRule('.map_canvas,.map_canvas *{display:none !important;}', 0);

Re: AdBlock for Chrome pollutes DOM of original page

PostPosted: Mon Nov 21, 2011 5:01 pm
by Wladimir Palant
Nice idea, thanks a lot!

We don't want to add to existing stylesheets because we might want to remove our styles later but other than the approach is the same: https://hg.adblockplus.org/adblockplusc ... ab038b722e. Next development build will be available in 20 minutes and it will have these changes.

Re: [Fixed] AdBlock for Chrome pollutes DOM of original page

PostPosted: Mon Nov 21, 2011 5:58 pm
by emmortal
Good fix, however with this update I notice some webpages are a little jumpy now. While watching on http://espn.go.com/ first video, the page will jump up and down every few seconds. This is in Chrome 15 and 17 with experimental AB+ build.

Re: [Fixed] AdBlock for Chrome pollutes DOM of original page

PostPosted: Mon Nov 21, 2011 10:58 pm
by geki007
Yes very bad flashing :(
Another example: http://winfuture.de/news,66725.html (with german filterlist)

Re: [Fixed] AdBlock for Chrome pollutes DOM of original page

PostPosted: Mon Nov 21, 2011 11:12 pm
by Eilat
Confirmed, also in Bing search results and on articles at heise online. Additionally I get very high CPU load with this build. It took me a moment to figure out, there was a recent update that causes this.

Re: [Fixed] AdBlock for Chrome pollutes DOM of original page

PostPosted: Mon Nov 21, 2011 11:29 pm
by Wladimir Palant
Yes, I can see it. Weird...

Re: [Fixed] AdBlock for Chrome pollutes DOM of original page

PostPosted: Mon Nov 21, 2011 11:36 pm
by Wladimir Palant
Now I feel stupid: https://hg.adblockplus.org/adblockplusc ... 1abc4f918a
I should be more careful when I add code for testing.