print-element-picker/background.js
2026-08-08 17:35:53 +02:00

13 lines
342 B
JavaScript

browser.action.onClicked.addListener((tab) => {
// Inject the CSS for the hover highlight
browser.scripting.insertCSS({
target: { tabId: tab.id },
files: ["content.css"]
});
// Inject the JavaScript for the element picker
browser.scripting.executeScript({
target: { tabId: tab.id },
files: ["content.js"]
});
});