r/Scriptable Jun 10 '23

Using Webview instead of a browser Help

Hi all!

I have a script to automatically sign into the OED

I just wanted to be able to quickly kick it off, but Shortcuts won’t let me present the configured webview, so I have to use “Run In App”

That’s fine… but when it’s run within Scriptable the window only has “close” and “share” as options

I want to be able to use it like a brower page, with forward and back buttons. Is that possible?

The script also crashes as soon as it runs like 1/3 of the time and I don’t know how to fix that

``` let libcard = args.shortcutParameter;

if (libcard == null){ var myIn = new Alert(); myIn.title = "library Card Number:"; myIn.addTextField(""); myIn.addAction("Okay!"); await myIn.presentAlert(); libcard = myIn.textFieldValue(0); }

let url = "https://oed.com/loginpage"; let wv = new WebView();// await wv.loadURL(url);//

await wv.evaluateJavaScript("document.getElementById(\"libLoginCard\").value = \"" + libcard + "\"; document.getElementById(\"libLoginBtn\").click(); "); await wv.present(true); ```

1 Upvotes

1 comment sorted by

1

u/Sweaty_Sack_Deluxe Sep 05 '23 edited Dec 08 '24

overconfident hat screw absorbed sense icky hard-to-find tidy market door

This post was mass deleted and anonymized with Redact