Even using the example I couldn't get a snippet of JS (alert("hello")) to function via KM even though it executed in the console. So, I'm a bit stumped.
Try the following - in increasing order of ambition:
“Baby steps” such as the above is what I do when trying to work in a new environment.
Let us know how you get on.
[Edit just removed a stray apostrophe; I do know the difference between “its” and “it’s”. ]
I don't think you will be able to do that in FF. Many of us in the forum have long looked for ways to script FF and have never found a method that reliably works for complicated scripts. So, if you need to click on a specific element in the web page, I'd suggest:
Not to start a browser war, but I use Firefox because of its better handling of HTML 5 canvas...
... You can directly turn it into a PNG graphic from a context menu.
I don't know if that is flexible enough for you.
No but I should imagine it’s a matter of creating a bookmark for any page, navigating to edit it and pasting in. NOT simple.
I think this is the way it’s done on iOS / Mobile Safari, too.
It uses the default keyboard shortcuts for opening and closing the developer tools views, so if you have modified them you'll have to change those parts of this sample macro.
(I wish I'd thought of this technique earlier, because I think I could make good use of this myself… )
Thanks for sharing.
That's a very clever idea to use a KM URL trigger.