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-2015 Eyeo GmbH | 3 * Copyright (C) 2006-2015 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 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
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 }; | 103 }; |
104 | 104 |
105 chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) | |
106 { | |
107 if (changeInfo.status == "loading") | |
108 ext.pages.onLoading._dispatch(new Page(tab)); | |
109 }); | |
110 | |
111 function forgetTab(tabId) | 105 function forgetTab(tabId) |
112 { | 106 { |
113 ext._removeFromAllPageMaps(tabId); | 107 ext._removeFromAllPageMaps(tabId); |
114 delete framesOfTabs[tabId]; | 108 delete framesOfTabs[tabId]; |
115 } | 109 } |
116 | 110 |
117 chrome.webNavigation.onBeforeNavigate.addListener(function(details) | 111 chrome.webNavigation.onBeforeNavigate.addListener(function(details) |
118 { | 112 { |
119 if (details.frameId == 0) | 113 if (details.frameId == 0) |
120 forgetTab(details.tabId); | 114 { |
| 115 forgetTab(tabId); |
| 116 ext.pages.onLoading._dispatch(new Page(tab)); |
| 117 } |
121 }); | 118 }); |
122 | 119 |
123 chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId) | 120 chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId) |
124 { | 121 { |
125 forgetTab(removedTabId); | 122 forgetTab(removedTabId); |
126 }); | 123 }); |
127 | 124 |
128 chrome.tabs.onRemoved.addListener(forgetTab); | 125 chrome.tabs.onRemoved.addListener(forgetTab); |
129 | 126 |
130 | 127 |
(...skipping 361 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
492 callback(new Page(tab)); | 489 callback(new Page(tab)); |
493 } | 490 } |
494 else | 491 else |
495 { | 492 { |
496 ext.pages.open(optionsUrl, callback); | 493 ext.pages.open(optionsUrl, callback); |
497 } | 494 } |
498 }); | 495 }); |
499 }); | 496 }); |
500 }; | 497 }; |
501 })(); | 498 })(); |
OLD | NEW |