Use checkLoadURIStrWithPrincipal() instead of checkLoadURIStr()

Because checkLoadURIStr() are missing in Nightly
This commit is contained in:
Infocatcher 2012-08-29 14:23:05 +04:00
parent 5a08ebf666
commit 5e39c1b25b

View File

@ -1035,17 +1035,18 @@ catch(e) {
securityCheck : function TabbarDND_securityCheck(aURI, aEvent)
{
let session = this.treeStyleTab.currentDragSession;
let (sourceDoc = session ? session.sourceDocument : null) {
let sourceURI = sourceDoc ? sourceDoc.documentURI : 'file:///' ;
let normalizedURI = this.treeStyleTab.makeURIFromSpec(aURI);
if (normalizedURI && sourceURI.indexOf('chrome://') < 0) {
try {
SecMan.checkLoadURIStr(sourceURI, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD);
}
catch(e) {
aEvent.stopPropagation();
throw 'Drop of ' + aURI + ' denied.';
}
if (!session) //TODO: use some fake nodePrincipal?
throw 'Drop of ' + aURI + ' denied: no drag session.';
let sourceDoc = session.sourceDocument;
let sourceURI = sourceDoc.documentURI;
let normalizedURI = this.treeStyleTab.makeURIFromSpec(aURI);
if (normalizedURI && sourceURI.substr(0, 9) != 'chrome://') {
try {
SecMan.checkLoadURIStrWithPrincipal(sourceDoc.nodePrincipal, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD);
}
catch(e) {
aEvent.stopPropagation();
throw 'Drop of ' + aURI + ' denied.';
}
}
},