From e90bc1942087a9a8b7d11f850844c44f343f1e70 Mon Sep 17 00:00:00 2001 From: gorhill Date: Tue, 13 Jan 2015 11:54:54 -0500 Subject: [PATCH] this fixes #490 --- platform/firefox/vapi-background.js | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/platform/firefox/vapi-background.js b/platform/firefox/vapi-background.js index 4d45bad..cc15494 100644 --- a/platform/firefox/vapi-background.js +++ b/platform/firefox/vapi-background.js @@ -772,6 +772,8 @@ var httpObserver = { ABORT: Components.results.NS_BINDING_ABORTED, ACCEPT: Components.results.NS_SUCCEEDED, MAIN_FRAME: Ci.nsIContentPolicy.TYPE_DOCUMENT, + VALID_CSP_TARGETS: 1 << Ci.nsIContentPolicy.TYPE_DOCUMENT | + 1 << Ci.nsIContentPolicy.TYPE_SUBDOCUMENT, typeMap: { 2: 'script', 3: 'image', @@ -921,7 +923,11 @@ var httpObserver = { return; } - if ( !channelData || channelData[0] !== this.MAIN_FRAME ) { + if ( !channelData ) { + return; + } + + if ( 1 << channelData[0] & this.VALID_CSP_TARGETS === 0 ) { return; }