Community
Participate
Working Groups
Build Identifier: Helios Please consider this snippet Browser browser = new Browser (shell, SWT.NONE); // Uses Mozilla on Linux, WebKit on OSX and IE on Win System.out.println(browser.evaluate("return 2+2;"); it returns 4 on both Linux and OSX (any arch with SWT 3.6.1), but NULL on Win7 (I only tested on 32bit version with SWT 3.6.1) Reproducible: Always Steps to Reproduce: See Details
I've found where the problem is... it behaves the same in XP with SWT 3.5. You've to set an url before calling the evaluate method: browser.setUrl("about:blank"); System.out.println(browser.evaluate("return 2;")); // prints 2.0 I'm not sure it is actually a bug, however it behaves differently from Mozilla or WebKit. But I guess it's IE not SWT.