[Pkg-javascript-commits] [pdf.js] 332/414: Make pdf.js use the correct principal origin attributes when loading subresources.

David Prévot taffit at moszumanska.debian.org
Tue Jun 28 17:12:36 UTC 2016


This is an automated email from the git hooks/post-receive script.

taffit pushed a commit to branch master
in repository pdf.js.

commit 867a5ea1b00f1bc5f58a1b5edc29f87ebe348527
Author: Dave Huseby <dhuseby at mozilla.com>
Date:   Fri Mar 25 14:48:13 2016 -0700

    Make pdf.js use the correct principal origin attributes when loading subresources.
---
 extensions/firefox/content/PdfStreamConverter.jsm | 8 ++++++--
 1 file changed, 6 insertions(+), 2 deletions(-)

diff --git a/extensions/firefox/content/PdfStreamConverter.jsm b/extensions/firefox/content/PdfStreamConverter.jsm
index ba40730..785f4a3 100644
--- a/extensions/firefox/content/PdfStreamConverter.jsm
+++ b/extensions/firefox/content/PdfStreamConverter.jsm
@@ -1083,22 +1083,26 @@ PdfStreamConverter.prototype = {
     // Keep the URL the same so the browser sees it as the same.
     channel.originalURI = aRequest.URI;
     channel.loadGroup = aRequest.loadGroup;
+    channel.loadInfo.originAttributes = aRequest.loadInfo.originAttributes;
 
     // We can use resource principal when data is fetched by the chrome
+    // make sure we reuse the origin attributes from the request channel to keep
+    // isolation consistent.
     // e.g. useful for NoScript
     var ssm = Cc['@mozilla.org/scriptsecuritymanager;1']
                 .getService(Ci.nsIScriptSecurityManager);
     var uri = NetUtil.newURI(PDF_VIEWER_WEB_PAGE, null, null);
+    var attrs = aRequest.loadInfo.originAttributes;
     var resourcePrincipal;
 //#if MOZCENTRAL
-    resourcePrincipal = ssm.createCodebasePrincipal(uri, {});
+    resourcePrincipal = ssm.createCodebasePrincipal(uri, attrs);
 //#else
     // FF16 and below had getCodebasePrincipal, it was replaced by
     // getNoAppCodebasePrincipal (bug 758258).
     // FF43 then replaced getNoAppCodebasePrincipal with
     // createCodebasePrincipal (bug 1165272).
     if ('createCodebasePrincipal' in ssm) {
-      resourcePrincipal = ssm.createCodebasePrincipal(uri, {});
+      resourcePrincipal = ssm.createCodebasePrincipal(uri, attrs);
     } else if ('getNoAppCodebasePrincipal' in ssm) {
       resourcePrincipal = ssm.getNoAppCodebasePrincipal(uri);
     } else {

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-javascript/pdf.js.git



More information about the Pkg-javascript-commits mailing list