wxt-dev / wxt-dev/wxt

Missing originUrl in Browser.webRequest.WebRequestHeadersDetails

Open Beginner friendly
#1,632 3 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

pending-triage
Dominant language
TypeScript
Stars
10.5k
Forks
564
PR merge metrics
No merged PRs in 30d

Description

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

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start with the provided wxt-no-originurl.zip reproduction and inspect the TypeScript definition for Browser.webRequest.WebRequestHeadersDetails. Run npm install followed by npm run build or npm run build:firefox; done means the reproduction builds successfully with originUrl available in the Firefox webRequest details type.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
tooling
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Active
Clarity
Mostly clear
Newbie friendliness
68/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.