Bug 887098 - Cache nodePrincipal when InstallTrigger is bound. r=gavin

This commit is contained in:
Bobby Holley 2013-06-26 21:41:55 -07:00
Родитель 638f256ddf
Коммит 7deb49e1b6
1 изменённых файлов: 2 добавлений и 3 удалений

Просмотреть файл

@ -23,7 +23,7 @@ var gIoService = Components.classes["@mozilla.org/network/io-service;1"]
function createInstallTrigger(window) {
let chromeObject = {
window: window,
principal: window.document.nodePrincipal,
url: window.document.documentURIObject,
__exposedProps__: {
@ -149,9 +149,8 @@ function createInstallTrigger(window) {
checkLoadURIFromScript: function createInstallTrigger_checkLoadURIFromScript(aUri) {
var secman = Cc["@mozilla.org/scriptsecuritymanager;1"].
getService(Ci.nsIScriptSecurityManager);
var principal = this.window.document.nodePrincipal;
try {
secman.checkLoadURIWithPrincipal(principal, aUri,
secman.checkLoadURIWithPrincipal(this.principal, aUri,
Ci.nsIScriptSecurityManager.DISALLOW_INHERIT_PRINCIPAL);
return true;
}