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

Dynamic Filter: 3rd party scripts not blocked if in cache #893

Closed
7 of 8 tasks
Zauberfisch opened this issue Feb 11, 2020 · 15 comments
Closed
7 of 8 tasks

Dynamic Filter: 3rd party scripts not blocked if in cache #893

Zauberfisch opened this issue Feb 11, 2020 · 15 comments
Labels
invalid not a uBlock issue

Comments

@Zauberfisch
Copy link

Zauberfisch commented Feb 11, 2020

Bold text is updated/additional information from comments

Prerequisites

  • I verified that this is not a filter issue
  • This is not a support issue or a question
  • I performed a cursory search of the issue tracker to avoid opening a duplicate issue
    • Your issue may already be reported.
  • I tried to reproduce the issue when...
    • uBlock Origin is the only extension
    • uBlock Origin with default lists/settings
    • using a new, unmodified browser profile
  • I am running the latest version of uBlock Origin
  • I checked the documentation to understand that the issue I report is not a normal behavior

Description

In chrome & chromium it appears that not all 3rd party scripts are blocked.
I have set 3rd party scripts to be blocked, but some 3rd party resources (eg cdnjs.cloudflare.com & ravenjs.com) are still loaded.
In firefox uBlock behaves as expected and blocks all scripts.
Edit: appears to effect only 3rd party scripts that are cached by chrome. Disabling cache in developer tools fixes this issue

Screenshots

(chrome with wrong behaviour left, firefox with correct behaviour right):
Logged In
uBlock

Not logged in
uBlock1

A specific URL where the issue occurs

Steps to Reproduce

  1. activate "I am an advanced user"
  2. block all 3rd party scripts in the dynamic filters
  3. EDIT: ensure "Disable cache" is not active in chromes developer tools
  4. visit patrenon.com

Expected behavior:

3rd party scripts should not be loaded (firefox does this correctly)

Actual behavior:

chrome will load some 3rd party scripts
EDIT: the scripts loaded appear to only be scripts that are cached

Your environment

  • uBlock Origin version: v1.24.4 (in both, firefox and chrome)
  • Browser Name and version:
    • Google Chrome: Version 80.0.3987.87 (Official Build) (64-bit)
    • Chromium: Version 80.0.3987.87 (Official Build) Arch Linux (64-bit)
    • Mozilla Firefox: 72.0.2 (64-bit)
  • Operating System and version: OS: Manjaro Linux x86_64, Kernel: 5.5.2-1-MANJARO
@liamengland1
Copy link

Can't reproduce this.

@Zauberfisch
Copy link
Author

Could this be a timing thing? Having restarted my browser, I can't reproduce it anymore either

@Zauberfisch
Copy link
Author

ok, I've done some more testing:

  1. activate "I am an advanced user"
  2. block all 3rd party scripts in the dynamic filters
  3. visit patrenon.com (will LOAD 3rd party scripts)
  4. restart browser
  5. visit patrenon.com (will NOT load 3rd party scripts)
  6. unblock 3rd party scripts
  7. block all 3rd party scripts in the dynamic filters
  8. visit patrenon.com (will LOAD 3rd party scripts)

@Zauberfisch
Copy link
Author

If I disable the cache in chromes developer tools (tab network), 3rd party scripts will be blocked correctly. So without looking into it any deaper, it appears to be an issue with cache. I'm updating the issue to contain all those details

@Zauberfisch Zauberfisch changed the title Chrome - Dynamic Filter: Not all 3rd party scrips blocked Chrome - Dynamic Filter: 3rd party scrips not blocked if in cache Feb 11, 2020
@uBlock-user uBlock-user changed the title Chrome - Dynamic Filter: 3rd party scrips not blocked if in cache Dynamic Filter: 3rd party scrips not blocked if in cache Feb 11, 2020
@uBlock-user
Copy link
Contributor

Cached resources don't make network requests, so uBO cannot filter them. Cache needs to be overridden, so the browser will make a connection request again and uBO will be able to filter it.

@uBlock-user uBlock-user added the invalid not a uBlock issue label Feb 11, 2020
@uBlock-user uBlock-user changed the title Dynamic Filter: 3rd party scrips not blocked if in cache Dynamic Filter: 3rd party scripts not blocked if in cache Feb 11, 2020
@gorhill
Copy link
Member

gorhill commented Feb 11, 2020

Press shift when clicking the refresh button to ensure the browser's memory-based cache is bypassed.

@Zauberfisch
Copy link
Author

ok, fair enough. But should we perhaps document this somewhere inside the application?
Some small hint, or perhaps make the refresh button that is built into uBlock always do a full refresh that also flushes the cache?

@Rudxain
Copy link

Rudxain commented Aug 20, 2024

I can't find this documented anywhere on the Wiki

@stephenhawk8054
Copy link
Member

There are many issues related to network / service worker caches. I don't think it's practical to document everything related to it in the wiki.

@garry-ut99

This comment was marked as abuse.

@Rudxain
Copy link

Rudxain commented Aug 20, 2024

I don't think it's practical to document everything related to it in the wiki.

I agree. What about adding a catch-all warning along the lines of "uBO can't block cache-hits, as this is a limitation of the browser API. Any type of resource can be cached by the browser, even across sites."

@uBlock-user
Copy link
Contributor

uBO can't block cache-hits

Nothing to do with uBO, all firewalls/blockers cannot block or do anything when there's no network request made to filter.

@gorhill
Copy link
Member

gorhill commented Aug 20, 2024

uBO can't block cache-hits

It can. It just cannot block specific cache-hits, those which short term memory-based.

@Zauberfisch
Copy link
Author

It's unclear what do you both mean by word "this":

(A) that reloading with Shift + click will bypass the cache
(B) or that "3rd party scripts might not be not blocked if in cache"

I believe I ment (A), but this is a pretty old ticket.
If that's documented now/a hint visible in the GUI, my concern is satisfied.

@garry-ut99

This comment was marked as abuse.

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

No branches or pull requests

7 participants