Posted on June 8, 2016
In this update we focused on implementing features, long-awaited by our customers, such as access to HTTP response data (AJAX response body), multiple HTTP headers support, gesture event listener, getting selected HTML, better support of IME and different keyboard languages, and much more.
Upgrading from version 6.4
If you already use JxBrowser 6.4 version in your project, you will have no issues switching to 6.5 because it’s also based on Chromium 49 and its API is backward compatible with the previous version.
Features and Improvements
Here is a detailed overview of the features added in JxBrowser 6.5:
NetworkDelegate.onDataReceived(DataReceivedParams params)method. This method is invoked each time, when response body or its part is received. It means that now you can get the data of each HTTP response including HTML, plain text, image binaries, etc. You can use this functionality to access AJAX response body as well.
HttpHeaders(deprecated starting with version 6.5) class allowed to get only one HTTP header value by name. It made impossible getting multiple HTTP header values, in cases when HTTP header has several values for the same name. The
HttpHeadersExclass solves the issue by allowing to access multiple values of HTTP header with the same name.
- Support of paper size setting for saving web page as PDF document. In previous JxBrowser versions the paper size for this case was hardcoded to A4 format. Now, you can use any paper size.
- Ability to specify custom paper size for printing a page. Now, you can specify your own paper size in millimeters or inches when printing a web page.
- Functionality that allows getting selected HTML on the loaded web page.
getStatusLine()methods in the
HeadersReceivedParamsclass. As an example, in order to get information about the response status code and the reason phrase you can use the
Browser.isAudioPlaying()method. Using this method you can determine whether audio is playing at the moment on the loaded web page or not.
BrowserView.setGestureEventsHandler()method. When registered, it allows you to handle gesture events when heavyweight rendering mode is enabled in both JavaFX and Swing implementations. In lightweight rendering mode this handler is not used.
- Support of multiple displays with different device scale factor in lightweight JavaFX
BrowserViewcomponent. In previous JxBrowser versions, if you moved JavaFX scene/window with embedded lightweight
BrowserViewcomponent from a regular display to Retina display, the rendering would not be optimized for Retina display. As a result, you’d get a blurred image of the loaded web page. Now, the library detects when a component is moved from one display to another and updates lightweight rendering parameters to produce a picture of a web page with the best quality for a display where the component is shown at the moment.
- Support of File Save dialog. We figured out that some Flash content can display a File Save dialog which is not supported in default
DialogHandlerimplementation. In this update we fixed this issue, so now the File Save dialog is supported.
- Support of all Chromium process types by the crash dump file generation. In previous JxBrowser versions, we generated crash dump file for the main Chromium process only. In case of crash in the renderer or GPU Chromium process, the crash dump file was not generated at all.
JxBrowser 6.5 provides fixes for the following issues:
- Chromium engine modifying the number of maximum opened files in Java process on Mac OS X (ulimit -n). On Mac OS X Java process can open 10240 files/streams at the same time. We noticed that when a
Browserinstance is initialized in Java process, the value is changed to 1024. The reason lied in Chromium engine that modified the value during initialization. Now, Chromium engine checks the initial value first, and modifies it only if it’s greater than 1024.
- Printing does not work in a popup window. It was a regression issue after upgrade to Chromium 49. Now, everything works like a charm.
- System keys, e.g. Alt, Cmd, Control, Shift, support in German keyboard on Mac OS X. The issue was reproducible in the lightweight rendering mode only. We fixed the issue and made sure that other keyboards work on Mac OS X as expected.
- Chromium crashes with out of memory error when saving large HTML document (20MB+) as a PDF document or displaying popup window with a big image on Windows. To fix the issue we use the
/LARGEADDRESSAWARElinker flag when building JxBrowser on Windows. The same flag is used in the official Chromium build.
- “java.awt.IllegalComponentStateException: component must be showing on the screen to determine its location” error that comes from
BrowserViewcomponent when heavyweight rendering mode is enabled on Windows.
- Support of screen keyboard on Windows 8+ touch devices has been improved. We figured out that when
BrowserViewcomponent was activated via mouse click, screen keyboard worked fine and we could type in a text field on the loaded web page in JxBrowser. But when
BrowserViewcomponent was activated via tap/touch event,
BrowserViewcomponent did not receive focus. As a result the user could not type in a text field on the loaded web page using screen keyboard. In this update the issue has been fixed and the screen keyboard interacts with JxBrowser exactly as with Google Chrome.
- Drop down not appearing in the fullscreen mode. The issue was reproducible in the heavyweight rendering mode. We have patched the Chromium engine for the drop downs to work as expected in the fullscreen mode.
- Impossible to access the radio buttons, checkboxes, and buttons or select them via Space key when IME (Japanese, Pinyin) is active. In previous JxBrowser versions we did not update IME state when focus went to radio button or checkbox. Now, this functionality works exactly as in Google Chrome.
Write us at email@example.com to download JxBrowser 6.5.
Subscribe to @JxBrowserTeam on Twitter to get notified of the library updates.