diff --git a/docs/get-started/migrate-to-wxt.md b/docs/get-started/migrate-to-wxt.md index ef2ef4c4..d51a3339 100644 --- a/docs/get-started/migrate-to-wxt.md +++ b/docs/get-started/migrate-to-wxt.md @@ -25,7 +25,7 @@ In general, you'll need to:   Convert custom import syntax to be compatible with Vite
Add a default export to JS entrypoints
Use the `browser` global instead of `chrome`
-  Compare final `manifest.json` files, making sure permissions and host permissions are unchanged
+  Compare final `manifest.json` files, making sure permissions and host permissions are unchanged. Use [Google's update testing tool](https://github.com/GoogleChromeLabs/extension-update-testing-tool) if your extension is already live on the Chrome Web Store
Extension output by `wxt build` works the same way as before the migration
Every project is different, so there's no one-solution-fits-all to migrating your project. Just make sure `wxt dev` runs, `wxt build` results in a working extension, and the list of permissions in the `manifest.json` hasn't changed. If all that looks good, you've finished migrating your extension! diff --git a/docs/guide/key-concepts/manifest.md b/docs/guide/key-concepts/manifest.md index 6b7759ab..bb37e1df 100644 --- a/docs/guide/key-concepts/manifest.md +++ b/docs/guide/key-concepts/manifest.md @@ -147,6 +147,31 @@ export default defineConfig({ }); ``` +### Host Permissions + +[Host Permissions](https://developer.chrome.com/docs/extensions/develop/concepts/declare-permissions#host-permissions) must be listed in the manifest config. + +```ts +export default defineConfig({ + manifest: { + host_permissions: ['*://*.google.com/*'], + }, +}); +``` + +:::warning +If you use host permissions and target both MV2 and MV3, make sure to only include the required host permissions for each version: + +```ts +export default defineConfig({ + manifest: ({ manifestVersion }) => ({ + host_permissions: manifestVersion === 2 ? [...] : [...], + }), +}); +``` + +::: + ## Localization Similar to the icon, the [`_locales` directory](https://developer.chrome.com/docs/extensions/reference/i18n/) should be placed inside the the WXT's [`public` directory](/guide/directory-structure/public/).