You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Reacted by Adam Porter, Peter Petrov, Laicurè Leviarè, sanotaince, Md Adyelullahil Mamun, Angelore, Stephen, Edoardo, Felipe Kunzler, Constantine and 12 more
I'm not sure how are they planning to change the background process and origin access, it might cause some issues. Beside that, I don't see anything else that can cause problems. As for remotely-hosted code, it really should've been forbidden since the beginning.
The declarativeNetRequest API is an alternative to the webRequest API. At its core, this API allows extensions to tell Chrome what to do with a given request, rather than have Chrome forward the request to the extension. Thus, instead of the above flow where Chrome receives the request, asks the extension, and then eventually gets the result, the flow is that the extension tells Chrome how to handle a request and Chrome can handle it synchronously. This allows us to ensure efficiency since a) we have control over the algorithm determining the result and b) we can prevent or disable inefficient rules. This is also better for user privacy, as the details of the network request are never exposed to the extension.
This API is currently being implemented, and will be available to both the current manifest version and Manifest V3, but will be the primary way to modify network requests in Manifest V3.
Looking at the new API page, it's a rather different way of doing things. I would expect big changes needed to uBO and other blockers. (Plus there's the change from background page to ServiceWorker.)
Another change would be dynamic Content Scripts similar to what Firefox has where extensions can inject contentScript and have it execute before page finishes loading.
It appears that Google is phasing out the webRequest API
It is explicitly stated this is meant to phase out webRequest API? If so, where? Quickly perusing the page, I don't see such phase out being stated. If there is really such phase out planned, and if the declarativeNetRequest is strictly an implementation of static filtering à la ABP, this would be the death of uBO and uMatrix.
There is no way to transpose either either dynamic filtering, dynamic URL filtering, per-site/per-scope switch logic (let's refer to all these as "dynamic filtering"), into static filters. Dynamic filtering logic requires an arbitrary amount of block/allow rules overriding other block/allow rules based on specificity. There is no concept of specificity in static filtering -- and even more, there is no concept of dynamic filtering rules relinquishing filtering to static filters (dynamic filtering's noop rules).
Basic ABP-like syntax, 30000 filters MAX...
And there I was recently testing how uBO handled over half a million network filters with the 3rd-gen HNTrie...
Issues of performance and privacy lie with web sites, not uBO -- so I don't feel concerned with the issues of privacy and efficiency being put forth as advantages of using declarativeNetRequest over webRequest.
Reacted by mikhoul, DavidJCobb, HRXN, Peter Petrov, sanotaince, Tamás Deme, Joseph Lorenzo Hall, Marek33, Tirumala, George and 5 more
Read the paragraph that's titled DeclarativeNetRequest. They will keep webRequest API but it will not block, modify or redirect anymore, that will be handled by NetRequest API with v3.
Notes regarding removeparam= filter option, specifically I was looking to integrate the AdGuard URL Tracking Protection filter list, which purpose is to remove query parameters often used for tracking purpose.
The findings are that this filter list can't really be ported on a permission-less content blocker based on declarativeNetRequest API because host permissions must be granted for both the initiator domain and the request domain -- as per API documentation:
The declarativeNetRequestWithHostAccess permission always requires host permissions to the request URL and initiator to act on a request.
A majority of filters in that list looks as follow (excerpt):
The fact that they are meant to remove the query parameters of any outgoing network request means that for these to work in an a priori permission-less extension would require the extension to request the *://*/* broad host permission, which the browser would warn with:
At which point it becomes pointless to be permission-less, and at which point we are back to defeating one of the stated benefits of MV3 regarding privacy.
In fact, the scary warning does not make sense at all with what is actually happening.
The whole purpose here is to remove query parameters used for tracking, and these query parameters are not data owned by the user as implied by the warning, these are data only useful to some undisclosed entities which are 3rd-party to the users and possibly to even the visited websites, and wanting to remove these should not be presented with a questionable warning that the extension is asking for read/write access to your data.
The official announcement doesn't make it clear whether we still can push updates to MV2 extensions after January 2023. The previous announcement said that as of January 2023:
Developers may no longer push updates to existing Manifest V2 extensions.
Side note regarding performance in MV3: although uBO Lite does everything declaratively, we must not assume that MV3 extensions will automatically be measurably more performant than their MV2 counterparts. The only way to make the case of enhanced performance is actual benchmarks which measure real world scenarios, and whether the differences if any are meaningful to end users.
I see too many comments presuming content blockers in MV3 will be more performant, but the only way to make such statements is objective performance measurements of real world scenarios (example).
At the moment, content blockers which require a up and running service workers appear to be doing worse than their MV2 counterpart, and for those not requiring an up and running service worker (as in uBOL), only benchmarking will tell whether they perform better, and if so by which amount. For instance, months ago I measured that uBO's network filtering matching algorithm was more performant than another well-known one compiled to native, so we should not presume one way or another regarding performance, sometimes the results are contrary to expectations.
I saw these results a few days ago but I don't think we can draw conclusions about the DNR's performance, except maybe that matching does not take more time than what is reported on these graphs. The timing measurements require that a Promise be fulfilled so it's not just the matching itself involved. Currently the built-in benchmark in uBO measures 7-8µs/request on average for uBO's default filter lists, so I really doubt the DNR would be above 1ms/request for just 20K rules.
I’m especially interested in what you can’t do with DNR that you could do with Web Request
At this point, this is what I observed:
No support for entity concept, i.e. the replacement of effective TLD part with a wildcard. This causes rejection of many filters when converting to DNR rules. Examples:
I overlooked this one: not possible to create DNR rules with a condition about the root frame. Currently DNR rules can't be conditional to the URL of the root frame, and this is essentially how all of dynamic filtering works in uBO. Related Chromium issue.
header has not come out of experimental, so it's not currently used in lists. header though is an example of the argument that DNR is an obstacle to innovation.
We will begin disabling Manifest V2 extensions in pre-stable versions of Chrome (Dev, Canary, and Beta) as early as June 2024, in Chrome 127 and later.
Users impacted by the rollout will see Manifest V2 extensions automatically disabled in their browser and will no longer be able to install Manifest V2 extensions from the Chrome Web Store.
Also in June 2024, Manifest V2 extensions will lose their Featured badge in the Chrome Web Store if they currently have one.
Manifest V3 removes the ability for an extension to use remotely hosted code, which presents security risks by allowing unreviewed code to be executed in extensions. With this change, an extension can only execute JavaScript that is included within its package and subject to review by the Chrome Web Store.
Activity
[-]Heads up: Chrome extension manifest v3 proposal[/-][+]Chrome extension manifest v3 proposal[/+]uBlock-user commentedon Dec 13, 2018
Yes this was announced back in October - https://blog.chromium.org/2018/10/trustworthy-chrome-extensions-by-default.html
Not much for uBO to do though..
jspenguin2017 commentedon Dec 13, 2018
I'm not sure how are they planning to change the background process and origin access, it might cause some issues. Beside that, I don't see anything else that can cause problems. As for remotely-hosted code, it really should've been forbidden since the beginning.
joey04 commentedon Jan 9, 2019
It appears that Google is phasing out the webRequest API in favor of their new declarativeNetRequest.
The current Manifest V3 draft states:
Looking at the new API page, it's a rather different way of doing things. I would expect big changes needed to uBO and other blockers. (Plus there's the change from background page to ServiceWorker.)
uBlock-user commentedon Jan 9, 2019
Another change would be dynamic Content Scripts similar to what Firefox has where extensions can inject contentScript and have it execute before page finishes loading.
uBlock-user commentedon Jan 9, 2019
That was declarativeWebRequest, that was shelved.
gorhill commentedon Jan 9, 2019
It is explicitly stated this is meant to phase out
webRequestAPI? If so, where? Quickly perusing the page, I don't see such phase out being stated. If there is really such phase out planned, and if the declarativeNetRequest is strictly an implementation of static filtering à la ABP, this would be the death of uBO and uMatrix.There is no way to transpose either either dynamic filtering, dynamic URL filtering, per-site/per-scope switch logic (let's refer to all these as "dynamic filtering"), into static filters. Dynamic filtering logic requires an arbitrary amount of block/allow rules overriding other block/allow rules based on specificity. There is no concept of specificity in static filtering -- and even more, there is no concept of dynamic filtering rules relinquishing filtering to static filters (dynamic filtering's
nooprules).And there I was recently testing how uBO handled over half a million network filters with the 3rd-gen HNTrie...
Issues of performance and privacy lie with web sites, not uBO -- so I don't feel concerned with the issues of privacy and efficiency being put forth as advantages of using declarativeNetRequest over webRequest.
uBlock-user commentedon Jan 9, 2019
https://docs.google.com/document/d/1nPu6Wy4LWR66EFLeYInl3NzzhHzc-qnk4w4PX-0XMw8/edit#heading=h.ypclvihky0p6
Read the paragraph that's titled DeclarativeNetRequest. They will keep webRequest API but it will not block, modify or redirect anymore, that will be handled by NetRequest API with v3.
They do plan to discourage the use of webRequest API through with its new replacement - https://docs.google.com/document/d/1nPu6Wy4LWR66EFLeYInl3NzzhHzc-qnk4w4PX-0XMw8/edit#heading=h.xe5njuo7voeb
uBlock-user commentedon Jan 9, 2019
30000 is mentioned in https://developer.chrome.com/extensions/declarativeNetRequest#property-MAX_NUMBER_OF_RULES, not sure what to make of this, can you shed some light there ? I don't think it is related to 30K ABP styled filters.
159 remaining items
gorhill commentedon Sep 26, 2022
Notes regarding
removeparam=filter option, specifically I was looking to integrate the AdGuard URL Tracking Protection filter list, which purpose is to remove query parameters often used for tracking purpose.The findings are that this filter list can't really be ported on a permission-less content blocker based on declarativeNetRequest API because host permissions must be granted for both the initiator domain and the request domain -- as per API documentation:
A majority of filters in that list looks as follow (excerpt):
The fact that they are meant to remove the query parameters of any outgoing network request means that for these to work in an a priori permission-less extension would require the extension to request the
*://*/*broad host permission, which the browser would warn with:At which point it becomes pointless to be permission-less, and at which point we are back to defeating one of the stated benefits of MV3 regarding privacy.
In fact, the scary warning does not make sense at all with what is actually happening.
The whole purpose here is to remove query parameters used for tracking, and these query parameters are not data owned by the user as implied by the warning, these are data only useful to some undisclosed entities which are 3rd-party to the users and possibly to even the visited websites, and wanting to remove these should not be presented with a questionable warning that the extension is asking for read/write access to your data.
mapx- commentedon Sep 29, 2022
https://www.ghacks.net/2022/09/29/google-delays-the-death-of-manifest-v2-extensions-to-2024/
gorhill commentedon Sep 29, 2022
The official announcement doesn't make it clear whether we still can push updates to MV2 extensions after January 2023. The previous announcement said that as of January 2023:
Side note regarding performance in MV3: although uBO Lite does everything declaratively, we must not assume that MV3 extensions will automatically be measurably more performant than their MV2 counterparts. The only way to make the case of enhanced performance is actual benchmarks which measure real world scenarios, and whether the differences if any are meaningful to end users.
I see too many comments presuming content blockers in MV3 will be more performant, but the only way to make such statements is objective performance measurements of real world scenarios (example).
At the moment, content blockers which require a up and running service workers appear to be doing worse than their MV2 counterpart, and for those not requiring an up and running service worker (as in uBOL), only benchmarking will tell whether they perform better, and if so by which amount. For instance, months ago I measured that uBO's network filtering matching algorithm was more performant than another well-known one compiled to native, so we should not presume one way or another regarding performance, sometimes the results are contrary to expectations.
gorhill commentedon Sep 29, 2022
I saw these results a few days ago but I don't think we can draw conclusions about the DNR's performance, except maybe that matching does not take more time than what is reported on these graphs. The timing measurements require that a Promise be fulfilled so it's not just the matching itself involved. Currently the built-in benchmark in uBO measures 7-8µs/request on average for uBO's default filter lists, so I really doubt the DNR would be above 1ms/request for just 20K rules.
gorhill commentedon Nov 30, 2022
@mapx-
At this point, this is what I observed:
*$frame,denyallow=google.com,domain=slreamplay.**$script,3p,denyallow=chatango.com|facebook.net|fbcdn.net|google.com|googleapis.com|nolive.me|plyjam.me,domain=vipleague.*redirect-ruleoption.||indiatimes.com^$image,redirect-rule=1x1.gif*$script,redirect-rule=noopjs,domain=linkneverdie.netredirect/transform/removeParams. Examples:||ad.doubleclick.net/ddm/trackclk/$removeparam=/^dc_trk_/||linkedin.com^$removeparam=/^trk/redirect/transformormodifyHeadersrules. Examples:@@||s.click.aliexpress.com/deep_link.htm?aff_short_key=$removeparam=aff_short_key@@||transfernow.net/*/dltransfer$removeparam=utm_source@@||hqq.*/sec/player/*$csp@@||1movies.*/*.html$csp,1p/^https?:\/\/[-.0-9a-z]+\/script\.js$/$script,1p,strict3p,match-caseAddendum:
mapx- commentedon Nov 30, 2022
ok, I've notified @dotproto on slack
uBlock-user commentedon Nov 30, 2022
No support for $header too ?
gorhill commentedon Nov 30, 2022
headerhas not come out of experimental, so it's not currently used in lists.headerthough is an example of the argument that DNR is an obstacle to innovation.mapx- commentedon Dec 6, 2022
https://www.ghacks.net/2022/12/06/microsoft-extends-support-for-manifest-v2-extensions-to-at-least-january-2024/
MasterKia commentedon Nov 17, 2023
https://developer.chrome.com/en/blog/resuming-the-transition-to-mv3/
gorhill commentedon Mar 27, 2024
So now they are bringing back the ability to execute remote code: https://github.com/w3c/webextensions/blob/main/proposals/user-scripts-execute-api.md, contradicting the prominent No more remotely hosted code:
u-RraaLL commentedon Apr 15, 2024
I'm leaving a link for easy access for whoever might need it: https://github.com/uBlockOrigin/uBOL-home