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

Default Firefox to MV3 #230

Closed
2 of 3 tasks
aklinker1 opened this issue Nov 11, 2023 · 15 comments
Closed
2 of 3 tasks

Default Firefox to MV3 #230

aklinker1 opened this issue Nov 11, 2023 · 15 comments
Labels

Comments

@aklinker1
Copy link
Collaborator

aklinker1 commented Nov 11, 2023

Feature Request

Before this can happen, the following changes are required:

Is your feature request related to a bug?

#226

@aklinker1
Copy link
Collaborator Author

aklinker1 commented Nov 11, 2023

Firefox MV3 dev mode (wxt -b firefox --mv3) does not work, see https://bugzilla.mozilla.org/show_bug.cgi?id=1864284 for more details. You have a two options:

  1. Use --mv2, the default, instead when developing against firefox wxt -b firefox --mv2
  2. Build for production, wxt build -b firefox --mv3, and load the extension manually into Firefox to test it

@aklinker1 aklinker1 changed the title Update default manifest version for Firefox to 3 Update default manifest version for Firefox to v3 Nov 11, 2023
@aklinker1 aklinker1 changed the title Update default manifest version for Firefox to v3 Default Firefox to MV3 Dec 14, 2023
@dvlden
Copy link
Contributor

dvlden commented Jan 18, 2024

I have released my extension on Firefox add-ons for Desktop and Android as MV3.
Instantly regretted it.

  • Requires users to give extension access to all websites. It's not automatically allowed as in MV2.
  • Firefox Android really lacks MV3 compatibility
Screenshot 2024-01-19 at 00 01 16

Releasing soon MV2 for Firefox instead as it resolves both of the issues from above.

Leaving this as a note. Firefox is not ready, maybe in a few years.

@aklinker1
Copy link
Collaborator Author

Yeah, I just released my rewrite as MV3 extension and the permissions are weird... Probably more secure, but less user friendly, for sure. I'm not supporting Android, so that's not a problem for me.

I'm gonna close this issue for now so I don't have to keep looking at it.

@aklinker1 aklinker1 closed this as not planned Won't fix, can't repro, duplicate, stale Jan 19, 2024
@yunsii
Copy link
Contributor

yunsii commented Feb 20, 2024

But https://wxt.dev/guide/multiple-browsers.html and development console have no information about this 😂 I spend so many time to debug why firefox add-on with mv3 not work...

@aklinker1
Copy link
Collaborator Author

WXT should exit with an error message when you try and run wxt -b firefox --mv3

Screenshot 2024-02-20 at 8 27 37 AM

@yunsii
Copy link
Contributor

yunsii commented Feb 21, 2024

WXT should exit with an error message when you try and run wxt -b firefox --mv3

Screenshot 2024-02-20 at 8 27 37 AM

Really? Why I do not encounter any error message?
image

@aklinker1
Copy link
Collaborator Author

Huh 😖

@aklinker1
Copy link
Collaborator Author

@yunsii Can you add this log to your project? Inside node_modules/wxt/dist/cli.js, do a ctrl+F for "Dev mode does not support Firefox MV3" and add this log before the if statement:

Screenshot 2024-02-21 at 7 10 00 AM
console.log(wxt.config.browser, wxt.config.manifestVersion)

Then re-run the command that's failing and let me know what is logged?

@yunsii
Copy link
Contributor

yunsii commented Feb 22, 2024

@aklinker1 It seems a bug with WSL?
image

export function createWslRunner(): ExtensionRunner {
return {
async openBrowser() {
wxt.logger.warn(
`Cannot open browser when using WSL. Load "${relative(
process.cwd(),
wxt.config.outDir,
)}" as an unpacked extension manually`,
);
},
async closeBrowser() {
// noop
},
};
}

And why exit with an error message at beginning of dev command?

@aklinker1
Copy link
Collaborator Author

It seems a bug with WSL?

@yunsii This is intentional. web-ext doesn't work well in WSL: mozilla/web-ext#2108 (comment)

@yunsii
Copy link
Contributor

yunsii commented Feb 22, 2024

@aklinker1 So how about exit with an error message at start of dev command?

@aklinker1
Copy link
Collaborator Author

No, dev mode still works, just can't open the browser automatically. For Firefox mv3, it just doesn't work, which is why it exits

@yunsii
Copy link
Contributor

yunsii commented Feb 23, 2024

Firefox MV3 dev mode (wxt -b firefox --mv3) does not work, see bugzilla.mozilla.org/show_bug.cgi?id=1864284 for more details. You have a two options:

  1. Use --mv2, the default, instead when developing against firefox wxt -b firefox --mv2
  2. Build for production, wxt build -b firefox --mv3, and load the extension manually into Firefox to test it

So it is a upstream bug, use this workaround for now.

@dword-design
Copy link

@aklinker1 Could it be that this is working now? I tried it with vite-plugin-web-extension, Firefox MV3, a background script and a content script. Updating the content script also updates in the browser in dev mode.

@aklinker1
Copy link
Collaborator Author

@dword-design nope, still not working. HTML pages are broken, not content scripts.

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

No branches or pull requests

4 participants