fairlanguage-firefox/popup/buttonmenu.js

16 lines
364 B
JavaScript

// 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();
}
});