Uploaded image for project: 'JDK'
  1. JDK
  2. JDK-8164458

JDK 8u112: Upgraded webkit causes customUrlHandlers to fail when using https in WebView

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Not an Issue
    • Icon: P3 P3
    • 9
    • 8u112, 9
    • javafx
    • JavaSE8u112 Windows+x86/x64

    • web
    • x86
    • windows

      In Java 8 U92 and previous Java 8 updates we have been successfully using customUrlHandlers to register custom schemes via URL.setURLStreamHandlerFactory. When used with JavaFx WebView, this still works in Java 8 U112 for when the web page is served up over http, but not for websites that are served up over https.

      The following warning message prevents the customUrl from loading over https:
      {code}
      [blocked] The page at https://127.0.0.1/bajaux/webwidget/view:webEditors:MultiSheet?theme=Lucid&formFactor=max&useLocalWbRc=true&attachAfterInit=false was not allowed to run insecure content from module://js/com/tridium/js/ext/require/require.js?version=1470746495730.
      {code}

      "module:" is the scheme we are customizing that no longer works over http:

      {code}
          URL.setURLStreamHandlerFactory(protocol ->
              {
                // Handle custom requests for module ORDs
                if ("module".equals(protocol))
                {
                  return new URLStreamHandler()
                  {
                    @Override
                    protected URLConnection openConnection(URL u)
                    {
                      return new ModuleURLConnection(u);
                    }
                  };
                }
                return null;
              });
      {code}

      This page looks relevant since it has the same webKit Error: http://stackoverflow.com/questions/32883306/safari-9-disallowed-running-of-insecure-content

      So are their now any alternate ways of allowing custom scheme handling with JavaFx WebView or is URL.setURLStreamHandlerFactory no longer supported over loading a https page due to the webKit upgrade?

      If not, I guess we need to use a data uri scheme with base64 encoding for our custom content instead of having a custom url handler? (This still works, but is not preferred).

            ghb Guru Hb (Inactive)
            gucheng Guixin Cheng
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated:
              Resolved: