Popup regression fix: handle disableAll checkbox in active popup
Apparently the original sender tab is excluded from chrome.extension.sendMessage broadcast as of Chrome 44. Even if it's a temporary bug the fixed method is okay.
This commit is contained in:
parent
e2bf12ac6d
commit
0b821463c8
9
popup.js
9
popup.js
|
@ -220,9 +220,11 @@ chrome.extension.onMessage.addListener(function(request, sender, sendResponse) {
|
|||
case "styleDeleted":
|
||||
handleDelete(request.id);
|
||||
break;
|
||||
case "styleDisableAll":
|
||||
document.getElementById("disableAll").checked = request.disableAll;
|
||||
handleDisableAll(request.disableAll);
|
||||
case "prefChanged":
|
||||
if (request.prefName == "disableAll") {
|
||||
document.getElementById("disableAll").checked = request.value;
|
||||
handleDisableAll(request.value);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
@ -236,4 +238,5 @@ loadPrefs({"disableAll": false});
|
|||
handleDisableAll(prefs.getPref("disableAll"));
|
||||
document.getElementById("disableAll").addEventListener("change", function(event) {
|
||||
notifyAllTabs({method: "styleDisableAll", disableAll: event.target.checked});
|
||||
handleDisableAll(event.target.checked);
|
||||
});
|
||||
|
|
Loading…
Reference in New Issue
Block a user