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