use more of webRequest info to restrict stripResources

This commit is contained in:
tophf 2018-07-06 00:20:01 +03:00
parent 7f4bc71a23
commit c09f7c341c

View File

@ -808,7 +808,12 @@ window.addEventListener('showStyles:done', function _() {
let frameId; let frameId;
const stripResources = info => { const stripResources = info => {
if (!frameId && info.url === BASE_URL + '/') { if (!frameId &&
info.frameId &&
info.type === 'sub_frame' &&
(info.initiator === location.origin || !info.initiator) && // Chrome 63+
(info.originUrl === location.href || !info.originUrl) && // FF 48+
info.url === BASE_URL + '/') {
frameId = info.frameId; frameId = info.frameId;
} else if (frameId === info.frameId && info.type !== 'xmlhttprequest') { } else if (frameId === info.frameId && info.type !== 'xmlhttprequest') {
return {redirectUrl: 'data:,'}; return {redirectUrl: 'data:,'};