Posted on November 6, 2020

Good news everyone! JxBrowser 7.12 is based on Chromium 84!

We have made some updates to the public API of JxBrowser, due to several breaking changes in the Chromium 84 API. Please see the parts of the API which were been removed from JxBrowser, and the alternatives we suggest to use instead.

What’s New

Chromium 84

Chromium has been updated to version 84.0.4147.135.

In this Chromium build some of its features wrapped with the JxBrowser have been removed or changed, so this JxBrowser version introduces several breaking changes in the public API.

Check out the migration guide for this version to see what API has been changed/removed and what alternatives you should use instead.

DOM

Trusted Events

The com.teamdev.jxbrowser.dom.event.Event interface has been extended with the isTrusted() method that allows detecting whether event was generated by a user action or it was created/modified and dispatched via EventTarget.dispatchEvent().

MouseEvent: Page Location

The com.teamdev.jxbrowser.dom.event.MouseEvent interface has been extended with pageLocation() that allows getting the location of the mouse cursor in the document coordinate system at the time the event occurred.

KeyEvent: Key Codes

The functionality that allows getting the key code from com.teamdev.jxbrowser.dom.event.KeyEvent has been re-designed to be similar to DOM KeyboardEvent. We introduced the DomKeyCode enum for the DOM key codes and extended com.teamdev.jxbrowser.dom.event.KeyEvent with the methods that allow obtaining the DOM key code and a string that represents a UTF-8 character associated with the physical key, if it has a printed representation. For example:

document.addEventListener(EventType.KEY_PRESS, event -> {
    if (event instanceof KeyEvent) {
        KeyEvent keyEvent = (KeyEvent) event;
        DomKeyCode keyCode = keyEvent.domKeyCode();
        String character = keyEvent.character();
        System.out.println("DOM KeyEvent: keyCode=" + keyCode  + ", character=" + character);
    }
}, false);

JS Accessible Java Classes

The JavaScript-Java Bridge API has been extended with com.teamdev.jxbrowser.js.JsAccessibleClasses that allows telling that the Java instances of specific types are accessible from JavaScript. For example:

JsAccessibleClasses.add(ArrayList.class, LinkedList.class);

The SameSite cookie attribute support has been added.

Improvements

  • Now the library passes the JS tests that check “MovementX and MovementY vary in mouse events” in the off-screen rendering mode.
  • Since this version, the Frame.isMain() method does not send a request to the Chromium engine to find out whether this frame is a main (top-level) frame in the browser or not. Now, this information is provided when creating a Frame and cached for further calls.
  • Running the Chromium executable shipped with the JxBrowser Chromium binaries is not allowed now. The Chromium binaries used by JxBrowser are supposed to be used only by JxBrowser and users should not be able to run it directly and use it as a regular web browser application.
  • Embedding JavaFX BrowserView into the containers that inherits JFXPanel is now allowed. For example:
      JFXPanel fxPanel = new MyJFXPanel();
      BrowserView view = BrowserView.newInstance(browser);
      fxPanel.setScene(new Scene(new BorderPane(view), 600, 600));
    
      private static final class MyJFXPanel extends JFXPanel {}
    
  • The TextFinder Javadoc has been extended with additional details on how the text search works, how it highlights the matches, how the first match is detected, etc.
  • By default, Chromium creates the debug.log file in the directory where the binaries are located. In some environments access to this directory might be forbidden and the operating system might report such attempts. Since this version, Chromium will not be creating the debug.log file anymore and the corresponding log messages will be redirected to JxBrowser logging.
  • Now, the Chromium build used in the library is built using the is_official_build=true flag. The official Chromium build disables the experimental Study Configurations that are disabled in the official Google Chrome builds. One of such experimental functionalities that was enabled in the previous versions of JxBrowser, is Page Freezing that might freeze the web page and stop JavaScript execution. So, the Chromium engine used by the library becomes closer to the official Chromium builds in terms of the enabled/disabled internal functionality.
  • Functionality that triggers Windows Audit Failures is disabled. The issue was caused by Chromium calling the LogonUser() function from Windows API, and passing an empty password to it. We resolved the issue by disabling functionality that tries to log on using an empty password. This change does not affect any other Chromium functionality.

Fixed issues

  • The “Aw, snap” page not displayed when Chromium render process is crashed.
  • Broken rendering introduced in 7.9 in JavaFX in the off-screen rendering mode on Windows.
  • Web content not displayed after hiding and showing JFrame with the embedded BrowserView in the hardware accelerated rendering mode on Linux.
  • The HTML5 Drag and Drop events with empty data flavor ignored in the off-screen rendering mode, which resulted in some HTML5 DnD events not working at all.
  • The NullPointerException error when dragging a file from the file system to the Swing BrowserView instance in the off-screen rendering mode.
  • The NullPointerException error when displaying JavaFX Scene with the embedded BrowserView instance after the primary Stage is shown in the off-screen rendering mode.
  • CookieStore not saving the cookies with the unspecified SameSite attribute.
  • ShowContextMenuCallback not called when right-clicking inside PDF Viewer.
  • The off-screen rendering not working on Linux with NVidia GeForce 1650 and the 430.64 driver version.
  • The JavaScript-Java Bridge functionality not being able to call a Java method marked with the @JsAccessible annotation if there are other methods with the same name.
  • The spell checker dictionaries not being configured when the Engine instance is running in the Incognito mode.
  • Broken rendering in the Print Preview dialog in the hardware accelerated rendering mode in SWT on macOS.
  • The Print Preview dialog not displayed in the off-screen rendering mode in SWT on macOS.
  • The default Swing BrowserView context menu being not visible when right-clicking Flash on a web page in the hardware accelerated rendering mode on Windows and Linux.
  • Browser unable to be resized to a size smaller than 300px on macOS.
  • The DOM event listener for EventType.DOUBLE_CLICK never being invoked.
  • The EnterMouseCallback and ExitMouseCallback not being called in the off-screen rendering mode. In the hardware accelerated rendering mode on Windows and Linux the EnterMouseCallback could not be invoked because it was ignored by the Chromium engine.
  • The SWT BrowserView component being not visible in Eclipse’s Part on tab switch in the off-screen rendering mode.
  • Wrong default save file name when printing the currently loaded web page to PDF in SWT.
  • Spell checker initialization failure when typing some text in an input field on the loaded web page with disabled Chromium traffic.
  • The custom CSS cursors blurred on Windows in the off-screen rendering mode.
  • Black flickering when adding/removing JavaFX BrowserView into SplitPane in the hardware accelerated rendering mode on Windows.
  • Flickering with a random black rectangle when showing/hiding BrowserView in the off-screen rendering mode on Windows.
  • The methods marked with the @JsAccessible annotation of a Java object injected into JavaScript being called one more time on closing Browser.
  • The IndexOutOfBoundsException error when closing the Swing BrowserView popup instance via the window.close() JavaScript function.
  • The ShowNetErrorPageCallback callback not being called when loading an HTTPS web page with an invalid SSL certificate.
  • Not being able to set focus to an HTML input field located inside an IFRAME with the different domain in the off-screen rendering mode.
  • Support of Firebase Cloud Messaging is restored.
  • Widevine functionality on macOS and Windows is re-introduced after v7.8.
  • The MouseEvent.movementX and MouseEvent.movementY attributes should be different for the different mouse move events in the off-screen rendering mode.
  • JVM crashes due to multiple errors in the JNI related to mach_port functionality on macOS.

Request evaluation license
Download JxBrowser 7.12

Go Top