From 147d38aef329da6fe87ba8ffea9946ad1b18b372 Mon Sep 17 00:00:00 2001 From: Piro / YUKI Hiroshi Date: Sun, 14 Oct 2012 03:54:46 +0900 Subject: [PATCH] Accept drop of non-tab objects onto the tab bar correctly on Firefox 16 and olders --- modules/tabbarDNDObserver.js | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/modules/tabbarDNDObserver.js b/modules/tabbarDNDObserver.js index c203d6e3..ed19306c 100644 --- a/modules/tabbarDNDObserver.js +++ b/modules/tabbarDNDObserver.js @@ -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)) ; + sourceDoc.nodePrincipal : + SecMan.getSimpleCodebasePrincipal ? // this method isn't there on Firefox 16 and olders! + SecMan.getSimpleCodebasePrincipal(Services.io.newURI(sourceURI, null, null)) : + null ; try { - SecMan.checkLoadURIStrWithPrincipal(principal, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD); + if (principal) + SecMan.checkLoadURIStrWithPrincipal(principal, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD); + else + SecMan.checkLoadURIStr(sourceURI, normalizedURI.spec, Ci.nsIScriptSecurityManager.STANDARD); } catch(e) { aEvent.stopPropagation();