|
|
@ -514,6 +514,7 @@ var onMessage = function(request, sender, callback) { |
|
|
|
|
|
|
|
var tabId = sender && sender.tab ? sender.tab.id || 0 : 0, |
|
|
|
tabContext = µm.tabContextManager.lookup(tabId), |
|
|
|
rootHostname = tabContext && tabContext.rootHostname, |
|
|
|
pageStore = µm.pageStoreFromTabId(tabId); |
|
|
|
|
|
|
|
// Sync
|
|
|
@ -535,8 +536,8 @@ var onMessage = function(request, sender, callback) { |
|
|
|
case 'mustRenderNoscriptTags?': |
|
|
|
if ( tabContext === null ) { break; } |
|
|
|
response = |
|
|
|
µm.tMatrix.mustBlock(tabContext.rootHostname, tabContext.rootHostname, 'script') && |
|
|
|
µm.tMatrix.evaluateSwitchZ('noscript-spoof', tabContext.rootHostname); |
|
|
|
µm.tMatrix.mustBlock(rootHostname, rootHostname, 'script') && |
|
|
|
µm.tMatrix.evaluateSwitchZ('noscript-spoof', rootHostname); |
|
|
|
if ( pageStore !== null ) { |
|
|
|
pageStore.hasNoscriptTags = true; |
|
|
|
} |
|
|
@ -544,25 +545,21 @@ var onMessage = function(request, sender, callback) { |
|
|
|
|
|
|
|
case 'securityPolicyViolation': |
|
|
|
if ( request.policy !== µm.cspNoWorkerSrc ) { break; } |
|
|
|
var url = µm.URI.hostnameFromURI(request.blockedURI) !== '' ? |
|
|
|
request.blockedURI : |
|
|
|
request.documentURI; |
|
|
|
if ( pageStore !== null ) { |
|
|
|
pageStore.hasWebWorkers = true; |
|
|
|
pageStore.recordRequest('script', request.url, true); |
|
|
|
pageStore.recordRequest('script', url, true); |
|
|
|
} |
|
|
|
if ( tabContext !== null ) { |
|
|
|
µm.logger.writeOne( |
|
|
|
tabId, |
|
|
|
'net', |
|
|
|
tabContext.rootHostname, |
|
|
|
request.url, |
|
|
|
'worker', |
|
|
|
true |
|
|
|
); |
|
|
|
µm.logger.writeOne(tabId, 'net', rootHostname, url, 'worker', true); |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|
case 'shutdown?': |
|
|
|
if ( tabContext !== null ) { |
|
|
|
response = µm.tMatrix.evaluateSwitchZ('matrix-off', tabContext.rootHostname); |
|
|
|
response = µm.tMatrix.evaluateSwitchZ('matrix-off', rootHostname); |
|
|
|
} |
|
|
|
break; |
|
|
|
|
|
|
|