Skip to content

Instantly share code, notes, and snippets.

@yurydelendik
Forked from brendandahl/gist:2579276
Created May 2, 2012 19:02
Show Gist options
  • Save yurydelendik/2579279 to your computer and use it in GitHub Desktop.
Save yurydelendik/2579279 to your computer and use it in GitHub Desktop.
Change Channel Owner
// 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!');
@yurydelendik
Copy link
Author

yury: did you try to remove the explicit principal swithcing but inherithing the loadGroup instead? Also, looking at the protocol handler for about:feed might be a good idea, too.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment