| 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 129 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 140 var frames = framesOfTabs[details.tabId]; | 140 var frames = framesOfTabs[details.tabId]; |
| 141 if (!frames) | 141 if (!frames) |
| 142 frames = framesOfTabs[details.tabId] = Object.create(null); | 142 frames = framesOfTabs[details.tabId] = Object.create(null); |
| 143 | 143 |
| 144 frames[details.frameId] = { | 144 frames[details.frameId] = { |
| 145 parent: frames[details.parentFrameId] || null, | 145 parent: frames[details.parentFrameId] || null, |
| 146 url: new URL(details.url) | 146 url: new URL(details.url) |
| 147 }; | 147 }; |
| 148 }); | 148 }); |
| 149 | 149 |
| 150 chrome.webNavigation.onCommitted.addListener(function(details) |
| 151 { |
| 152 // onBeforeNavigate is fired before redirections take place, so we must |
| 153 // ensure the frame's URL is correct here too. (See #4386) |
| 154 var frames = framesOfTabs[details.tabId]; |
| 155 if (frames && details.frameId in frames) |
| 156 frames[details.frameId].url = new URL(details.url); |
| 157 }); |
| 158 |
| 150 function forgetTab(tabId) | 159 function forgetTab(tabId) |
| 151 { | 160 { |
| 152 ext.pages.onRemoved._dispatch(tabId); | 161 ext.pages.onRemoved._dispatch(tabId); |
| 153 | 162 |
| 154 ext._removeFromAllPageMaps(tabId); | 163 ext._removeFromAllPageMaps(tabId); |
| 155 delete framesOfTabs[tabId]; | 164 delete framesOfTabs[tabId]; |
| 156 } | 165 } |
| 157 | 166 |
| 158 chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId) | 167 chrome.tabs.onReplaced.addListener(function(addedTabId, removedTabId) |
| 159 { | 168 { |
| (...skipping 462 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 622 ext.windows = { | 631 ext.windows = { |
| 623 create: function(createData, callback) | 632 create: function(createData, callback) |
| 624 { | 633 { |
| 625 chrome.windows.create(createData, function(createdWindow) | 634 chrome.windows.create(createData, function(createdWindow) |
| 626 { | 635 { |
| 627 afterTabLoaded(callback)(createdWindow.tabs[0]); | 636 afterTabLoaded(callback)(createdWindow.tabs[0]); |
| 628 }); | 637 }); |
| 629 } | 638 } |
| 630 }; | 639 }; |
| 631 })(); | 640 })(); |
| OLD | NEW |