I'm actually working on a add-on for Firefox, in my index.js, I have a pageMod
pageMod.PageMod({
include: "*.leclercdrive.fr",
contentScriptFile: blabla
}
);
I have also set a Menubutton on the Firefox toolbar:
What I need to do is when the user clicks on the icon, the add-on is turned off, and when another click is performed, the add-on is turned on, and so on...
Actually, I've tried using:
function click(state, isMenu) {
if (isMenu) { //isMenu is if the click is performed on the arrow
myPanel.show({
position: button
});
} else { //click on the icon
i++;
if (i = 3) {
//i++;
//change include to "*.leclercdrive.fr"
} else {
//change include to "*.notexisting.not"
}
}
}
With a var i = 1
, first click i=2
, include = "*.notexisting"
, second click i=3
, back to "*.leclercdrive.fr"
, i=1
...
But I can't get it to work.