Added button action menu
This commit is contained in:
parent
ac71dcc580
commit
0b15c878c7
4 changed files with 38 additions and 6 deletions
15
popup/buttonmenu.js
Normal file
15
popup/buttonmenu.js
Normal 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();
|
||||
}
|
||||
});
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue