I have downloaded the most recent Chromium build (as of today) – Version 131.0.6725.0 (Developer Build) (arm64). I have an extension developed for my own purposes, loaded from the local disk using developer mode. I can load the extension with the new Chromium as well, no warnings are reported. Previous version of Chromium (127.0.6479.0)worked perfectly with my extension. However, when I now visit the page that should load the content script of the extenstion with the new Chromium, it reports a strange error:
index.js-loader-b0f4707b.js:8 Refused to load the script
'chrome-extension://4fd0249a-a62a-4e30-a342-e417d0308358/assets/chunk-5db8bef4.js'
because it violates the following Content Security Policy directive:
"script-src 'self' 'wasm-unsafe-eval' 'inline-speculation-rules'
http://localhost:* http://127.0.0.1:*". Note that 'script-src-elem' was not
explicitly set, so 'script-src' is used as a fallback.
The error is reported by the extension script (index.js-loader-b0f4707b.js) while trying to load another extension script (now comes the funny part) FROM THE SAME FOLDER on my local computer. Error is reported in the following line.
chrome.runtime.getURL("assets/chunk-5db8bef4.js")
Here is my local extension folder (just to prove that caller and the called script are in the same folder):
It looks like chrome extension cannot load its own scripts. Also note that in my extension I don’t use any external libraries and resources (everything is on the local disc).
What kind of new security setting prevents Chromium from processing its own scripts? BTW, I have also tried to play with manifest setting:
"content_security_policy": {
"extension_pages": "<What should I put here?>"
}
but all my/ChatGPT guesses were wrong. It looks that somehow I have to force chrome extension to digest its own local files, which is kinda stupid.