Skip to content

Loading…

Need help with exception syntax! #1160

Closed
erkjhgdfn opened this Issue · 9 comments

3 participants

@erkjhgdfn

screen shot 2015-04-02 at 20 27 00

How do I write an exception to these popups? My attempts have so far been futile and I'm not really sure what I'm doing wrong.

My exception filter: @@||http://bodybuilding.com/fun/nutrient-popup.php^

@ghost

You might want to try

@@popup.$domain=bodybuilding.com

@chrisaljoudi
Owner

@erkjhgdfn Hi! The rule you had there looks like it should work (or else I'm way behind on sleep). Mind sharing a URL where this is occurring?

@ghost

@chrisaljoudi : Chris, according to the image the filter

popup.

was triggered (although I didn't see it on my system when I loaded that site). So, shouldn't the exception created for that one?

@chrisaljoudi
Owner

@tlu1024 Exception filters, I believe, don't have to be the exact "opposite" of the original filter. They just have to match the URL you're trying to allow.

For instance, say you have a filter that looks like this:

tracking.js$script

We can see that would block a URL like https://google.com/tracking.js, right?

Now, if we add the following exception filter:

@@||google.com^$script

That URL will no longer be blocked — because it matches the rule in the exception filter.

Am I making sense? Sorry if not.

@my-password-is-password

The title of the page in his screenshot looks to be this link , http://www.bodybuilding.com/fun/7-quick-n-easy-lunches-for-a-healthy-diet.htm

Under "Ingredients", click the "1 can of Canned Light Tuna" link.

Using default lists didn't block the popup with popup.. I added popup.$popup to "My filters" to block it and to make an exception you have to add $popup or it didn't work.

This worked, @@||bodybuilding.com/fun/nutrient-popup.php^$popup
This didn't work, @@||bodybuilding.com/fun/nutrient-popup.php^

@chrisaljoudi
Owner

@my-password-is-password

Thanks for the link — much appreciated. :)

I was mistaken — popup-related filters do indeed require the filter to explicitly mention the $popup type (which makes sense).

Sorry about that.

@erkjhgdfn so, when you want a rule to affect popups, you should have the popup type suffix after the $. In other words, this should work for your example:

@@||bodybuilding.com/fun/nutrient-popup.php^$popup
@ghost

@chrisaljoudi

Exception filters, I believe, don't have to be the exact "opposite" of the original filter. They just have to match the URL you're trying to allow.

I agree. But the "opposite" should work nevertheless provided the filter syntax is correct, shouldn't it? Thus, the filter suggested by myself should probably be changed to

@@popup.$domain=bodybuilding.com,popup

I cannot test it as I don't see any popups on that site even with uMatrix deactivated.

BTW: Where is the popup option documented? I couldn't find it here.

@ghost

As a side note: Shouldn't issues regarding filters (which are not uBlock specific) strictly rejected and pointed to the Easylist forum instead? I think those countless issues were one of the major reasons why gorhill was more and more overburdened.

@erkjhgdfn erkjhgdfn closed this
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.