You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I was trying to implement the window.webContents.openDevTools() method. It's not trivial programmatically but can be open manually if the developerExtrasEnabled flag is set to TRUE.
Actually I don't really want to support both WebKit interfaces... I started out using WKWebView, but then realized that it's not possible to add custom JavaScript objects into the JSContext because WebKit2 runs the browser in a separate process.
(In other words, - (void)webView:didCreateJavaScriptContext:forFrame: only exists for the old WebKit1 WebView.)
I'm still hoping that we might be able to use WKWebView without crippling the Electron browser-side API. Some of those APIs could just be loaded as plain JavaScript, as they don't really require a native implementation (e.g. "process"). For ones that do need to call back to the native side, WebKit2 provides an async message-passing interface (window.webkit.messageHandlers) which could be enough of a building block. I'll need to research this further.
davidenke
pushed a commit
to davidenke/electrino
that referenced
this issue
Feb 7, 2018
Uh oh!
There was an error while loading. Please reload this page.
I was trying to implement the
window.webContents.openDevTools()
method. It's not trivial programmatically but can be open manually if thedeveloperExtrasEnabled
flag is set toTRUE
.Now you can right click on the page and inspect an element :)
This requires
USE_WKWEBVIEW
to be set to 1 and I had to modify this code:Because
mainFrame
doesn't exist onWKWebView
.Btw, why do you want to support both
WKWebView
andWebView
?The text was updated successfully, but these errors were encountered: