Added button action menu

This commit is contained in:
Lexi / Zoe 2018-10-10 01:22:14 +02:00
parent ac71dcc580
commit 0b15c878c7
4 changed files with 38 additions and 6 deletions

15
popup/buttonmenu.js Normal file
View file

@ -0,0 +1,15 @@
// 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();
}
});