Skip to content

Chrome extension manifest v3 proposal #338

Closed

Description

@greghuc

Activity

  1. changed the title [-]Heads up: Chrome extension manifest v3 proposal[/-] [+]Chrome extension manifest v3 proposal[/+] on Dec 13, 2018
  2. added
    discussion
    on Dec 13, 2018
  3. uBlock-user commented on Dec 13, 2018

    @uBlock-user
    Member
  4. jspenguin2017 commented on Dec 13, 2018

    @jspenguin2017

    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.

  5. added
    something to address
    and removed
    discussion
    on Jan 6, 2019
  6. joey04 commented on Jan 9, 2019

    @joey04

    It appears that Google is phasing out the webRequest API in favor of their new declarativeNetRequest.

    The current Manifest V3 draft states:

    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.)

  7. added
    Chromium
    on Jan 9, 2019
  8. uBlock-user commented on Jan 9, 2019

    @uBlock-user
    Member

    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.

  9. uBlock-user commented on Jan 9, 2019

    @uBlock-user
    Member

    That was declarativeWebRequest, that was shelved.

  10. gorhill commented on Jan 9, 2019

    @gorhill
    Member

    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...

    a

    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.

  11. uBlock-user commented on Jan 9, 2019

    @uBlock-user
    Member

    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

  12. uBlock-user commented on Jan 9, 2019

    @uBlock-user
    Member

    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.

  13. 159 remaining items

  14. gorhill commented on Sep 26, 2022

    @gorhill
    Member

    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):

    $removeparam=utm_ad
    $removeparam=utm_affiliate
    $removeparam=utm_brand
    $removeparam=utm_campaign
    $removeparam=utm_campaignid
    [...]
    

    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:

    Screenshot from 2022-09-25 19-55-12

    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.

  15. gorhill commented on Sep 29, 2022

    @gorhill
    Member

    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.

  16. gorhill commented on Sep 29, 2022

    @gorhill
    Member

    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.

  17. gorhill commented on Nov 30, 2022

    @gorhill
    Member

    @mapx-

    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:
      • *$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.*
    • No support for redirect-if-blocked concept. This causes rejection of many filters making use of the redirect-rule option.
      • ||indiatimes.com^$image,redirect-rule=1x1.gif
      • *$script,redirect-rule=noopjs,domain=linkneverdie.net
    • No support for regex-based for redirect / transform / removeParams. Examples:
      • ||ad.doubleclick.net/ddm/trackclk/$removeparam=/^dc_trk_/
      • ||linkedin.com^$removeparam=/^trk/
    • No support for the concept of exception of redirect/transform or modifyHeaders rules. 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
    • No support for strict-partyness. Examples:
      • /^https?:\/\/[-.0-9a-z]+\/script\.js$/$script,1p,strict3p,match-case

    Addendum:

    • 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.
  18. mapx- commented on Nov 30, 2022

    @mapx-
    Contributor

    ok, I've notified @dotproto on slack

  19. uBlock-user commented on Nov 30, 2022

    @uBlock-user
    Member

    No support for $header too ?

  20. gorhill commented on Nov 30, 2022

    @gorhill
    Member

    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.

  21. MasterKia commented on Nov 17, 2023

    @MasterKia
    Member

    https://developer.chrome.com/en/blog/resuming-the-transition-to-mv3/

    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.

  22. gorhill commented on Mar 27, 2024

    @gorhill
    Member

    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:

    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.

  23. u-RraaLL commented on Apr 15, 2024

    @u-RraaLL
    Contributor
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Chromiumsomething to address

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions