Run JavaScript on Web Page

An extended “Run JavaScript on Web Page” not only limited to Safari Web Pages


This Action aims to provide a better “Run JavaScript on Web Page” than the one provided by Apple (as of iOS 16.6)

With this action, running a JavaScript on a Web Page is no longer limited to a Web Page necessarily clicked through Share, you can specify a URL, HTTP methods and headers and more !

Although the evolution seems minor it opens up multiplied possibilities, I will post later a full featured user Action making uses of it, which as nothing to envy to similar apps sold on the App Store.

This Action serves as a Library for other actions.

See the Tests for usages. (TODO: options documentation)

To modify, debug, enable devMode and change the various options.

Tests :

—-class101 on Steam (or u/mrdovi on reddit)

Latest Release Notes

0.7.1 - Sept. 12, 2023, 11:16 p.m.

Run JavaScript on Web Page - v0.7.1

See tests for usage(doc will come l8r@routinehub)

Special Thanks:
u/gluebyte (many docs and useful Actions 🙏 )

Most hated internet guy:
FUCK /u/spez
0.7.1 : add tests for json, xml options
0.7.0 : support JSON and XML raw with JS
0.6.3 : fix Get Content of URL corrupting JSON
0.6.2 : add tests for json, html options
0.6.1 : move empty result warn to devMode
0.6.0 : add JSON contents support
0.5.9 : change JS errors to notifications
0.5.8 : add u/gluebyte 💪 in credits
0.5.7 : add `html` option
0.5.6 : removed the forced stringify, instead,
calling it on `result` on-demand is a
better practice to preserve JS types
by default (ie: if you return [] in JS,
you expect it to be settable as dictionary
value of `:[]` and not `:"[]"` in Shortcut)
0.5.5 : fix default css selector
0.5.4 : detect syntax errors not caught by try
0.5.3 : don’t stringify if obj already string
0.5.2 : add a `nostringify` option, comments
0.5.1 : change default header key
0.5.0 : first public RoutineHub release
0.2.0 : argument to pretty print result JSON
0.1.4 : devmode, performance optimizations
0.1.1 : headers, performance optimizations
0.1.0 : rewrite with variables, debug, fake args
beta1 : reddit PoC

- options doc for routinehub and r/Shortcuts
- x-callback-url support ?
- increase from 5 to 10 customizable headers ?
- support more HTTP methods
- support POSTing datas

Version history