-
Notifications
You must be signed in to change notification settings - Fork 56
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
A network request made from a worker is still subject to blocking rule(s) even when allowAllRequests is in place #737
Comments
The issue is that using The steps to reproduce:
When selecting "no filtering", uBOL adds a dynamic DNR {
"action": {
"type": "allowAllRequests"
},
"condition": {
"requestDomains": [
"zaber.com"
],
"resourceTypes": [
"main_frame"
]
},
"id": "_dynamic/8000000",
"priority": 100
} The page will be reloaded. See that there are still network requests blocked as per Network pane despite the My understanding is that these network requests originate from service worker loaded from |
Hi both, thanks for raising this. We discussed it in yesterday's meeting (#742) and were all in agreement that we want to expose as much as possible to the API - and that service worker requests should be part of that. At the same time, the current behavior is likely working as intended since the request is being made from a service worker. It's hard to attribute a request from a service worker to a specific tab and so it's unclear how Do you have any thoughts on what the requirements are for the most important use cases, and what changes we could make to the API to support that? For example, we could apply |
The simple fact is that extension authors could apply workarounds to get "disable on a site" functionality to work in Manifest V2. Now we are stuck with Manifest V3, and just as feared, we have to convince browsers to fix what already worked well enough in MV2. |
When there is an |
The On service workers specifically, it's possible to write code like this:
In that case, the request for There are certainly some more feasible things to look at - for example maybe we could block the service worker from ever seeing a |
If |
Our filter This fixes a couple of undue blocking. However there are still network requests to Request 1:{
"documentLifecycle": "active",
"frameId": -1,
"frameType": "outermost_frame",
"initiator": "https://www.zaber.com",
"method": "GET",
"parentFrameId": -1,
"requestId": "11208",
"tabId": -1,
"type": "xmlhttprequest",
"url": "https://www.googletagmanager.com/gtag/js?id=G-LPVSPC812X&l=dataLayer&cx=c>m=45He4cc1v841624434za200"
} Triggered local {
"action": {
"redirect": {
"extensionPath": "/web_accessible_resources/google-analytics_analytics.js"
},
"type": "redirect"
},
"condition": {
"resourceTypes": [
"script",
"xmlhttprequest"
],
"urlFilter": "||googletagmanager.com/gtag/js"
},
"id": "_dynamic/428",
"priority": 20
} Request 2:{
"documentLifecycle": "active",
"frameId": -1,
"frameType": "outermost_frame",
"initiator": "https://www.zaber.com",
"method": "GET",
"parentFrameId": -1,
"requestId": "11210",
"tabId": -1,
"type": "xmlhttprequest",
"url": "https://www.googletagmanager.com/gtag/destination?id=AW-1071949151&l=dataLayer&cx=c>m=45He4cc1v841624434za200"
} Triggered {
"action": {
"type": "block"
},
"condition": {
"domainType": "thirdParty",
"requestDomains": [
"0emm.com",
"0stats.com",
"100widgets.com",
"103bees.com",
"105app.com",
"11nux.com",
"123-counter.de",
"123compteur.com",
"123count.com",
"123date.me",
"...",
"zontera.com",
"zoomanalytics.co",
"zoomino.com",
"zoosnet.net",
"zoossoft.net",
"zprk.io",
"ztcadx.com",
"zuzab.com",
"zwaar.org",
"zx-adnet.com"
]
},
"id": "default/12396",
"priority": 10
} Two other network requests to High priority allow rules which were added as a result of the site being set to no-filtering:{
"action": {
"type": "allow"
},
"condition": {
"initiatorDomains": [
"zaber.com"
],
"resourceTypes": [
"script"
]
},
"id": "_dynamic/8000001",
"priority": 100
}
{
"action": {
"type": "allowAllRequests"
},
"condition": {
"requestDomains": [
"zaber.com"
],
"resourceTypes": [
"main_frame"
]
},
"id": "_dynamic/8000000",
"priority": 100
} I gather that those two last rules worked because the network request The initiator for the two unduly blocked |
Sorry, shortly after I commented above, I realized that the blocked network requests were {
"action": {
"type": "allow"
},
"condition": {
"initiatorDomains": [
"zaber.com"
],
"resourceTypes": [
"script",
"xmlhttprequest"
]
},
"id": "_dynamic/8000001",
"priority": 100
} So in the end no issue, we just need to use better targeted filters, and better targeted allow rules. |
Actually there is still just a small hurdle left to properly enforce disabling a content blocker on a specific site: the issue is that the
I understand that it does not make sense to use tab ids for actual tabs, which is going to be different from a session to another, but this is not true for The idea is that when someone disable content blocking for a specific site, we want to allow all network requests for when the site is loaded as top site, not necessarily when the site is loaded embedded in a I suppose for now I could re-create those session rules at extension launch, but I am not sure they could be enforced in time in case the user navigate to a site by the browser launching from an external application. |
As far as uBO Lite is concerned, I consider this issue solved with no changes required to DNR API. It can be closed unless other content blockers suffering the same issue think differently. There could still be edge cases of creating the session rules after a page started loading at browser launch, but I think this should be its own issue if ever this becomes an actual issue to end users. |
There is some discussion above on the usefulness of "allowAllRequests" and the infeasibility of supporting that in general with service workers. If there are concrete proposals to address that use case, I'd welcome separate issues so that they can be evaluated separately by the members of this group, including the browser vendors. Since this report was originally motivated by a use case from uBlock Origin, and @gorhill stated that this is a non-issue with the current DNR API, I'm inclined to close this issue. |
uBlockOrigin/uBOL-home#247
The text was updated successfully, but these errors were encountered: