New feature: element showing rules

Everything about using Adblock Plus on Mozilla Firefox, Thunderbird and SeaMonkey

New feature: element showing rules

Postby jack.mauro » Thu Jun 26, 2014 2:13 pm

There are some pages that require a single JS file to:
- load ads
- display page content

it would be nice if adblockplus could make an element to be forcefully VISIBLE, the opposite of elemhide.css, and it would be easy to develop using the same binding technology.
This would make simple to block the JS and still show the page content.
jack.mauro
 
Posts: 10
Joined: Thu Dec 06, 2012 10:39 am

Re: New feature: element showing rules

Postby Gingerbread Man » Thu Jun 26, 2014 7:14 pm

Element hiding rules rely on CSS. They don't have anything to do with files like external scrips, which are affected by the blocking mechanism.

Adblock Plus would have to sift through a script file to check what that script is trying to do, and allow it to perform the non-related ad function. That would be either impossible or extremely complicated while providing little benefit.
User avatar
Gingerbread Man
 
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am

Re: New feature: element showing rules

Postby jack.mauro » Sat Jun 28, 2014 10:40 am

I know Element hiding uses CSS.
my suggestion is: create a rule like this:

adblockplus.org###review$Show
this rule sound bind a css display:inline; visibility:visible

it may (if easy to develop) accept some specific parameter for display like this:

adblockplus.org###review$Show=block
this rule sound bind a css display:block; visibility:visible

This should be easy to develop because it's a small edit to element hiding rules.

I wrote about JS becaust i want to explain WHY i'm asking this rule:
try to figure this scenario:
Code: Select all
<html>
    <body>
        <div id="noadblock">DO NOT USE ADBLOCK!</div>
        <div id="noadblock2" style="display:hidden;visibility:collapse">
            Real content of the page...
            ...
            <script src="load-ads-here.js"></script>
            ...
           
        </div>
    </body>
</html>


the load-ads-here.js performs 3 operations:
- insert an ads inline
- document.getElementById("noadblock").style.display="none";
- document.getElementById("noadblock2").style.display="inline";
- document.getElementById("noadblock2").style.visibility="visible";

In this scenario, i cannot use adblockplus to prevent load-ads-here.js from being loaded because it would break the page.

if the element show rule is implement i can write these rules:

Code: Select all
||example.com/load-ads-here.js|$script
example.com###noadblock
example.com###noadblock2$show


this would make the page visible AND the ads not loaded.
jack.mauro
 
Posts: 10
Joined: Thu Dec 06, 2012 10:39 am

Re: New feature: element showing rules

Postby Gingerbread Man » Sat Jun 28, 2014 4:16 pm

For your example, add these filters to Adblock Plus:
Code: Select all
||example.com/load-ads-here.js|
example.com###noadblock

And add the following style in Stylish:
Code: Select all
@-moz-document domain("example.com") {
 
#noadblock2 { display: inline !important; visibility: visible !important; }

}

I think that the situation you describe is a bizarre edge case. Styling web pages is the domain of add-ons like the aforementioned Stylish and outside the scope of Adblock Plus. Still, if you feel strongly about this, you can file a new issue report. Edit: Someone else did.
:arrow: https://issues.adblockplus.org/ticket/756
User avatar
Gingerbread Man
 
Posts: 1339
Joined: Fri Aug 12, 2011 5:28 am


Return to Adblock Plus for Firefox support

Who is online

Users browsing this forum: MarkCek and 18 guests