Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

@@*$generichide issue #507

Closed
vozersky opened this issue Jan 9, 2017 · 18 comments
Closed

@@*$generichide issue #507

vozersky opened this issue Jan 9, 2017 · 18 comments
Assignees

Comments

@vozersky
Copy link
Member

vozersky commented Jan 9, 2017

Generichide exceptions don't work correctly in Safari.

STR:

  1. Install 2.5.11 extension to Safari
  2. Import rules.txt
  3. Open:
    www.championat.com
    www.khabar.ndtv.com
    www.bild.de
@vozersky
Copy link
Member Author

duplicates #437

@ameshkov
Copy link
Member

@vozersky it is not duplicate I guess, something new.

@Mizzick it appears something is wrong with third-level domains.

Here is a relevant forum discussion:
https://forum.adguard.com/index.php?threads/ndtv-com-anti-adb-ios.18066/

@gotitbro
Copy link

@ameshkov $generichide filters don't work even on second level domains. For example:
Add ##img to User Filters and visit github.com all avatars should be hidden even after you add
@@||github.com^$generichide the avatars are still hidden.

@Alex-302
Copy link
Member

@gotitbro Can you confirm the same issue with $genericblock exclusions?

@gotitbro
Copy link

@Alex-302 $genericblock are working, I checked this by adding @@||timesofindia.com^$genericblock to the User Filter and the visited: http://m.timesofindia.com/world/us/obama-ends-open-door-policy-for-cuban-migrants-white-house/articleshow/56509375.cms

The ads were visible which would have been blocked by generic blocking rules such as ||doubleclick.net^ ads and ||clmbtech.com^ ads were visible.

@Mizzick
Copy link
Contributor

Mizzick commented Jan 16, 2017

[
	{
		"trigger": {
			"url-filter": ".*"
		},
		"action": {
			"type": "css-display-none",
			"selector": "img"
		}
	},
	{
		"trigger": {
			"url-filter": "^https?://([^/]*\\.)?championat\\.com[/:&?]?",
			"resource-type": [
				"document"
			]
		},
		"action": {
			"type": "ignore-previous-rules"
		}
	}
]

ok, this is a simple content blocker file, produced by only 2 rules:

##img
@@||championat.com^$generichide

but it doesn't work as expected.

@ameshkov
Copy link
Member

@Mizzick could it be that resource-type is the culprit?

@Mizzick
Copy link
Contributor

Mizzick commented Jan 16, 2017

I've tried without, I guess something is wrong with this url-filter

@ameshkov
Copy link
Member

ameshkov commented Jan 16, 2017

@Mizzick shouldn't it be ^https?:\/\/?

@ameshkov
Copy link
Member

@Mizzick just experiment with the url-filter then

Mizzick added a commit that referenced this issue Jan 16, 2017
@Mizzick
Copy link
Contributor

Mizzick commented Jan 16, 2017

ok, fixed

@ameshkov
Copy link
Member

@Mizzick wait a bit, I didn't mean you should get rid of url-filter:)

@ameshkov ameshkov reopened this Jan 16, 2017
@ameshkov ameshkov modified the milestones: 2.5 Safari Hotfix, 2.6 Jan 16, 2017
Mizzick added a commit that referenced this issue Jan 18, 2017
Mizzick added a commit that referenced this issue Jan 18, 2017
@Mizzick
Copy link
Contributor

Mizzick commented Jan 18, 2017

Temporary fixed with "if-domain" triggers

@Mizzick
Copy link
Contributor

Mizzick commented Jan 18, 2017

After some investigations, we've found that "url-filter" doesn't work properly for css exceptions("ignore-previous-rules" for "css-display-none").
As an example:

Testing on https://lenta.ru
with simple content blocker:

[{trigger: {url-filter: ".*"}, action: {type: "css-display-none", selector: "img"}},
 {trigger: {url-filter: "^https?://([^/]*\\.)?le.*"}, action: {type: "ignore-previous-rules"}}]

These url-filter trigger an exception and first rule is ingored:

                    //"url-filter": "https:*"
                    //"url-filter": "^https?:*"
                    //"url-filter": "^https?://*"
                    //"url-filter": "^https?://([^/]*\\.)?*"
                    //"url-filter": "^https?://([^/]*\\.)?l*"

But these do not:

//"url-filter": "https:\\/\\/lenta\\.ru"
                    //"url-filter": "https://lenta.ru/*"
                    //"url-filter": "https://lenta\\.ru"
                    //"url-filter": "https:\/\/lenta\.ru"
                    //"url-filter": "^https://lenta*"
                    //"url-filter": "^https?://lenta*"
                    //"url-filter": "^https?://icdn.lenta*"
                    //"url-filter": "^https?://lenta.*"
                    //"url-filter": "^https?://([^/]*\\.)?lent*"
                    //"url-filter": "^https?://([^/]*\\.)?le*"

@Mizzick Mizzick closed this as completed Jan 18, 2017
@gotitbro
Copy link

@ameshkov @Mizzick Can this be considered fixed then?

@ameshkov
Copy link
Member

ameshkov commented Jan 18, 2017

@gotitbro yep, we've rolled it back to what we had in v2.4

Additionally, I'll file a bug report to WebKit soon.

@gotitbro
Copy link

@ameshkov Can you push the fix to iOS as a minor update as well? Been waiting for a long time, can't access a lot of sites due to this bug.

@ameshkov
Copy link
Member

@gotitbro sure!

Mizzick added a commit that referenced this issue Jan 20, 2017
Mizzick added a commit that referenced this issue Jan 20, 2017
ameshkov added a commit that referenced this issue Jan 20, 2017
Mizzick added a commit that referenced this issue Jan 20, 2017
(cherry picked from commit 374418e)
Mizzick added a commit that referenced this issue Jan 20, 2017
(cherry picked from commit 3c83b15)
Mizzick added a commit that referenced this issue Jan 20, 2017
(cherry picked from commit b16ac31)
Mizzick added a commit that referenced this issue Jan 20, 2017
(cherry picked from commit c9bb971)
adguard pushed a commit that referenced this issue Sep 3, 2019
… to master

* commit '1f079d33ce46366531e443aae56e494631e81638':
  fix/1437 skip requests made by extension itself
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

5 participants