first commit
This commit is contained in:
22
background.js
Normal file
22
background.js
Normal file
@@ -0,0 +1,22 @@
|
||||
chrome.action.onClicked.addListener(async (tab) => {
|
||||
try {
|
||||
// Inject the modules and then execute the main function
|
||||
await chrome.scripting.executeScript({
|
||||
target: { tabId: tab.id },
|
||||
files: ["fields.js"],
|
||||
world: "MAIN"
|
||||
});
|
||||
await chrome.scripting.executeScript({
|
||||
target: { tabId: tab.id },
|
||||
files: ["dom.js"],
|
||||
world: "MAIN"
|
||||
});
|
||||
await chrome.scripting.executeScript({
|
||||
target: { tabId: tab.id },
|
||||
files: ["main.js"],
|
||||
world: "MAIN"
|
||||
});
|
||||
} catch (error) {
|
||||
console.error("Error injecting scripts:", error);
|
||||
}
|
||||
});
|
||||
Reference in New Issue
Block a user