Closed JdenHartog closed 3 years ago
Hey, thanks for the feedback!
I just checked out the bug and it seems to be an issue with the code that you supplied. The runJavascriptOnWebPage
function excepts a Variable and not a string. Currently, Jellycuts does not automatically create variables for you so you will need to modify your script to this
import Shortcuts 1092.6
#Color: red, #Icon: shortcuts
url("https://jellycuts.com") >> URL
runJavascriptOnWebpage(url: URL, javascript: "console.log('Hello World')")
Thank you for the feedback on the misnamed documentation item.
You’re welcome! I‘m happy you enjoy Jellycuts!
Thank you. I got it working!
I would like to propose a few changes to the example at https://jellycuts.com/documentation/runjavascriptonwebpage
url: https://jellycuts.com
to url: Shortcut Input
as this is the only way Apple allows to run JavaScript on a webpage (I guess this is for security reasons).completion();
at the end of the JavaScript as this has to be there to make it work.console.log('Hello World')
to document.body.style.backgroundColor = 'yellow';
as the successful execution is much easier to see on an iOS device."
as they will also be in the JavaScript and will stop it from working.The complete example, I would like to suggest, lokes like this:
runJavascriptOnWebpage(url: Shortcut Input, javascript: document.body.style.backgroundColor = 'yellow'; completion();)
P.S. A nice bonus feature would be adding a linefeed after every ;
sign, when converting te JellyCut into a shortcut, so each statement gets its own line. Please let me know if you want me to create a new "Feature request issue" for this.
Hey! I have updated the website and documentation to match the changes you proposed. I also fixed the issue with quotations being moved into the final shortcut. If you could make a feature request for the linefeeds that would be awesome! Thank you.
This issue will now be covered in #72
What action is the issue?
Run Javascript on Webpage
Describe the bug
URL (https://jellycuts.com/documentation/ranjavascriptonwebpage), Syntax and Example all state ranJavascriptOnWebpage instead of runJavascriptOnWebpage.
After correcting this I get the following error: Compilation: Cannot find the variable https://jellycuts in the scope
Steps To Reproduce
import Shortcuts 1092.6
#Color: red, #Icon: shortcuts
runJavascriptOnWebpage(url: https://jellycuts.com, javascript: "console.log('Hello World')")
Information
Additional context
Thanks for building Jellycuts! I just started looking into this and it looks really nice and promising.