uBlock icon indicating copy to clipboard operation
uBlock copied to clipboard

Firefox: custom filter rule doesn't work properly

Open gituporabnik opened this issue 11 years ago • 12 comments

I noticed one of my custom filter rules doesn't work properly anymore. I am suspecting uBlock, beacuse I remember a while ago the same rule was working normally.

I've been using this custom filter rule: ||twitter.com^$domain=~twitter.com|~gov.si With this filter, I should be able to view twitter notifications on this site (the Twitter window is on the left side of the following website): http://meteo.arso.gov.si/met/sl/weather/fproduct/graphic/general/

But recently, the twitter notifications are blocked, despite I am using ~gov.si in the rule. If I delete the whole rule, twitter notifications window loads normally. Could you test it?

gituporabnik avatar Aug 19 '15 13:08 gituporabnik

I see the notifications just fine with default settings, with or without your custom filter.

gorhill avatar Aug 19 '15 13:08 gorhill

https://github.com/gorhill/uBlock/wiki/The-logger: logger reports the network requests are allowed:

10:03:18 @@||twitter.com$domain=gov.si      ++ frame https://syndication.twitter.com/i/jot
10:03:18 @@||twitter.com$domain=gov.si      ++ image https://syndication.twitter.com/i/jot/syndication?l=%7B%22_category_%22%3A%22syndicated_impression%22%2C%22triggered_on%22%3A1439992998791%2C%22dnt%22%3Afalse%2C%22event_namespace%22%3A%7B%22client%22%3A%22tfw%22%2C%22page%22%3A%22timeline%22%2C%22action%22%3A%22impression%22%7D%7D
10:03:18 @@||twitter.com$domain=gov.si      ++   css http://platform.twitter.com/embed/timeline.b67ffafa652943d0ebac45e422e410f7.default.css
10:03:18 @@||twitter.com$domain=twitter.com ++ image https://syndication.twitter.com/i/jot?l=%7B%22language%22%3A%22en%22%2C%22message%22%3A%22m%3Anocount%3A%22%2C%22widget_origin%22%3A%22http%3A%2F%2Fmeteo.arso.gov.si%2Fmet%2Fsl%2Fweather%2Ffproduct%2Fgraphic%2Fgeneral%2F%22%2C%22_category_%22%3A%22tfw_client_event%22%2C%22triggered_on%22%3A1439992998753%2C%22dnt%22%3Afalse%2C%22client_version%22%3A%22PRODUCTION%3Aa4d25a3d7b02e0238147a7d2980615a778ae29be%3A1438032965723%22%2C%22format_version%22%3A1%2C%22event_namespace%22%3A%7B%22client%22%3A%22tfw%22%2C%22page%22%3A%22button%22%2C%22section%22%3A%22follow%22%2C%22action%22%3A%22impression%22%7D%7D

gorhill avatar Aug 19 '15 14:08 gorhill

Just to let you know, I figured out the issue. I discovered that uBlock was somehow blocking the css request (http://platform.twitter.com) despite the exception rule. Instead of creating a separate exception rule only for css, I modified the existing rule from: ||twitter.com^$domain=~twitter.com|~gov.si to: ||^twitter.com^$domain=~twitter.com|~gov.si

Now the exception rule works well. Thanks anyway!

gituporabnik avatar Aug 19 '15 15:08 gituporabnik

I discovered that uBlock was somehow blocking the css request (http://platform.twitter.com) despite the exception rule.

This can't be. The only CSS request I see from platform.twitter.com is:

http://platform.twitter.com/embed/timeline.b67ffafa652943d0ebac45e422e410f7.default.css

And the request is properly "excepted" with your original custom filter ||twitter.com^$domain=~twitter.com|~gov.si, no need to add ^ before twitter.com.

Edit: By the way, the logger will always tell you why something is blocked, this information should be provided here.

gorhill avatar Aug 19 '15 15:08 gorhill

I made screenshots of Logger lists.

The 1st picture shows blocked/allowed requests with the original filter rule (||twitter.com ...): http://imgur.com/ICuKpDe

The 2nd picture shows the same, but with modified rule (||^twitter.com ...): http://imgur.com/r2Xbqrn

There are some remaining logs in both logger lists, but none of them are blocked. It is strange, beacuse platform.twitter.com requests arise only in the first case. But as you said, they shouldn't be blocked anyway.

I also need to mention that I have quite a few more filter rules in my custom list. But I deleted them temporarily to make sure they do not affect the website in this case. I also have Firefox Tracking Protection enabled. But I don't think this is related, since it is turned on all the time.

gituporabnik avatar Aug 19 '15 17:08 gituporabnik

In your first screenshot, I see that ||twitter.com is reported as the filter which blocks the requests. Can you click on this filter to find out from which filter list it comes from?

gorhill avatar Aug 19 '15 17:08 gorhill

As per your screenshot, the only explanation I can think of is that the context of the request is not gov.si nor twitter.com. You can find the context by clicking the fourth column in the logger for the blocked request (--), and select the Static filtering pane in the modal dialog. The context is the hostname spelled out after "and which originates [from ...]" (English version). Can you report this value here?

gorhill avatar Aug 19 '15 17:08 gorhill

I looked up the blocked requests in the static filter dialog.

I case of the original filter rule (||twitter.com...) there is 1 image and 1 css blocked from twitter, by which their URL matches with:

a) platform.twitter.com/embed/timeline.93933550310288c77a13ff57ab42950b.default.css which originates from: --> "pbs.twimg.com", except if there is exception rule: ||platform.twitter.com/embed/timeline.93933550310288c77a13ff57ab42950b.default.css$stylesheet,domain=pbs.twimg.com --> "twimg.com", except if exception: ||platform.twitter.com/embed/timeline.93933550310288c77a13ff57ab42950b.default.css$stylesheet,domain=twimg.com --> "anywhere", except if exception: ||platform.twitter.com/embed/timeline.93933550310288c77a13ff57ab42950b.default.css$stylesheet

b) platform.twitter.com/embed which originates from: --> "pbs.twimg.com", except if exception: ||platform.twitter.com/embed$stylesheet,domain=pbs.twimg.com --> "twimg.com", except if exception: ||platform.twitter.com/embed$stylesheet,domain=twimg.com --> "anywhere", except if exception: ||platform.twitter.com/embed$stylesheet

gituporabnik avatar Aug 19 '15 18:08 gituporabnik

Sorry, the upper description is for blocked css only, However in the case of image it is very similar: "stylesheet" in the the rules is replaced with "image".

gituporabnik avatar Aug 19 '15 18:08 gituporabnik

Not sure I understand all of your comment, but I think you are saying the context was twimg.com, in which case, try rewritting your original filter as:

||twitter.com^$domain=~twitter.com|~twimg.com|~gov.si

See if this works as originally intended.

gorhill avatar Aug 19 '15 19:08 gorhill

Yes, the original filter which you provided works now. Thank you!

It is interesting that the modified filter (||^twitter.com...) somehow managed to show twitter notifications properly even though there was no twimg.com rule included among exceptions.

I believe the issue is solved now.

gituporabnik avatar Aug 19 '15 19:08 gituporabnik

It is interesting that the modified filter (||^twitter.com...) somehow managed to show twitter notifications properly

That filter was discarded as non-supported. ^ should never appear immediately after ||.

gorhill avatar Aug 19 '15 20:08 gorhill