The DnD Sanctuary

General => Browsers & Technology => Topic started by: ersi on 2015-08-25, 14:58:16

Title: Does adblock deliberately miss some things?
Post by: ersi on 2015-08-25, 14:58:16
On a website there was a specific pop-up (pop-in rather, because that's what modern popups are), done in a particularly nasty way due to EU cookie directive. It was basically unblockable with adblock.

The situation: I know exactly the URL of the JS script that I want blocked. I add the address in many ways, into adblock. I have AdBlock Edge extension in Seamonkey. That's what I was using, both by adding the direct URL and trying with various wildcards, each time restarting the browser.

The script is not directly linked on the webpage though. In the webpage code, this element triggers the script,

<div id="user-message-container" data-require="modules/cookie-message">
</div>

Only a CSS rule was able to hide the message.

Question: Is there a way to disable specific values of data-require attribute or perhaps disable the attribute itself? By adblock or CSS rules?
Title: Re: Does adblock deliberately miss some things?
Post by: Frenzie on 2015-08-25, 15:11:28
CSS can match by attribute.
Code: [Select]

div[data-require="modules/cookie-message"]

/* on all elements */
[data-require="modules/cookie-message"]

/* contains the specified value */
[data-require*="cookie"]
Title: Re: Does adblock deliberately miss some things?
Post by: ersi on 2015-08-25, 16:09:10
Thanks, Frenzie. This way to block stuff by CSS only works insofar as CSS has been implemented in the browser, right? For example in Elinks, implementation of CSS is incomplete.

And I forgot to properly ask the (in my opinion) more important question: Is there something about this particular arrangement of HTML and JS that prevents adblock functioning or is adblock mysteriously ignoring just this script? I.e. is it a structural limitation of adblock or an apparent backdoor in adblock?
Title: Re: Does adblock deliberately miss some things?
Post by: Frenzie on 2015-08-25, 19:34:46
Adblock does have some kind of acceptable ads feature; cookie stuff might be considered acceptable as well even if implemented in an annoying manner.