MachinePublishers / jBrowserDriver

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

window.URL.createObjectURL not defined #245

Closed robmoffat closed 7 years ago

robmoffat commented 7 years ago

I am trying to load a page which uses this object, but it isn't defined in JBrowserDriver, although works correctly under chrome.

Is there any intention to support this in the future?

thanks,

Rob

hollingsworthd commented 7 years ago

Support for things like this relies on the WebKit bundled with Java. Java 9 has a later version of WebKit but it's in beta right now.

There's probably a work around. Guessing this API exists prefixed with "webkitURL" and a JS shim can implement support. Try something like new JBrowserDriver(Settings.builder().headScript("someScript;" + Settings.HEAD_SCRIPT).build())

For the shim itself, maybe https://github.com/nolanlawson/blob-util#createObjectURL

robmoffat commented 7 years ago

Thanks for the insight, I was wondering how this worked. I already tried the WebKit URL idea but that's not present either. I guess java 8 is pretty old now. I was able to work around this in the end anyway, just thought it might be useful to let you know.

Thanks for your help, and for this awesome project.

Ps have you looked at using jxBrowser for the WebKit layer instead?

On 25 Jan 2017, at 16:31, D. Hollingsworth notifications@github.com wrote:

Closed #245.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or mute the thread.

hollingsworthd commented 7 years ago

They are commercial licensing only as far as I know and I'm guessing they use Chromium Embedded Framework. I suspect enough is different in these stacks that there aren't any ways so sensibly combine them.

It's occurred to me in the past that it might be reasonable for someone to upgrade WebKit within the JDK itself. There are commit logs and notes out there from Oracle engineers about what they do each time when they upgrade WebKit ... basically building the native code and fixing up the java layer for WebKit changes. But that seems like a lot of work and if latest Chrome compatibility is really needed I'd personally just use ChromeDriver via Xvfb on Linux.