Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code

Side by Side Diff: chrome/ext/background.js

Issue 29350379: Issue 4386 - Update frame URL after redirection (Closed)
Patch Set: Created Sept. 1, 2016, 1:37 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
View unified diff | Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
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
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 {
kzar 2016/09/01 13:42:07 (We could also check that details.transitionQualif
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
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 })();
OLDNEW
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld