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

Side by Side Diff: ext/background.js

Issue 29646589: Issue 6191 - Update frame structure for Chrome Web Store pages (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Patch Set: Created Dec. 21, 2017, 1:55 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-present eyeo GmbH 3 * Copyright (C) 2006-present 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 246 matching lines...) Expand 10 before | Expand all | Expand 10 after
257 }, 257 },
258 {types: ["main_frame", "sub_frame"], urls: ["http://*/*", "https://*/*"]}, 258 {types: ["main_frame", "sub_frame"], urls: ["http://*/*", "https://*/*"]},
259 ["responseHeaders"]); 259 ["responseHeaders"]);
260 260
261 browser.webNavigation.onBeforeNavigate.addListener(details => 261 browser.webNavigation.onBeforeNavigate.addListener(details =>
262 { 262 {
263 // Since we can only listen for HTTP(S) responses using 263 // Since we can only listen for HTTP(S) responses using
264 // webRequest.onHeadersReceived we must update the page structure here for 264 // webRequest.onHeadersReceived we must update the page structure here for
265 // other navigations. 265 // other navigations.
266 let url = new URL(details.url); 266 let url = new URL(details.url);
267 if (url.protocol != "http:" && url.protocol != "https:") 267 if ((url.protocol != "http:" && url.protocol != "https:") ||
268 // Chrome doesn't dispatch webRequest.onHeadersReceived for
269 // Web Store URLs.
270 url.href.startsWith("https://chrome.google.com/webstore/"))
kzar 2018/01/05 16:46:20 I guess we should only do this for Chrome (or Chro
Manish Jethani 2018/01/12 07:25:03 Ideally yes, but it's probably OK if the frame str
Manish Jethani 2018/01/12 07:31:57 By the way, if it wasn't for Edge, we could have u
268 { 271 {
269 updatePageFrameStructure(details.frameId, details.tabId, details.url, 272 updatePageFrameStructure(details.frameId, details.tabId, details.url,
270 details.parentFrameId); 273 details.parentFrameId);
271 } 274 }
272 }); 275 });
273 276
274 function forgetTab(tabId) 277 function forgetTab(tabId)
275 { 278 {
276 ext.pages.onRemoved._dispatch(tabId); 279 ext.pages.onRemoved._dispatch(tabId);
277 280
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
686 ext.windows = { 689 ext.windows = {
687 create(createData, callback) 690 create(createData, callback)
688 { 691 {
689 browser.windows.create(createData, createdWindow => 692 browser.windows.create(createData, createdWindow =>
690 { 693 {
691 afterTabLoaded(callback)(createdWindow.tabs[0]); 694 afterTabLoaded(callback)(createdWindow.tabs[0]);
692 }); 695 });
693 } 696 }
694 }; 697 };
695 } 698 }
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