first commit

This commit is contained in:
hsueh chiahao
2025-10-09 22:40:00 +08:00
commit dfedbf2ef6
9 changed files with 6388 additions and 0 deletions

22
background.js Normal file
View 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);
}
});