I tried using @run-at context-menu, but the option does nothing when I right click and activate the script when my mouse cursor is inside the iframe. It only works on the top page.
I thought of using a GM_registerCommand (and a function), but I don't know how I could tell the script to run in an iframe.
This is a general purpose script, so knowing which iframe I need ahead of time is not possible. I need to be able to somehow, on the fly, tell the script to work from the context of a particular iframe.