Loading local JavaScript file in WebView in Java 8u60

前端 未结 1 730
粉色の甜心
粉色の甜心 2020-12-20 23:57

Until Java 8u51, the following worked fine:

  • Have an HTML file containing
  • Load this HT
相关标签:
1条回答
  • 2020-12-21 00:10

    Since Java 8u60, local javascript files referenced in html files are not executed anymore in the WebView. When running the program with an older version, it still works. I found no information that this change in behaviour was intended by Oracle.

    As a workaround you can either place the javascript code directly into the HTML file, or load in java the contents of the javascript file into a String and execute it with webView.getEngine().executeScript()

    0 讨论(0)
提交回复
热议问题