GithubHelp home page GithubHelp logo

Comments (36)

gorhill avatar gorhill commented on July 20, 2024

Gee I have no clue what the option document means (reading the official doc didn't help). Anyone?

from ublock.

 avatar commented on July 20, 2024

The spreadsheet "Filter options" on the ABP cheatsheet says:

Used to whitelist the page itself (e.g. @@||example.com^$document)

And this forum thread which discusses full domain blocking also suggests that this option is used for full domain whitelisting.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

Used to whitelist the page itself

But that's the default behavior, ABP never blocks main doc requests. And as for whitelisting whole domain, @@||example.com^ would work just fine, isn't?

I suppose this means I can just discard the now meaningless document option (I guess it was useful back when ABP could block main doc requests).

from ublock.

 avatar commented on July 20, 2024

Perhaps this explanation helps.

@@||example.com^$document - allow everything (from any domain) while surfing on example.com
@@||example.com^$~document - allow everything hosted on example.com (no matter whether you're currently on example.com or not)
@@||example.com^ - both of the above

In other words: @@||example.com^ is more comprehensive than @@||example.com^$document

from ublock.

gorhill avatar gorhill commented on July 20, 2024

Thanks, I see now.

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

I used it to disable adblock on specific pages, like @@||youtube.com/^$document => only disables adblock on the homepage, not on the search / view pages.

By the way, https://github.com/gorhill/uBlock/wiki/Change-log#0109 release date :)

from ublock.

gorhill avatar gorhill commented on July 20, 2024

By the way, https://github.com/gorhill/uBlock/wiki/Change-log#0109 release date :)

I don't have a zip for this one. I had one, which was mainly for submission to the Opera store, then there was an issue which now I forgot and I had to cancel the submission, and by the time I re-submitted I was at 0.1.0.10. I forgot what was the issue with 0.1.0.9, looking at the details in commits would probably refresh my memory.

Edit: Ok, there was that in 0.1.0.9: gorhill/uBlock@a6496e5. I thought because of it it was not worth having a version for 0.1.0.9, it's a bad bug.

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

This is, by the way, used to whitelist sites (not whole domains), for example I don't care about ads on the Youtube start page (so path = '/'), but I don't like the in-video ads.

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

Do you have any plans to work on this? If not I'd love to take look at it.
@gorhill

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

Although it would be nice to have the $document option, it works more as a whitelist. So, instead of implementing the document option, you (I) could extend the current whitelist, to support pages (http://domain.tld/sub/folder/whitelisted) or whole hostnames (as it's now) as input.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

I don't mind supporting it as a filter. But frankly the meaning still confuses me. Forget the exception form, I want to understand the basic form:

||example.com^$document

What does this accomplish, and how is this different than:

||example.com^

I still don't get it.

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

"document — the page itself (only exception rules can be applied to the page)" from the official doc :)

from ublock.

 avatar commented on July 20, 2024

I don't mind supporting it as a filter. But frankly the meaning still confuses me. Forget the exception form, I want to understand the basic form:

||example.com^$document

What does this accomplish, and how is this different than:

Everything on example.com is allowed only while you're surfing on
example.com

||example.com^

Everything hosted on example.com is allowed even if you're surfing on
other webesites because also

@@||example.com^$~document

is covered by this rule.

That's how I understand it.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

Everything on example.com is allowed only while you're surfing on example.com

If you meant that for ||example.com^$document the definition is "Everything on example.com is blocked only while you're surfing on example.com", than I think I get it.

What needs to be tested when the $document option is present is the URL of the page, not the URL of the request. The result is then saved internally and from there this means all the embedded content of the page is blacklisted (the block form), or all the embedded content of the page is whitelisted (the allow form), completely disregarding filtering for embedded content.

Amirite?

from ublock.

 avatar commented on July 20, 2024

Sorry, I had not seen that the @@ were missing ;-)

However, https://adblockplus.org/en/filters#options clearly says:

"document — the page itself (only exception rules can be applied to the page)"

In other words, this option does not apply to blocking rules.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

In other words, this option does not apply to blocking rules

Well, I will support it internally, and the user if free to create such a rule if he chooses to. I don't see why this would be forbidden if someone wants it as their own filter.

from ublock.

 avatar commented on July 20, 2024

In other words, this option does not apply to blocking rules

Well, I will support it internally, and the user if free to create such a rule if he chooses to. I don't see why this would be forbidden if someone wants it as their own filter.

This might explain it:
https://adblockplus.org/forum/viewtopic.php?t=18774

from ublock.

 avatar commented on July 20, 2024

Well, I will support it internally, and the user if free to create such a rule if he chooses to. I don't see why this would be forbidden if someone wants it as their own filter.

Supporting this would not cause any harm, I suppose. On the other hand, is it really useful? This option would - as discussed above - block a whole site only while surfing on it. But if you block a site (usually a malware domain/adserver/tracker) you would definitely prefer

||example.com^

as it is simply more comprehensive (it blocks anything from that site even if you're not surfing on it). I don't really see any cases where using this option would be useful (but perhaps my imagination is not vivid enough ;-) ). And that's probably the reason why it was abandoned for blocking rules (siteblocking) in ABP.

Again, if it doesn't hurt - why not? But I think it's of little avail, if any.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

On the other hand, is it really useful?

It's useful code-wise: I don't have to create an exception for that particular filter. No exception means no special code path. No special code path means simpler logic and less code. Simpler logic and less code means lower likelihood of bugs and unwanted side effects.

from ublock.

 avatar commented on July 20, 2024

I understand. This makes sense.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

Ok, this will have to wait. It's not that simple. I actually see only one such filter in EasyList (out of the 47,000+ lines):

@@||oascentral.feedroom.com/realmedia/ads/adstream_sx.ads/brighthouse.com/$document,domain=oascentral.feedroom.com

There are six more, but they come with the subdocument keyword, which if I understand properly means, "disable filtering for when the request is made from within the frame". Actually I am not even sure how to read aloud such filter:

@@||accounts.google.com^$document,subdocument,domain=adwords.google.com

Given the probable infrastructure work required, given the (very low) occurrences of such a filter option, and given the low demand for such a filter option, it certainly doesn't look like a priority compared to other issues on the lists. I'm sending this back to the boiler plate for now.

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

I understand that, but at the moment there is no other possibility to whitelist a single page (e.g. only gorhill/uBlock#5, not whole github). With this filter syntax it is possible. On the other hand, I'd say it'd be better to just upgrade the current whitelist, to support subpages, not only hostnames.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

I understand that, but

If you look at all the issues opened for uBlock and HTTPSB, which ones in your opinion need to be addressed first for when I dedicate time to write some code? Would this one here be on that list of issues which are to be fixed first for the benefit of a majority of users?

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

Of course not, but a whitelist is still a huge part of an Adblocker, that's what I wanted to point out. No hurries, take your time!

from ublock.

kikaxa avatar kikaxa commented on July 20, 2024

Just stopped by to write that I used this form of filter ONCE to completely disable filtering for one page, while blocking lots of resources from the others.

As it's not implemented for now, i switched to more precise resource blocking for now, and it wasn't without a bit of pain for me.

For me, a simple page whitelist would suffice.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

I will implement ability to whitelist a specific web page.

from ublock.

kurtextrem avatar kurtextrem commented on July 20, 2024

Thank you!

from ublock.

gorhill avatar gorhill commented on July 20, 2024

This is need some testing before an official release, due to numerous changes throughout: https://github.com/gorhill/uBlock/releases/tag/0.3.2.0-rc0

from ublock.

 avatar commented on July 20, 2024

I just tried the rc on a couple of sites, and whitelisting works very well. Holding the Ctrl key while clicking the power switch to get a URL-based whitelist directive is really cool and seems to work reliably.

from ublock.

 avatar commented on July 20, 2024

Regarding the tooltips: They are not readable because they are (nearly completely) hidden behind the popup menu.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

There is no custom tooltip, these are the default as per browser: I really just added title attributes on the elements. What browser/version are you using?

from ublock.

 avatar commented on July 20, 2024

Google Chrome v. 36 64 bit on Arch Linux

from ublock.

gorhill avatar gorhill commented on July 20, 2024

Problem has to be the browser, as said, I just created title attributes, the browser decides how to render these. Try Disconnect, it has similar tooltips.

from ublock.

 avatar commented on July 20, 2024

You're right. Same problem with Disconnect.

from ublock.

gorhill avatar gorhill commented on July 20, 2024

What window manager are you using on Arch?

from ublock.

 avatar commented on July 20, 2024

KWin. I'm a KDE fanboy.

from ublock.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.