wxt-dev / wxt

⚡ Next-gen Web Extension Framework
https://wxt.dev
MIT License
4.59k stars 192 forks source link

Firebase Remotely hosted Code error from Chrome Developer Store #618

Closed ddeisadze closed 7 months ago

ddeisadze commented 7 months ago

Describe the bug

Hi! I am using firebase in my extension, apparently it downloads remotely hosted code and chrome store rejected my package.

See below:

Violation reference ID: Blue Argon

Technical Requirements - Additional Requirements for Manifest V3:

Violation: Including remotely hosted code in a Manifest V3 item. Violating Content: Code snippet: content-scripts/jobDesc.js: https://www.google.com/recaptcha/enterprise.js?render= How to rectify: Ensure that all logic related to the extensions operation is included in the extension package. For more information please refer to the documentation on removing remotely hosted code & migration checklist on Manifest V3 version. Relevant section of the program policy: Extensions using Manifest V3 must meet additional requirements related to the extension's code. Specifically, the full functionality of an extension must be easily discernible from its submitted code. (learn more)

When I was using webpack, I had to manually remove those remotely downloaded code using replace plugin this code below:

new ReplaceInFileWebpackPlugin([
                {
                    dir: 'dist', // replace with your output dir
                    test: [/background.js(\.map)?$/, /popup.js(\.map)?$/], // replace this with something that matches your output
                    rules: [
                        {
                            search: 'https://apis.google.com/js/api.js',
                            replace: '',
                        },
                        {
                            search: 'https://www.google.com/recaptcha/enterprise.js',
                            replace: '',
                        },
                    ],
                },
            ]),

How can we do the same thing in WXT perhaos using vite?

To Reproduce

If you include firebase in any project it will be flagged.

Expected behavior

A clear and concise description of what you expected to happen.

Additional context

See Chrome's guide on fixing this: https://developer.chrome.com/docs/extensions/develop/migrate/remote-hosted-code

diragb commented 3 months ago

How did you end up fixing this @ddeisadze?