Left: | ||
Right: |
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 111 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
122 | 122 |
123 return frame; | 123 return frame; |
124 } | 124 } |
125 | 125 |
126 function updatePageFrameStructure(frameId, tabId, url) | 126 function updatePageFrameStructure(frameId, tabId, url) |
127 { | 127 { |
128 if (frameId == 0) | 128 if (frameId == 0) |
129 { | 129 { |
130 let page = new Page({id: tabId, url: url}); | 130 let page = new Page({id: tabId, url: url}); |
131 | 131 |
132 ext._removeFromAllPageMaps(tabId); | |
kzar
2017/01/18 08:12:09
I can't see why to remove the tabId from the pageM
Sebastian Noack
2017/01/18 11:58:31
The Page and PageMap objects abstract the concept
| |
133 | |
134 chrome.tabs.get(tabId, function() | 132 chrome.tabs.get(tabId, function() |
135 { | 133 { |
136 // If the tab is prerendered, chrome.tabs.get() sets | 134 // If the tab is prerendered, chrome.tabs.get() sets |
137 // chrome.runtime.lastError and we have to dispatch the onLoading event, | 135 // chrome.runtime.lastError and we have to dispatch the onLoading event, |
138 // since the onUpdated event isn't dispatched for prerendered tabs. | 136 // since the onUpdated event isn't dispatched for prerendered tabs. |
139 // However, we have to keep relying on the unUpdated event for tabs that | 137 // However, we have to keep relying on the unUpdated event for tabs that |
140 // are already visible. Otherwise browser action changes get overridden | 138 // are already visible. Otherwise browser action changes get overridden |
141 // when Chrome automatically resets them on navigation. | 139 // when Chrome automatically resets them on navigation. |
142 if (chrome.runtime.lastError) | 140 if (chrome.runtime.lastError) |
143 ext.pages.onLoading._dispatch(page); | 141 ext.pages.onLoading._dispatch(page); |
(...skipping 447 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... | |
591 ext.windows = { | 589 ext.windows = { |
592 create: function(createData, callback) | 590 create: function(createData, callback) |
593 { | 591 { |
594 chrome.windows.create(createData, function(createdWindow) | 592 chrome.windows.create(createData, function(createdWindow) |
595 { | 593 { |
596 afterTabLoaded(callback)(createdWindow.tabs[0]); | 594 afterTabLoaded(callback)(createdWindow.tabs[0]); |
597 }); | 595 }); |
598 } | 596 } |
599 }; | 597 }; |
600 })(); | 598 })(); |
OLD | NEW |