Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2015-05-13 17:27:36 +0000
committerLakshmi Shanmugam2015-05-13 19:08:01 +0000
commit6b28578ec575cf9b9bc42578b2cd2a249f83e1ad (patch)
tree8459477cf1dd9acfa865e24e5e737fb2973b8489 /bundles/org.eclipse.swt/Eclipse SWT Browser
parent6ce5b14811cf352529ba1eec51434b8d93262945 (diff)
downloadeclipse.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
Diffstat (limited to 'bundles/org.eclipse.swt/Eclipse SWT Browser')
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/Browser.java27
1 files changed, 14 insertions, 13 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
*

Back to the top