Skip to content

Missing originUrl in Browser.webRequest.WebRequestHeadersDetails #1632

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

Open
5 tasks done
borfig opened this issue Apr 30, 2025 · 0 comments
Open
5 tasks done

Missing originUrl in Browser.webRequest.WebRequestHeadersDetails #1632

borfig opened this issue Apr 30, 2025 · 0 comments
Labels
pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug

Comments

@borfig
Copy link

borfig commented Apr 30, 2025

Describe the bug

The following code worked perfectly in versions 0.19.x:

export default defineBackground(() => {
  browser.webRequest.onBeforeSendHeaders.addListener(
    details => {
      console.log(details.originUrl);
    }, {
      urls: ["<all_urls>"],
    }
  );
});

In versions 0.20.x, it fails to build, because the originUrl field was omitted in the new WebRequest types.

This field exists only in Firefox according to MDN

Reproduction

wxt-no-originurl.zip

Steps to reproduce

Run npm install followed by npm run build or npm run build:firefox.

Expected Results: successful build

Actual Result: failed build

System Info

System:
    OS: macOS 15.4.1
    CPU: (12) x64 Intel(R) Core(TM) i7-9750H CPU @ 2.60GHz
    Memory: 117.80 MB / 32.00 GB
    Shell: 5.9 - /bin/zsh
  Binaries:
    Node: 22.14.0 - ~/.nvm/versions/node/v22.14.0/bin/node
    npm: 10.9.2 - ~/.nvm/versions/node/v22.14.0/bin/npm
  Browsers:
    Chrome: 135.0.7049.115
    Safari: 18.4

Used Package Manager

npm

Validations

@borfig borfig added the pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug label Apr 30, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
pending-triage Someone (usually a maintainer) needs to look into this to see if it's a bug
Projects
None yet
Development

No branches or pull requests

1 participant