Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLakshmi Shanmugam2015-03-18 18:51:48 +0000
committerLakshmi Shanmugam2015-03-18 18:51:48 +0000
commit421e299e34e0722aa62c58058c0060b2dafbd14c (patch)
tree6c871d1cdd3dc2efb0ea15a669ce34fa181c5e20 /bundles/org.eclipse.swt/Eclipse SWT Browser
parentd4011c18b6f11c57057eed9ccfcce0dbe0358ded (diff)
downloadeclipse.platform.swt-421e299e34e0722aa62c58058c0060b2dafbd14c.tar.gz
eclipse.platform.swt-421e299e34e0722aa62c58058c0060b2dafbd14c.tar.xz
eclipse.platform.swt-421e299e34e0722aa62c58058c0060b2dafbd14c.zip
Bug 429739 - Permission denied to access property ''
Refactoring. Retained existing behavior of evaluate.
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.java10
-rw-r--r--bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java5
2 files changed, 8 insertions, 7 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 03cb1201c5..866dd451e0 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
@@ -606,7 +606,7 @@ public boolean close () {
*/
public Object evaluate (String script) throws SWTException {
checkWidget();
- return evaluate (script, false);
+ return evaluate (script, true);
}
/**
@@ -629,15 +629,17 @@ public Object evaluate (String script) throws SWTException {
* <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 in chrome security context <code>false</code> for trusted
- * runs in normal security context.
+ * 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.
*
* @param script the script with javascript commands
- * @param trusted <code>false</code> if the rendered page should be granted restricted
+ * @param trusted <code>true> or <code>false</code> depending on the security context to be used
*
* @return the return value, if any, of executing the script
*
diff --git a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
index eec950e9a3..be790c5516 100644
--- a/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
+++ b/bundles/org.eclipse.swt/Eclipse SWT Browser/common/org/eclipse/swt/browser/WebBrowser.java
@@ -390,9 +390,8 @@ public void destroyFunction (BrowserFunction function) {
public abstract boolean execute (String script);
-public Object evaluate (String script, boolean trusted) {
- if (!trusted) return evaluate(script);
- return null;
+public Object evaluate (String script, boolean trusted) throws SWTException {
+ return evaluate(script);
}
public Object evaluate (String script) throws SWTException {

Back to the top