Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

iOS 12 Shortcut Setup Question for "Run JavaScript on Web Page"

I'm hoping this is the right place for this question since it centers around JavaScript. In the new iOS 12 Shortcuts app you can create workflows. I want to create one that simply launches a web page, fills in my username and password, then clicks the submit button, something like this...

document.myForm.username.value = 'myUsername';
document.myForm.password.value = 'myPassword';
document.getElementById('loginSubmit').submit();

But before even getting that far I just want to run an alert(1);. I can't get that to happen. I keep getting this error message below...

Run JavaScript on Web Page failed because Shortcuts couldn't convert from URL to Safari web page.

enter image description here

I'm not sure what that means. I haven't been able to find info or tutorials on how to use this. Does anyone know how to get JavaScript to run? Thanks!

like image 512
gfrobenius Avatar asked Sep 18 '18 14:09

gfrobenius


1 Answers

There's a note in the Run JavaScript on Web Page action that says, "Safari Web Page item in shortcuts stating that they are only available when running your shortcut as an Action Extension in Safari."

So, sadly, it's not possible to chain up actions where it launches a URL and then runs JS. You must visit the url and run the action from the share sheet.

like image 103
user85303 Avatar answered Oct 13 '22 00:10

user85303