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

Custom Filters exception tag not working as expected #1798

Open
gortron opened this issue Aug 9, 2024 · 4 comments
Open

Custom Filters exception tag not working as expected #1798

gortron opened this issue Aug 9, 2024 · 4 comments
Assignees

Comments

@gortron
Copy link

gortron commented Aug 9, 2024

I noticed an issue with the Experimental Ad-Blocking Filters > Customer filters setting.

Environment:

  • iOS
  • 17.6.0
  • Safari

Repro steps:

  1. Add ||youtube.com^$document as a custom filter
  2. Add @@||youtube.com/watch as a custom filter
  3. See DNR output which includes:
{
  "id": 2,
  "priority": 101,
  "action": {
    "type": "block"
  },
  "condition": {
    "resourceTvpes": [
      "main frame"
    ],
    "urlFilter": "||youtube.com^"
  }
}
{
  "id": 2,
  "priority": 100001,
  "action": {
    "type": "allow"
  }, 
  "condition": {
    "urlFilter": "||youtube.com/watch"
  }
}

Expected behavior: youtube.com/ home page is blocked, BUT youtube.com/watch?v=... videos are NOT blocked.

Actual behavior: youtube.com/ home page is blocked, AND youtube.com/watch?v=... videos ARE blocked.

Let me know if there are any other details I can provide for this issue.

@chrmod
Copy link
Member

chrmod commented Aug 12, 2024

hi @gortron - thank you for reporting. Have looked into this issue and it looks like the block filter for youtube main page should be slightly different. Does this one works for you ||youtube.com/^$document?

@gortron
Copy link
Author

gortron commented Aug 20, 2024

Thanks @chrmod!

Doing so updates the DNR output to be:

{
  "id": 2,
  "priority": 101,
  "action": {
    "type": "block"
  },
  "condition": {
    "resourceTvpes": [
      "main frame"
    ],
    "urlFilter": "||youtube.com/^"
  }
}
{
  "id": 2,
  "priority": 100001,
  "action": {
    "type": "allow"
  }, 
  "condition": {
    "urlFilter": "||youtube.com/watch"
  }
}

And the Actual behavior: youtube.com/ home page AND youtube.com/watch?v=... videos are NOT blocked.

Generally, it seems like Exclusion tags are not working as expected.

@chrmod
Copy link
Member

chrmod commented Aug 22, 2024

@GRadziejewski can you test this please? It works fine on my end.

@gortron when testing do you force-refresh the page? Youtube is using service workers for caching, so the page may load from cache and network filter wont be able to stop that.

@GRadziejewski
Copy link
Contributor

@chrmod On my machines it looks like this:

||youtube.com^$document
@@||youtube.com/watch

macOS:

Screen.Recording.2024-08-27.at.18.27.50.mp4

image

iOS (I had to wait a bit for it to work, but at the end check the results):

RPReplay_Final1724776577.MP4

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants