[prev in list] [next in list] [prev in thread] [next in thread] 

List:       openjdk-openjfx-dev
Subject:    Re: How to inject javascript function to be used before finishing loading dom in JavaFX
From:       Bruno Borges <bruno.borges () gmail ! com>
Date:       2019-06-18 17:04:54
Message-ID: CADKGCndMf7H2oH8J7TKc27UJ3rNotkqV59cr-ctKU7sjtODp2Q () mail ! gmail ! com
[Download RAW message or body]

Check the source code of my WebFX project. I hack the WebEngine dom object
to add some functions before things are loaded.

GitHub.com/brunoborges/webfx

On Mon, Jun 17, 2019, 15:36 Joey Ruiz <jacr2506@hotmail.com> wrote:

> I'm creating a javaFX browser integrated with a swing application. This
> browser opens a webpage that makes a call to a javascript function that
> should be injected befor the document finishes loading. Is there a way to
> do something similar to what BrowserFunction does for a SWT browser? So
> that way I can use the injected function any time and at any open page
> within the JavaFX browser.
>
> I just tried injecting the function with a member by using the JSObject
> class. This code is added in the loadWorker of the WebEngine with the
> stateProperty. I also tested it by adding this to the documentProperty by
> I'm still not able to make it work. The function is correctly added but
> it's not used because it seems to be injected after the document finished
> loading and I need it before that.
>
> window = (JSObject) engine.executeScript("window");
>
> window.setMember("app", jl);
>
>
[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic