-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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
Blocking "early" requests is not possible #1327
Comments
Thing is, even the reading of the user settings -- which contains the state of the "advanced user mode" -- is asynchronous, so theoretically uBO could still be waiting on those settings to be loaded after it has handed control over to FF (i.e. finished executing its first-pass initialization code). |
Oops, didn't realize that reading extension settings was async... |
I have floated the idea of hidden settings since a while now to deal with a number of demands for specific behaviors sort of trivial to implement -- as long as there is no UI and no complicated code paths to add (actually there is already one such setting used in the logger, So this could be one of those settings. uBO could completely block a page from loading, and once initialization is done, it could force a reload of the pages which were blocked. The worry though here is about those behind-the-scene tabs (to not confuse with |
Fixed with 8c3da95. Need to be tested. If the fix does not help, then it will mean there is nothing uBO can do. Behind-the-scene network requests are left untouched, regardless of filters/rules -- behind-the-scene network requests are tabless, there is no tab which can be force-reloaded once all filters/rules are loaded. |
Oddly, I can't reproduce this issue in uBlock Origin 1.9.17b4 even without flipping that setting. I'd say the fix definitely helped. We'll flip the setting anyway and let you know any issues. Thanks. 😃 |
Link to the documentation on how to enable early blocking: https://github.com/gorhill/uBlock/wiki/Advanced-settings#suspendtabsuntilready-experimental. |
In Chrome, I wonder if uBlock could make use of |
RESOLVED FIXED in Firefox 61 https://bugzilla.mozilla.org/show_bug.cgi?id=1447551
Maybe after this will finally work https://bugzilla.mozilla.org/show_bug.cgi?id=1457224 |
Network part was fixed in Let webRequest listeners see/block requests from early after browser startup #1447551 but required about:config pref Firefox should be OK now at least for network filtering. |
Related issues: - #2067 - uBlockOrigin/uBlock-issues#128 Related mozbug issue: - https://bugzilla.mozilla.org/show_bug.cgi?id=1503721
This is no longer experimental on Firefox: 41548be as of 1.17.5b17. Firefox supports the ability to block early requests when a webRequest listener is registered in a certain way, see https://bugzilla.mozilla.org/show_bug.cgi?id=1503721. |
Environment: SeaMonkey 2.39, uBlock Origin 1.6.0 (self build from c7f1027 ), new profile
Steps to reproduce:
(shouldn't matter but I'm starting SeaMonkey from command line like:
seamonkey -p
. I have seen this issue starting SeaMonkey normally though.)(if re-testing with the same profile, clear cache before restarting SeaMonkey again, to make sure nothing is loaded from cache)
Expected results: image is blocked
Actual results: image appears on screen (it loaded). The image does not get blocked until reloading the page.
(Un-checking "Hide placeholders of blocked elements" makes it easier to see what's going on, but is not necessary to reproduce the problem.)
IIUC this is not technically possible to fix in non-Gecko-based-browsers because there the browser doesn't load extensions until after firing the first network requests, making this moot. However, in Gecko-based browsers the extensions are loaded before any requests are fired, and can have control over these requests.
It is not reasonable to expect that uBlock Origin can finish initializing all its filters before the browser can fire requests, so I would suggest to fix the problem something like this: When "I am an advanced user" is checked, allow the user to choose whether "early" network requests (requests fired before uBlock Origin is finished loading) are allowed or blocked (default to allow, and this setting locked to allow if "I am an advanced user" is un-checked). (Also preferably blocking "early" requests would not be strict-blocked - that is, not blocked unless requested by a document loaded in a browser window/tab. But if top-level documents would have to be blocked as well, it wouldn't end to be a big deal.)
The text was updated successfully, but these errors were encountered: