Javafx webview http response data

后端 未结 1 1829
忘掉有多难
忘掉有多难 2021-01-06 13:09

Is it possible to read the http request and response data from pages loading inside webview. What i want to do is get the binary data from a response after user clicks on a

相关标签:
1条回答
  • 2021-01-06 13:42

    Create your own URLStreamHandlerFactory initialized by URL.setURLStreamHandlerFactory which generates a URLStreamHandler that wraps the standard http and https URLStreamHandlers to intercept their traffic before forwarding.

    Some of the concepts are explained in A New Era for Java Protocol Handlers whitepaper.

    Another option is to listen to the WebEngine.location property and open a separate connection to a server to retrieve and process the binary data as needed. An example of this approach is the pdf handling code for the willow web browser.

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