fix onAuthRequired cleanup
This commit is contained in:
@@ -18,16 +18,16 @@ var defaultSettings = {
|
|||||||
var authListeners = {};
|
var authListeners = {};
|
||||||
|
|
||||||
// watch for tab updates
|
// watch for tab updates
|
||||||
chrome.tabs.onUpdated.addListener(function(tab, info) {
|
chrome.tabs.onUpdated.addListener(function(tabId, info) {
|
||||||
// ignore non-complete status
|
// ignore non-complete status
|
||||||
if (info.status !== "complete") {
|
if (info.status !== "complete") {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
// unregister any auth listeners for this tab
|
// unregister any auth listeners for this tab
|
||||||
if (authListeners[tab.id]) {
|
if (authListeners[tabId]) {
|
||||||
chrome.tabs.onAuthRequired.removeListener(authListeners[tab.id]);
|
chrome.webRequest.onAuthRequired.removeListener(authListeners[tabId]);
|
||||||
delete authListeners[tab.id];
|
delete authListeners[tabId];
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user