I used Java and SWT's Browser
. I prepare two system versions of application, first for OSX second for Windows.
Both systems are 64bit
SWT need different libraries for different systems so in Maven I declared both
<profile>
<id>windows-deploy</id>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.win32.win32.x86_64</artifactId>
<version>4.6.1</version>
</dependency>
</dependencies>
</profile>
<profile>
<id>osx-deploy</id>
<dependencies>
<dependency>
<groupId>org.eclipse.swt</groupId>
<artifactId>org.eclipse.swt.cocoa.macosx.x86_64</artifactId>
<version>4.6.1</version>
</dependency>
</dependencies>
</profile>
In the browser I load page and click button (which creates new window) but I do not want open new window, only reload actual browser which new page, I did it like in code below
browser.addOpenWindowListener(new OpenWindowListener() {
public void open(WindowEvent event) {
Log.debug(TAG + "<>", "Open new page!");
event.browser = browser;
}
});
And on OS X system it works great.
But when I try on Windows, after click on button old page do not change. I checked Logs and the message "Open new page!" was written but nothing happens (new page do not load like in OS X). I though that can be something about refreshing after load page by WebKit and browser.refresh()
refresh browser but there is old content (not new like in OS X).
I debug and checked what happens after event.browser = browser;
the WebKit from SWT library take control.
What I should do to get the same effect on Windows like on OS X ?
RESOLVED
Problem is in libraries. On OSX system when we change
event.browser
object, is automatically detected and it working, but on Windows system we need to add to browserVisibilityWindowListener
as in code fragment below and working fine :)