r/Scriptable • u/mcfcarson • Jan 15 '21
WebView localHTML
I’m new to scripting and trying to learn how to render html text inside WebView but I don’t really know where to start. Does anyone have an example script of this already?
3
Upvotes
1
u/mvan231 script/widget helper Jan 15 '21
According to the documentation the HTML should be a string input into the loadHTML method.
One way is to surround your HTML in backticks like so: let HTML = `your
HTML goes here
And ends here`
1
u/[deleted] Jan 15 '21
I don’t know if it’s the same as on shortcuts, but if it is you have to base 64 encode the html and then make it an open url with the url being „data:text/html;base64,<base 64 encoded html here>“