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

webRequest.BlockingResponse has an old reference to a resolved bug #34315

Open
nuiva opened this issue Jun 21, 2024 · 0 comments
Open

webRequest.BlockingResponse has an old reference to a resolved bug #34315

nuiva opened this issue Jun 21, 2024 · 0 comments
Labels
Content:WebExt WebExtensions docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.

Comments

@nuiva
Copy link

nuiva commented Jun 21, 2024

MDN URL

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/BlockingResponse

What specific section or headline is this issue about?

https://developer.mozilla.org/en-US/docs/Mozilla/Add-ons/WebExtensions/API/webRequest/BlockingResponse#redirecturl

What information was incorrect, unhelpful, or incomplete?

It is stated that:

Redirections to non-HTTP schemes such as data: are allowed, but they are not currently supported (Firefox bug 707624).

However, bug 707624 has already been fixed in Firefox 127 or earlier.

What did you expect to see?

I think something like this would be good:

Redirections to non-HTTP schemes such as data: are allowed. However, main_frame requests are specifically blocked from using data: URLs.

Do you have any supporting links, references, or citations?

Do you have anything more you want to share?

Personally confirmed that the following extension redirects fetch("https://example.com/foobar") to data:text/plain,foo:

// manifest.json
{

  "description": "Altering HTTP responses",
  "manifest_version": 2,
  "name": "http-response-filter",
  "version": "1.0",
  "homepage_url": "https://github.com/mdn/webextensions-examples/tree/master/http-response",

  "permissions": [
    "webRequest", "webRequestBlocking", "https://example.com/*"
  ],

  "background": {
    "scripts": ["background.js"]
  },

  "browser_specific_settings": {
    "gecko": {
      "strict_min_version": "57.0a1"
    }
  }

}
// background.js
browser.webRequest.onBeforeRequest.addListener(
  _ => ({redirectUrl: "data:text/plain,foo"}),
  {urls: ["https://example.com/foo*"], types: ["xmlhttprequest"]},
  ["blocking"]
);

MDN metadata

Page report details
@nuiva nuiva added the needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened. label Jun 21, 2024
@github-actions github-actions bot added the Content:WebExt WebExtensions docs label Jun 21, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Content:WebExt WebExtensions docs needs triage Triage needed by staff and/or partners. Automatically applied when an issue is opened.
Projects
None yet
Development

No branches or pull requests

1 participant