Hot Module Reloading with Manifest V3

1,909 views
Skip to first unread message

kwangure

unread,
Feb 12, 2021, 10:46:40 AM2/12/21
to Chromium Extensions
Hi all,

If I understand correctly, manifest V3 requires that all external code be included in the external bundle for security reasons. This is fine for production, but a huge pain for development. 

Tools such as Vite and Snowpack depend on being able to run external code using hot module reloading (HMR) which imports code dynamically. This speeds up development 10-100x since no code is bundled.

Are there workarounds to run external code in dev mode? Is this use-case known to manifest V3 devs? I haven't yet found a filed issue about this.

Simeon Vincent

unread,
Feb 16, 2021, 9:32:49 PM2/16/21
to Chromium Extensions, kwangure
You should be able to use hot module reloading for local development. Per the content security policy section of migration guide, the MV3 content security policy only allows the following values in script-src, object-src, and worker-src directives
Cheers,

Simeon - @dotproto
Chrome Extensions DevRel

Message has been deleted

Amy Dev

unread,
Sep 8, 2021, 3:57:10 PM9/8/21
to Chromium Extensions, Simeon Vincent, kwangure
Encountered this bug in Chrome 94 when following these instructions for local development (localhost)
https://bugs.chromium.org/p/chromium/issues/detail?id=1247690 

Cuyler Stuwe

unread,
Sep 8, 2021, 4:03:04 PM9/8/21
to Amy Dev, Chromium Extensions, Simeon Vincent, kwangure
Yep, MV3 CSP is totally broken right now, and doesn’t match the behavior in the official documentation at all.

--
You received this message because you are subscribed to the Google Groups "Chromium Extensions" group.
To unsubscribe from this group and stop receiving emails from it, send an email to chromium-extens...@chromium.org.
To view this discussion on the web visit https://groups.google.com/a/chromium.org/d/msgid/chromium-extensions/d34ad53e-efa0-4ffe-bc91-34f71596b890n%40chromium.org.
Reply all
Reply to author
Forward
0 new messages