Created
May 2, 2012 19:01
-
-
Save brendandahl/2579276 to your computer and use it in GitHub Desktop.
Change Channel Owner
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// Keep the URL the same so the browser sees it as the same. | |
channel.originalURI = aRequest.URI; | |
channel.asyncOpen(proxy, aContext); | |
var securityManager = Cc["@mozilla.org/scriptsecuritymanager;1"].getService(Ci.nsIScriptSecurityManager); | |
log('got secruity manager!'); | |
var uri = ioService.newURI('resource://pdf.js/web/viewer.html', null, null); | |
var principal = securityManager.getCodebasePrincipal(uri); | |
log('created principal!'); | |
channel.owner = principal; | |
log('hey we changed the owner!'); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment