- const execution = await internals.getRoot().tabs.executeScript(activeTabs[0].id, {
- file: '/build/content_script.js'
- }, () => {
-
- if (internals.getRoot().runtime.lastError) {
+ const id = activeTabs[0].id;
+ if (!internals.injectedScript[id]) {
+ const execution = await internals.getRoot().tabs.executeScript(
+ activeTabs[0].id,
+ {
+ file: "/build/content_script.js",
+ },
+ () => {
+ internals.injectedScript[id] = true;
+ },
+ );
+
+ if (execution && !execution[0]) {