It's got to be something like that, unfortunately I just don't know the exact syntax. I've got some other javascript bookmarklets in firefox, but looking now at their links, they are a mess of %-encoding, and I'm not sure if that's important or not (perhaps they got mangled through an old import)
FWIW, here's a bookmark to get rid of static bars (the kind of thing annoying websites have stuck at the top of the page and won't go away when you scroll):
javascript:(function()%7B(function%20()%20%7Bvar%20i%2C%20elements%20%3D%20document.querySelectorAll('body%20*')%3Bfor%20(i%20%3D%200%3B%20i%20%3C%20elements.length%3B%20i%2B%2B)%20%7Bif%20(getComputedStyle(elements%5Bi%5D).position%20%3D%3D%3D%20'fixed')%20%7Belements%5Bi%5D.parentNode.removeChild(elements%5Bi%5D)%3B%7D%7D%7D)()%7D)()
I don't remember it being quite so ugly when I first added it, surely bookmarks don't need to %-encode spaces and curly brackets?