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

Blocking with extensions #60

Open
sandstrom opened this issue Dec 1, 2022 · 1 comment
Open

Blocking with extensions #60

sandstrom opened this issue Dec 1, 2022 · 1 comment

Comments

@sandstrom
Copy link

One problem with giving these a dedicated resource type, is that ad-blocker extensions may just auto-block all requests of this particular type.

If they would share the resource type with fetch requests (after all, they'd be similar to a keepAlive fetch in many regards), with no way for an extension to discern them from other fetch requests, then the ad-blocker extension would need to look at the URL to determine whether to block it or not.

By forcing them to look at the URL, it's likely that ads and third-party scripts would still be easy to block, but legit first-party usage, such as a SaaS-application, could still rely on it (as long as that particular SaaS-domain isn't added to a blacklist).

I understand there are drawbacks to this too, but something to consider.

@mingyc
Copy link
Collaborator

mingyc commented Dec 2, 2022

I assume you are talking about the beacon type in webRequest.ResourceType.

The current API proposal actually doesn't specify to support webRequest listener, i.e. using beacon won't get you to handle the Pending*Beacon requests. I think it's reasonable as this API delegates request-sending to browser, and in some cases, it's impossible to listen to PendingBeacon requests in JS, as the document where the request was created may longer exist when the browser sends PendingBeacon requests or gets PendingBeacon responses.

To disable PendingBeacon API or filter URLs, the extension has to replace the global PendingGetBeacon/PendingPostBeacon ctor with empty functions or a custom functions with filter in it.

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

2 participants