Write Chrome extension with Webpack serve

Viewed 24

I'm writing a Chrome extension which extends the Developer tools. In the html page of my devtools panel, I want to use webpack in watch mode for fast iteration of the UI. In the extension manifest, I added this entry:

{
    "content_security_policy": {
        "extension_pages": "default_src: 'self' http://localhost:8081"
    }
}

Then in the html page, I specify my script src as:

<script src="http://localhost:8081/devtools.js"></script>

Chrome happily loads my extension, but when it tries to load the html page, it fails with the following error:

Refused to load the script 'http://localhost:8081/devtools.js' because it violates the following Content Security Policy directive: "script-src 'self' 'wasm-unsafe-eval'". Note that 'script-src-elem' was not explicitly set, so 'script-src' is used as a fallback.

What do I do wrong here?

0 Answers
Related