Skip to content

Chrome: use declarativeNetRequestWithHostAccess instead of webRequestBlocking #3615

@WorldLanguages

Description

@WorldLanguages

EDIT: outdated

The new declarativeNetRequestWithHostAccess permission will ship in Chrome stable on November 16 2021.
Around three months later (February 2022), we'll remove the webRequestBlocking permission from our Chrome manifest.json and start using declarativeNetRequestWithHostAccess instead.
Users running Chrome 95 and below will still be able to use Scratch Addons by then, except some scratch-messaging and scratch-notifier features (more detail below).
Firefox will continue to use webRequestBlocking, possibly forever.

We currently use blocking webRequest for:

  • Fetching ?sareferer URLs (used to delete/post comments and clear message count from background/popup contexts)
  • Removing Set-Cookie headers from https://scratch.mit.edu/site-api/comments/* responses which unexpectedly log users out. Removed in v1.24.3 through Remove unnecessary background/handle-cookie.js #4237 and no bug reports received about unexpected logouts yet.

Moving away from webRequestBlocking is a good first step to be ready for manifest v3, and may also possibly speed up our Chrome Web Store review times.

Metadata

Metadata

Assignees

No one assigned

    Labels

    mv3: transitionForwards-compatible changes we can make anytime before the upgrade to Manifest V3platform: chromeRelated to Chrome / ChromeOSscope: coreRelated to the core script/extension workingsscope: upstreamRelated to something we depend on (like Scratch, a library, or the browser)type: enhancementNew feature for the project

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions