hollingsworthd / jBrowserDriver

A programmable, embeddable web browser driver compatible with the Selenium WebDriver spec -- headless, WebKit-based, pure Java
Other
812 stars 143 forks source link

Running everything within a single JRE process and exposing JavaFX references #123

Open georgemoralis opened 8 years ago

georgemoralis commented 8 years ago

I wish add a menu and loading bars to gui , how to get the webview reference to include it in another javafx window?

hollingsworthd commented 8 years ago

Hi, this isn't possible currently. The browser instances run in separate JRE processes and the references to the WebViews aren't serializable to send to the parent process. However, it would be possible to enhance the project to give users the option to run everything within a single process. The limitation would be that JBrowserDriver class would effectively be a singleton. I might add this one day and also happy to accept pull requests.

georgemoralis commented 8 years ago

where is the code of the browser? maybe i can manage to work something out

hollingsworthd commented 8 years ago

This is the relevant code, basically in order of when they're called during constructing/initializing an instance:

https://github.com/MachinePublishers/jBrowserDriver/blob/87070149384995bf986d28cd5b97fae58c08f862/src/com/machinepublishers/jbrowserdriver/JBrowserDriver.java#L264

https://github.com/MachinePublishers/jBrowserDriver/blob/f40302744831936513fb1ddcdfa13a937be5d432/src/com/machinepublishers/jbrowserdriver/JBrowserDriverServer.java#L74

https://github.com/MachinePublishers/jBrowserDriver/blob/f40302744831936513fb1ddcdfa13a937be5d432/src/com/machinepublishers/jbrowserdriver/JBrowserDriverServer.java#L170

https://github.com/MachinePublishers/jBrowserDriver/blob/441815e36eda72fbec2f91d2a36c08737b169696/src/com/machinepublishers/jbrowserdriver/Context.java#L79

https://github.com/MachinePublishers/jBrowserDriver/blob/229725ec140f2486c460e44d6604f72c908d7f89/src/com/machinepublishers/jbrowserdriver/ContextItem.java#L147

https://github.com/MachinePublishers/jBrowserDriver/blob/441815e36eda72fbec2f91d2a36c08737b169696/src/com/machinepublishers/jbrowserdriver/SettingsManager.java#L92

https://github.com/MachinePublishers/jBrowserDriver/blob/b4f13367a4c26eeca9bb03a8d0d8f202d128054f/src/com/machinepublishers/jbrowserdriver/App.java#L110