StarWars
StarWars
PD🧩 Plasmo Developers
Created by StarWars on 11/24/2023 in #👾extension
How to import manually contentScript inside background.js
How i can import content script inside my background in the onInstalled event, my problem is because Plasmo generate the content script with a hash at runtime, for example, contentScript.4a4a5554.js, so, this way I cant import because of this hash. There is no way to know this hash or generate files without this hash?
chrome.scripting.executeScript({
target: { tabId: id || 0 },
files: [
`common.${hash here ????}.js`,
],
});
chrome.scripting.executeScript({
target: { tabId: id || 0 },
files: [
`common.${hash here ????}.js`,
],
});
2 replies