Skip to content

Commit

Permalink
Disconnect from https page overlays when https disabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
chromakode committed Sep 8, 2012
1 parent 54dffa0 commit e66f05a
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/background.js
Original file line number Diff line number Diff line change
Expand Up @@ -302,6 +302,16 @@ tabStatus = {
delete this.tabId[tabId]
},

removeHttps: function() {
for (var tabId in this.tabId) {
chrome.tabs.get(Number(tabId), function(tab) {
if (urlProtocol(tab.url) == 'https') {
tabStatus.tabId[tab.id].port.disconnect()
}
})
}
},

send: function(tabId, msg) {
var tabData = this.tabId[tabId]
if (tabData) {
Expand Down Expand Up @@ -741,6 +751,9 @@ window.addEventListener('storage', function(e) {
}
break
case 'allowHttps':
if (e.newValue == 'false') {
tabStatus.removeHttps()
}
case 'showPageAction':
setAllPageActionIcons()
break
Expand Down

0 comments on commit e66f05a

Please sign in to comment.