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

Reading manifest: Error processing background #813

Open
1 of 2 tasks
SkyfallWasTaken opened this issue Oct 23, 2023 · 4 comments
Open
1 of 2 tasks

Reading manifest: Error processing background #813

SkyfallWasTaken opened this issue Oct 23, 2023 · 4 comments

Comments

@SkyfallWasTaken
Copy link

SkyfallWasTaken commented Oct 23, 2023

Build tool

Vite

Where do you see the problem?

  • In the browser
  • In the terminal

Describe the bug

When loading the example Vite project into Firefox, I get this error:

Extension is invalid
Reading manifest: Error processing background: Value must either: contain the required "page" property, contain the required "scripts" property, or not contain an unexpected "type" property

Reproduction

Repro: https://github.com/SkyfallWasTaken/airhorn-ext

  1. Go to about:debugging#/runtime/this-firefox in Firefox
  2. Press "Load Temporary Add-on..." and choose the manifest.json file
  3. Get the error

Logs

[ACTION FAILED] TEMPORARY_EXTENSION_INSTALL_FAILURE: Extension is invalid
loadManifestFromWebManifest@resource://gre/modules/addons/XPIInstall.jsm:466:17

System Info

System:
    OS: Linux 6.2 Ubuntu 23.04 23.04 (Lunar Lobster)
    CPU: (8) x64 Intel(R) Xeon(R) Platinum 8481C CPU @ 2.70GHz
    Memory: 26.91 GB / 31.33 GB
    Container: Yes
    Shell: 5.2.15 - /bin/bash
  Binaries:
    Node: 1.0.7 - /tmp/bun-node/node
  npmPackages:
    @crxjs/vite-plugin: beta => 2.0.0-beta.19 
    vite: ^4.4.5 => 4.5.0

(note that I'm using Bun 1.0.7 to run everything, not Node 1 😅)

Severity

blocking all usage of RPCE

@SkyfallWasTaken
Copy link
Author

Okay, so I just found the problem:

Crxjs uses background service workers, which are unsupported in Firefox.

@sublimator
Copy link

background service workers, which are unsupported in Firefox.

Really ?? I could have sworn it supported service workers at some point

@honwhy
Copy link

honwhy commented Jan 6, 2024

if you use manifest.config.ts to define and export manifest.config.jsonsee here, you can follow @crxjs/vite-plugin/dist/index.d.ts and find background key requirement.

interface ManifestV3 {
...
background?: ChromeManifestBackground | FirefoxManifestBackground | undefined;
}
interface FirefoxManifestBackground {
    scripts: string[];
    persistent?: false;
}

@hichemfantar
Copy link

hichemfantar commented Sep 3, 2024

Okay, so I just found the problem:

Crxjs uses background service workers, which are unsupported in Firefox.

This is correct, i tested by removing "type": "module" from the manifest inside dist folder and the error in firefox changed to background.service_worker is currently disabled which is related to this

before removing background.type property from manifest:
image

after removing background.type property from manifest:
image

in order to fix importing in firefox however we need to do something about the background.type property mentioned in #914

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants