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

Delta Between Two Patch Sets: ext/background.js

Issue 29646589: Issue 6191 - Update frame structure for Chrome Web Store pages (Closed) Base URL: https://hg.adblockplus.org/adblockpluschrome/
Left Patch Set: Do not create URL object Created Jan. 12, 2018, 7:14 a.m.
Right Patch Set: Combine checks Created Jan. 15, 2018, 12:07 p.m.
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments.
Jump to:
Left: Side by side diff | Download
Right: Side by side diff | Download
« no previous file with change/comment | « no previous file | no next file » | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
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} = details; 266 let {url} = details;
267 if (!url.startsWith("https:") && !url.startsWith("http:") || 267 if (!(url.startsWith("http:") ||
kzar 2018/01/12 12:04:11 I like this new logic, but it seems kind of a sham
Manish Jethani 2018/01/14 14:46:15 I like this sort of optimization in general, but i
kzar 2018/01/15 10:31:12 Agreed, but maybe at least combine the checks? (un
Manish Jethani 2018/01/15 12:08:34 Done.
268 // Chrome doesn't dispatch webRequest.onHeadersReceived 268 url.startsWith("https:") &&
269 // for Web Store URLs. 269 // Chrome doesn't dispatch webRequest.onHeadersReceived
270 url.startsWith("https://chrome.google.com/webstore/")) 270 // for Web Store URLs.
271 !url.startsWith("https://chrome.google.com/webstore/")))
271 { 272 {
272 updatePageFrameStructure(details.frameId, details.tabId, url, 273 updatePageFrameStructure(details.frameId, details.tabId, url,
273 details.parentFrameId); 274 details.parentFrameId);
274 } 275 }
275 }); 276 });
276 277
277 function forgetTab(tabId) 278 function forgetTab(tabId)
278 { 279 {
279 ext.pages.onRemoved._dispatch(tabId); 280 ext.pages.onRemoved._dispatch(tabId);
280 281
(...skipping 408 matching lines...) Expand 10 before | Expand all | Expand 10 after
689 ext.windows = { 690 ext.windows = {
690 create(createData, callback) 691 create(createData, callback)
691 { 692 {
692 browser.windows.create(createData, createdWindow => 693 browser.windows.create(createData, createdWindow =>
693 { 694 {
694 afterTabLoaded(callback)(createdWindow.tabs[0]); 695 afterTabLoaded(callback)(createdWindow.tabs[0]);
695 }); 696 });
696 } 697 }
697 }; 698 };
698 } 699 }
LEFTRIGHT
« no previous file | no next file » | Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Toggle Comments ('s')

Powered by Google App Engine
This is Rietveld