Index: lib/contentPolicy.js |
=================================================================== |
--- a/lib/contentPolicy.js |
+++ b/lib/contentPolicy.js |
@@ -189,24 +189,16 @@ var Policy = exports.Policy = |
break; |
if (testWnd == testSitekeyWnd) |
[testSitekey, testSitekeyWnd] = getSitekey(testWnd.parent); |
testWnd = testWnd.parent; |
} |
} |
- // Data loaded by plugins should be attached to the document |
- if (contentType == "OBJECT_SUBREQUEST" && node instanceof Ci.nsIDOMElement) |
- node = node.ownerDocument; |
- |
- // Fix type for objects misrepresented as frames or images |
- if (contentType != "OBJECT" && (node instanceof Ci.nsIDOMHTMLObjectElement || node instanceof Ci.nsIDOMHTMLEmbedElement)) |
- contentType = "OBJECT"; |
- |
if (!match && contentType == "ELEMHIDE") |
{ |
match = location; |
location = match.text.replace(/^.*?#/, '#'); |
if (!match.isActiveOnDomain(docDomain)) |
return true; |
@@ -386,16 +378,24 @@ var PolicyImplementation = |
// Ignore standalone objects |
if (contentType == Ci.nsIContentPolicy.TYPE_OBJECT && node.ownerDocument && !/^text\/|[+\/]xml$/.test(node.ownerDocument.contentType)) |
return Ci.nsIContentPolicy.ACCEPT; |
let wnd = Utils.getWindow(node); |
if (!wnd) |
return Ci.nsIContentPolicy.ACCEPT; |
+ // Data loaded by plugins should be associated with the document |
+ if (contentType == Ci.nsIContentPolicy.TYPE_OBJECT_SUBREQUEST && node instanceof Ci.nsIDOMElement) |
+ node = node.ownerDocument; |
+ |
+ // Fix type for objects misrepresented as frames or images |
+ if (contentType != Ci.nsIContentPolicy.TYPE_OBJECT && (node instanceof Ci.nsIDOMHTMLObjectElement || node instanceof Ci.nsIDOMHTMLEmbedElement)) |
+ contentType = Ci.nsIContentPolicy.TYPE_OBJECT; |
+ |
let location = Utils.unwrapURL(contentLocation); |
let result = Policy.processNode(wnd, node, types.get(contentType), location.spec, false); |
return (result ? Ci.nsIContentPolicy.ACCEPT : Ci.nsIContentPolicy.REJECT_REQUEST); |
}, |
shouldProcess: function(contentType, contentLocation, requestOrigin, insecNode, mimeType, extra) |
{ |
return Ci.nsIContentPolicy.ACCEPT; |