I wrote simple content-script that prints “Hello!” when any page load:
window.addEventListener("load", function() {
console.log("Hello!"); //Successfully
});
And it works fine until I declare imports:
import * as Thing from './thing.js';
window.addEventListener("load", function() {
console.log("Hello!"); //Now it's broken
});
In my manifest I have
"content_scripts": [
{
"matches": ["<all_urls>"],
"js": ["kbd-navigation.js"]
}]
Is it allowed to use imports in content-scripts? How to?