| OLD | NEW |
| 1 /* | 1 /* |
| 2 * This file is part of Adblock Plus <https://adblockplus.org/>, | 2 * This file is part of Adblock Plus <https://adblockplus.org/>, |
| 3 * Copyright (C) 2006-2016 Eyeo GmbH | 3 * Copyright (C) 2006-2016 Eyeo GmbH |
| 4 * | 4 * |
| 5 * Adblock Plus is free software: you can redistribute it and/or modify | 5 * Adblock Plus is free software: you can redistribute it and/or modify |
| 6 * it under the terms of the GNU General Public License version 3 as | 6 * it under the terms of the GNU General Public License version 3 as |
| 7 * published by the Free Software Foundation. | 7 * published by the Free Software Foundation. |
| 8 * | 8 * |
| 9 * Adblock Plus is distributed in the hope that it will be useful, | 9 * Adblock Plus is distributed in the hope that it will be useful, |
| 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of | 10 * but WITHOUT ANY WARRANTY; without even the implied warranty of |
| (...skipping 81 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 92 } | 92 } |
| 93 | 93 |
| 94 chrome.tabs.query(rawInfo, function(tabs) | 94 chrome.tabs.query(rawInfo, function(tabs) |
| 95 { | 95 { |
| 96 callback(tabs.map(function(tab) | 96 callback(tabs.map(function(tab) |
| 97 { | 97 { |
| 98 return new Page(tab); | 98 return new Page(tab); |
| 99 })); | 99 })); |
| 100 }); | 100 }); |
| 101 }, | 101 }, |
| 102 onLoading: new ext._EventTarget() | 102 onLoading: new ext._EventTarget(), |
| 103 onActivated: new ext._EventTarget() |
| 103 }; | 104 }; |
| 104 | 105 |
| 105 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) | 106 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) |
| 106 { | 107 { |
| 107 if (changeInfo.status == "loading") | 108 if (changeInfo.status == "loading") |
| 108 ext.pages.onLoading._dispatch(new Page(tab)); | 109 ext.pages.onLoading._dispatch(new Page(tab)); |
| 109 }); | 110 }); |
| 110 | 111 |
| 111 chrome.webNavigation.onBeforeNavigate.addListener(function(details) | 112 chrome.webNavigation.onBeforeNavigate.addListener(function(details) |
| 112 { | 113 { |
| (...skipping 28 matching lines...) Expand all Loading... |
| 141 delete framesOfTabs[tabId]; | 142 delete framesOfTabs[tabId]; |
| 142 } | 143 } |
| 143 | 144 |
| 144 chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId) | 145 chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId) |
| 145 { | 146 { |
| 146 forgetTab(removedTabId); | 147 forgetTab(removedTabId); |
| 147 }); | 148 }); |
| 148 | 149 |
| 149 chrome.tabs.onRemoved.addListener(forgetTab); | 150 chrome.tabs.onRemoved.addListener(forgetTab); |
| 150 | 151 |
| 152 chrome.tabs.onActivated.addListener(details => |
| 153 { |
| 154 ext.pages.onActivated._dispatch(new Page({id: details.tabId})); |
| 155 }); |
| 156 |
| 151 | 157 |
| 152 /* Browser actions */ | 158 /* Browser actions */ |
| 153 | 159 |
| 154 var BrowserAction = function(tabId) | 160 var BrowserAction = function(tabId) |
| 155 { | 161 { |
| 156 this._tabId = tabId; | 162 this._tabId = tabId; |
| 157 this._changes = null; | 163 this._changes = null; |
| 158 }; | 164 }; |
| 159 BrowserAction.prototype = { | 165 BrowserAction.prototype = { |
| 160 _applyChanges: function() | 166 _applyChanges: function() |
| (...skipping 407 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 568 callback(new Page(tab)); | 574 callback(new Page(tab)); |
| 569 } | 575 } |
| 570 else | 576 else |
| 571 { | 577 { |
| 572 ext.pages.open(optionsUrl, callback); | 578 ext.pages.open(optionsUrl, callback); |
| 573 } | 579 } |
| 574 }); | 580 }); |
| 575 }); | 581 }); |
| 576 }; | 582 }; |
| 577 })(); | 583 })(); |
| OLD | NEW |