// onclick handler for the "Activate on this page" button function activateOnPage() { // Inject content script into active tab browser.tabs.executeScript({file: "/content_scripts/fairlang.js"}); // TODO exception handling } // Add event handlers document.addEventListener("click", (e) => { if (e.target.id == "activateButton") { activateOnPage(); } });