Accept drop of non-tab objects onto the tab bar correctly on Firefox 16 and olders

This commit is contained in:
Piro / YUKI Hiroshi 2012-10-14 03:54:46 +09:00
parent 5bd57741df
commit 147d38aef3

View File

@ -1134,11 +1134,17 @@ catch(e) {
if (!normalizedURI)
return;
let sourceDoc = session.sourceDocument;
let sourceURI = sourceDoc ? sourceDoc.documentURI : 'file:///' ;
let principal = sourceDoc ?
sourceDoc.nodePrincipal :
SecMan.getSimpleCodebasePrincipal(Services.io.newURI('file:///', null, null)) ;
SecMan.getSimpleCodebasePrincipal ? // this method isn't there on Firefox 16 and olders!
SecMan.getSimpleCodebasePrincipal(Services.io.newURI(sourceURI, null, null)) :
null ;
try {
if (principal)
SecMan.checkLoadURIStrWithPrincipal(principal, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD);
else
SecMan.checkLoadURIStr(sourceURI, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD);
}
catch(e) {
aEvent.stopPropagation();