Merge pull request #349 from Infocatcher/patch-11
Use checkLoadURIStrWithPrincipal() instead of checkLoadURIStr()
This commit is contained in:
commit
c5bb7ec8ad
@ -1117,20 +1117,30 @@ catch(e) {
|
|||||||
},
|
},
|
||||||
securityCheck : function TabbarDND_securityCheck(aURI, aEvent)
|
securityCheck : function TabbarDND_securityCheck(aURI, aEvent)
|
||||||
{
|
{
|
||||||
|
// See dragDropSecurityCheck() in chrome://global/content/nsDragAndDrop.js
|
||||||
let session = this.treeStyleTab.currentDragSession;
|
let session = this.treeStyleTab.currentDragSession;
|
||||||
let (sourceDoc = session ? session.sourceDocument : null) {
|
if (!session) { //TODO: use some fake nodePrincipal?
|
||||||
let sourceURI = sourceDoc ? sourceDoc.documentURI : 'file:///' ;
|
aEvent.stopPropagation();
|
||||||
let normalizedURI = this.treeStyleTab.makeURIFromSpec(aURI);
|
throw 'Drop of ' + aURI + ' denied: no drag session.';
|
||||||
if (normalizedURI && sourceURI.indexOf('chrome://') < 0) {
|
}
|
||||||
|
let normalizedURI;
|
||||||
try {
|
try {
|
||||||
SecMan.checkLoadURIStr(sourceURI, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD);
|
normalizedURI = this.treeStyleTab.makeURIFromSpec(aURI);
|
||||||
|
}
|
||||||
|
catch(e) {
|
||||||
|
}
|
||||||
|
if (!normalizedURI)
|
||||||
|
return;
|
||||||
|
let sourceDoc = session.sourceDocument;
|
||||||
|
let principal = sourceDoc ? sourceDoc.nodePrincipal
|
||||||
|
: SecMan.getSimpleCodebasePrincipal(this.treeStyleTab.IOService.newURI("file:///", null, null));
|
||||||
|
try {
|
||||||
|
SecMan.checkLoadURIStrWithPrincipal(principal, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD);
|
||||||
}
|
}
|
||||||
catch(e) {
|
catch(e) {
|
||||||
aEvent.stopPropagation();
|
aEvent.stopPropagation();
|
||||||
throw 'Drop of ' + aURI + ' denied.';
|
throw 'Drop of ' + aURI + ' denied.';
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
|
|
||||||
retrieveURLsFromDataTransfer : function TSTService_retrieveURLsFromDataTransfer(aDataTransfer)
|
retrieveURLsFromDataTransfer : function TSTService_retrieveURLsFromDataTransfer(aDataTransfer)
|
||||||
|
Loading…
Reference in New Issue
Block a user