Call firebug lite methods from javafx 2.2 website

I want to run Firebug lite on my website and then call some methods from a script. First, I execute the script as described in here , and its work is fine. The problem starts when I try to call and execute a method inside from within a script. First, I have the Exit button in the webview, and in the case of the button, I call the end of the method to close the script. Below is the code:

eng.executeScript("window.Firebug.shutdown();"); 

Firebug immediately disappears from webview. Then I have another start button, and in case I want to open firebug again with the code below, but nothing happens. Errors and exceptions do not occur and it seems that the script is running correctly.

 eng.executeScript("window.Firebug.startOpened=true;"); 

I am also trying to initialize the eng.executeScript("window.Firebug.initialize();"); () eng.executeScript("window.Firebug.initialize();"); and then I get an exception as shown below:

 netscape.javascript.JSException: TypeError: 'undefined' is not an object at com.sun.webpane.platform.WebPage.twkExecuteScript(Native Method) at com.sun.webpane.platform.WebPage.executeScript(WebPage.java:1438) at javafx.scene.web.WebEngine.executeScript(WebEngine.java:811) at student.WebBrowser$2.handle(WebBrowser.java:126) 

I also want to know which method in the script is executed when the user clicks the ShowInNewWindow button and from JSObject to javafx captures the event and opens firebug in a new form.

Thanks in advance.

+4
source share

Source: https://habr.com/ru/post/1447830/


All Articles