diff options
author | Grant Gayed <ggayed> | 2009-10-09 17:28:12 +0000 |
---|---|---|
committer | Grant Gayed <ggayed> | 2009-10-09 17:28:12 +0000 |
commit | a1db85c3c33a946fae6b082e7c4350bca55a1860 (patch) | |
tree | 85e81c60dde5acfcf7588a3e053ccec839b6631e | |
parent | a1de619c249125e4f8750616416be17ecb0e3a74 (diff) | |
download | eclipse.platform.swt-a1db85c3c33a946fae6b082e7c4350bca55a1860.tar.gz eclipse.platform.swt-a1db85c3c33a946fae6b082e7c4350bca55a1860.tar.xz eclipse.platform.swt-a1db85c3c33a946fae6b082e7c4350bca55a1860.zip |
277355 - document.open() fails
-rw-r--r-- | bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java index 9cbf020d88..613b3a1203 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/browser/Mozilla.java @@ -1771,7 +1771,6 @@ public boolean execute (String script) { securityManager.Release (); } } - serviceManager.Release (); if (principal != null) { rc = webBrowser.QueryInterface (nsIInterfaceRequestor.NS_IINTERFACEREQUESTOR_IID, result); @@ -1819,8 +1818,24 @@ public boolean execute (String script) { } catch (UnsupportedEncodingException e) { pathBytes = mozillaPath.getBytes (); } - rc = XPCOM.JS_EvaluateUCScriptForPrincipals (pathBytes, nativeContext, globalJSObject, principals, scriptChars, length, urlbytes, 0, result); - return rc != 0; + + aContractID = MozillaDelegate.wcsToMbcs (null, XPCOM.NS_CONTEXTSTACK_CONTRACTID, true); + rc = serviceManager.GetServiceByContractID (aContractID, nsIJSContextStack.NS_IJSCONTEXTSTACK_IID, result); + if (rc != XPCOM.NS_OK) error (rc); + if (result[0] == 0) error (XPCOM.NS_NOINTERFACE); + serviceManager.Release (); + + nsIJSContextStack stack = new nsIJSContextStack (result[0]); + result[0] = 0; + rc = stack.Push (nativeContext); + if (rc != XPCOM.NS_OK) error (rc); + boolean success = XPCOM.JS_EvaluateUCScriptForPrincipals (pathBytes, nativeContext, globalJSObject, principals, scriptChars, length, urlbytes, 0, result) != 0; + result[0] = 0; + rc = stack.Pop (result); + if (rc != XPCOM.NS_OK) error (rc); + stack.Release (); + + return success; } } } @@ -1828,6 +1843,7 @@ public boolean execute (String script) { } principal.Release (); } + serviceManager.Release (); } /* fall back to the pre-1.9 approach */ |