-
-
Notifications
You must be signed in to change notification settings - Fork 387
Open
Labels
pending-triageSomeone (usually a maintainer) needs to look into this to see if it's a bugSomeone (usually a maintainer) needs to look into this to see if it's a bug
Description
Describe the bug
When building an extension with WXT for Opera or Yandex Browser, import.meta.env identifies the browser as chrome. Because of this, it’s impossible to add Opera-specific or Yandex-specific logic.
Example for Opera
BROWSER: "chrome"
CHROME: true
OPERA: false
Example for Yandex
BROWSER: "chrome"
CHROME: true
Expected result (Opera)
BROWSER: "opera"
CHROME: false
OPERA: true
Expected result (Yandex)
BROWSER: "yandex"
CHROME: false
YANDEX: true
Notes
Opera and Yandex Browser, while Chromium-based, diverge in supported APIs and UX.
For example, Opera has its own sidebar implementation, while Yandex Browser does not support chrome.sidePanel.
It would be very helpful to expose Yandex: boolean in import.meta.env (similar to CHROME, EDGE, etc.), and also recognize Opera properly.
Reproduction
Steps to reproduce
1. Build the extension using WXT (wxt build) and load it in Opera or Yandex Browser.
2. Log import.meta.env to the console inside the extension code.
3. Check the environment variables.
4. Load archive content in dev mode
System Info
WXT: 0.20.6
Browsers: Opera (Chromium-based), Yandex Browser (Chromium-based)
Command: wxt build
Used Package Manager
npm
Validations
- Read the Contributing Guidelines.
- Read the docs.
- Check that there isn't already an issue that reports the same bug to avoid creating a duplicate.
- Check that this is a concrete bug. For Q&A open a GitHub Discussion or join our Discord Chat Server.
- The provided reproduction is a minimal reproducible example of the bug.
Metadata
Metadata
Assignees
Labels
pending-triageSomeone (usually a maintainer) needs to look into this to see if it's a bugSomeone (usually a maintainer) needs to look into this to see if it's a bug