From 6b28578ec575cf9b9bc42578b2cd2a249f83e1ad Mon Sep 17 00:00:00 2001 From: Lakshmi Shanmugam Date: Wed, 13 May 2015 22:57:36 +0530 Subject: 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 --- .../common/org/eclipse/swt/browser/Browser.java | 27 +++++++++++----------- 1 file changed, 14 insertions(+), 13 deletions(-) (limited to 'bundles/org.eclipse.swt/Eclipse SWT Browser') 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 () { *
  • ERROR_WIDGET_DISPOSED when the widget has been disposed
  • * * + * @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. *

    - * 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 (ProgressListener.completed() - * gives notification of this). + * Evaluates a script containing javascript commands. + * When trusted is true script is executed in the context of Chrome + * with Chrome security privileges. + * When trusted is false script is executed in the context of the + * current document with normal privileges. + *

    + * If document-defined functions or properties are accessed by the script then + * this method should not be invoked until the document has finished loading + * (ProgressListener.completed() gives notification of this). *

    * 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 { *

  • javascript boolean -> java.lang.Boolean
  • *
  • javascript array whose elements are all of supported types -> java.lang.Object[]
  • * - * The trusted parameter affects the security context the script will be executed in. - * Specifying true for trusted executes the script in Chrome security context false for trusted - * executes script in normal security context. - * - * Note: Chrome security context is applicable only to Browsers with style SWT.Mozilla - * * An SWTException is thrown if the return value has an * unsupported type, or if evaluating the script causes a javascript * error to be thrown. - * + *

    + * Note: Chrome security context is applicable only to Browsers with style SWT.Mozilla. + *

    * @param script the script with javascript commands * @param trusted true> or false depending on the security context to be used * -- cgit v1.2.3