How to get JSContext from WKWebView

You cannot obtain the context, because layout and javascript is handled on another process. Instead, add scripts to your webview configuration, and set your view controller (or another object) as the script message handler. Now, send messages from JavaScript like so: window.webkit.messageHandlers.interOp.postMessage(message) Your script message handler will receive a callback: – (void)userContentController:(WKUserContentController *)userContentController didReceiveScriptMessage:(WKScriptMessage *)message{ … Read more

Embedding Gecko/WebKit in Java

You could use JxBrowser. It features a Swing/JavaFX component that wraps the Chromium engine while providing a rich API and out-of-the-box hardware-acceleration through the GPU. Unfortunately, they’ve dropped support for other engines (like Gecko and WebKit) since 4.0 version. Note that it’s not free, except for open-source projects.

webkit-transform overwrites z-index ordering in Chrome 13

Solved it myself through trial and error. Thought I’d report back if someone else stumbles upon this problem. It shall still be noted that this problem did not occur before Chrome updated itself to Chrome 13 (13.0.782.107m). The trick here seems to be to add a translate3d operation to the underlying <div> (sq2) element upon … Read more

Distinguish Chrome from Safari using jQuery.browser

Since Sarfraz has not corrected his answer (thank you Sarfraz for pointing me in the correct direction), I will post functioning code here. var userAgent = navigator.userAgent.toLowerCase(); $.browser.chrome = /chrome/.test(navigator.userAgent.toLowerCase()); // Is this a version of Chrome? if($.browser.chrome){ userAgent = userAgent.substring(userAgent.indexOf(‘chrome/’) +7); userAgent = userAgent.substring(0,userAgent.indexOf(‘.’)); $.browser.version = userAgent; // If it is chrome then jQuery … Read more

Headless browser with full javascript support for java

Nathan Ridley’s answer to another similar question is the most complete one I’ve found so far. Anyway, if everything fails, you could use a Python or JS alternative, expose its funcionality as a webservice inside your server, and then your Java application could use the headless browser’s funcionality through the webservice. It would be a … Read more

Webkit JavaScript Reference [closed]

How about the WebKit DOM Reference? http://developer.apple.com/safari/library/documentation/AppleApplications/Reference/WebKitDOMRef/index.html Update Thanks for the comments – yes this now redirects. Perhaps as others have said, one of the other browsers’ references would be a good place to start – then for Safari’s own DOM extensions/additions, there’s the ‘Safari DOM Additions Reference’: https://developer.apple.com/documentation/webkitjs Otherwise it looks like it would … Read more

Webkit CSS Reset?

While these styles are applied by Webkit, they are over-ruled by margin: 0; padding: 0; located in the CSS resets. You don’t have to worry about them. Note: Although Chrome (Version 27.0.1453.116 m) Developer Tools does not display the user agent styles with strikethrough, the computed styles do reflect that explicit margin and padding values … Read more

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)