diff options
| author | Lakshmi Shanmugam | 2015-05-13 17:27:36 +0000 |
|---|---|---|
| committer | Lakshmi Shanmugam | 2015-05-13 19:08:01 +0000 |
| commit | 6b28578ec575cf9b9bc42578b2cd2a249f83e1ad (patch) | |
| tree | 8459477cf1dd9acfa865e24e5e737fb2973b8489 | |
| parent | 6ce5b14811cf352529ba1eec51434b8d93262945 (diff) | |
| download | eclipse.platform.swt-6b28578ec575cf9b9bc42578b2cd2a249f83e1ad.tar.gz eclipse.platform.swt-6b28578ec575cf9b9bc42578b2cd2a249f83e1ad.tar.xz eclipse.platform.swt-6b28578ec575cf9b9bc42578b2cd2a249f83e1ad.zip | |
Bug 465757 - When browser is using XULRunner, the browser.evaluate
function is always returning null.
-Modified evaluate(script) to use evaluate(script, false) so that
evaluate executes in the context of the current document.
-Modified javadoc of evaluate(script,trusted)
-fixed a typo on nsIHelperAppLauncher_1_8.java
2 files changed, 15 insertions, 14 deletions
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java index 866dd451e0..aeef3f9132 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java @@ -600,23 +600,28 @@ public boolean close () { * <li>ERROR_WIDGET_DISPOSED when the widget has been disposed</li> * </ul> * + * @see Browser#evaluate(String,boolean) * @see ProgressListener#completed(ProgressEvent) * * @since 3.5 */ public Object evaluate (String script) throws SWTException { checkWidget(); - return evaluate (script, true); + return evaluate (script, false); } /** * Returns the result, if any, of executing the specified script. * <p> - * Evaluates a script containing javascript commands in the context of - * the current document. If document-defined functions or properties - * are accessed by the script then this method should not be invoked - * until the document has finished loading (<code>ProgressListener.completed()</code> - * gives notification of this). + * Evaluates a script containing javascript commands. + * When <code>trusted</code> is <code>true</code> script is executed in the context of Chrome + * with Chrome security privileges. + * When <code>trusted</code> is <code>false</code> script is executed in the context of the + * current document with normal privileges. + * </p><p> + * If document-defined functions or properties are accessed by the script then + * this method should not be invoked until the document has finished loading + * (<code>ProgressListener.completed()</code> gives notification of this). * </p><p> * If the script returns a value with a supported type then a java * representation of the value is returned. The supported @@ -628,16 +633,12 @@ public Object evaluate (String script) throws SWTException { * <li>javascript boolean -> <code>java.lang.Boolean</code></li> * <li>javascript array whose elements are all of supported types -> <code>java.lang.Object[]</code></li> * </ul> - * The <code>trusted</code> parameter affects the security context the script will be executed in. - * Specifying <code>true</code> for trusted executes the script in Chrome security context <code>false</code> for trusted - * executes script in normal security context. - * - * Note: Chrome security context is applicable only to Browsers with style <code>SWT.Mozilla</code> - * * An <code>SWTException</code> is thrown if the return value has an * unsupported type, or if evaluating the script causes a javascript * error to be thrown. - * + * </p><p> + * Note: Chrome security context is applicable only to Browsers with style <code>SWT.Mozilla</code>. + * </p> * @param script the script with javascript commands * @param trusted <code>true> or <code>false</code> depending on the security context to be used * diff --git a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_8.java b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_8.java index 2fcddebd29..512872f9d9 100644 --- a/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_8.java +++ b/bundles/org.eclipse.swt/Eclipse SWT Mozilla/common/org/eclipse/swt/internal/mozilla/nsIHelperAppLauncher_1_8.java @@ -41,7 +41,7 @@ public class nsIHelperAppLauncher_1_8 extends nsICancelable { IIDStore.RegisterIID(nsIHelperAppLauncher_1_8.class, MozillaVersion.VERSION_BASE, new nsID(NS_IHELPERAPPLAUNCHER_IID_STR)); IIDStore.RegisterIID(nsIHelperAppLauncher_1_8.class, MozillaVersion.VERSION_XR1_9, new nsID(NS_IHELPERAPPLAUNCHER_1_9_IID_STR)); IIDStore.RegisterIID(nsIHelperAppLauncher_1_8.class, MozillaVersion.VERSION_XR10, new nsID(NS_IHELPERAPPLAUNCHER_10_IID_STR)); - IIDStore.RegisterIID(nsIHelperAppLauncher_1_8.class, MozillaVersion.VERSION_XR31, new nsID(NS_IHELPERAPPLAUNCHER_24_IID_STR)); + IIDStore.RegisterIID(nsIHelperAppLauncher_1_8.class, MozillaVersion.VERSION_XR24, new nsID(NS_IHELPERAPPLAUNCHER_24_IID_STR)); } /* |
