| Index: ext/background.js |
| =================================================================== |
| --- a/ext/background.js |
| +++ b/ext/background.js |
| @@ -258,20 +258,23 @@ |
| {types: ["main_frame", "sub_frame"], urls: ["http://*/*", "https://*/*"]}, |
| ["responseHeaders"]); |
| browser.webNavigation.onBeforeNavigate.addListener(details => |
| { |
| // Since we can only listen for HTTP(S) responses using |
| // webRequest.onHeadersReceived we must update the page structure here for |
| // other navigations. |
| - let url = new URL(details.url); |
|
Manish Jethani
2018/01/12 07:25:03
There's no need to create a URL object here, it's
kzar
2018/01/12 12:04:11
Acknowledged.
|
| - if (url.protocol != "http:" && url.protocol != "https:") |
| + let {url} = details; |
| + if (!url.startsWith("https:") && !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.
|
| + // Chrome doesn't dispatch webRequest.onHeadersReceived |
| + // for Web Store URLs. |
| + url.startsWith("https://chrome.google.com/webstore/")) |
| { |
| - updatePageFrameStructure(details.frameId, details.tabId, details.url, |
| + updatePageFrameStructure(details.frameId, details.tabId, url, |
| details.parentFrameId); |
| } |
| }); |
| function forgetTab(tabId) |
| { |
| ext.pages.onRemoved._dispatch(tabId); |