With 1.1 you can access the WebView. However, you can’t return HTMLNodes. This is the pattern I came up to return data from a DOM selector.
w = new WebView();
await w.loadURL("https://apple.com");
var getData = `
function runit() {
var p = document.querySelectorAll('p');
var res = p.forEach(item => { res.push(item.innerHTML); });
return res;
}
runit();
`
let response = await w.evaluateJavaScript(getData);
Does anyone have an alternate way of returning DOM data from the WebView?
Does anybody know, wheter it is possible to display app content with webview or not? Im thinking of using the x-callback-url action as input url. But then I’m stuck b/c its obviously not an html…
I’m sorry, I don’t understand.Do you mean to display content from another app in the WebView? you can launch Scriptable with an url scheme and pass data that way, but it has to be encoded.
If you wanted to load the url in the WebView, you’re out of luck, because that won’t work.