我实际上正在开发Firefox的附加组件,在我的 index.js 中,我有一个pageMod
pageMod.PageMod({
include: "*.leclercdrive.fr",
contentScriptFile: blabla
}
);
我需要做的是当用户点击图标时,加载项已关闭,当执行另一次点击时,加载项会打开,依此类推......
实际上,我尝试过使用:
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"
}
}
}
使用var i = 1
,首先点击i=2
,include = "*.notexisting"
,然后点击i=3
,返回"*.leclercdrive.fr"
,i=1
... < / p>
但是我无法让它发挥作用。