I currently have a GM script that captures a keystroke and programmatically clicks an element on a webpage. However, this only works when the page/tab has focus. Is there an
Can you precede your GreaseMonkey script with a javascript call to window.focus()
?
This cannot be done in JS or Greasemonkey, by design. It used to be a huge security hole. You'll have to write an extension (add-on).
Here are some add-on resources, I've found helpful: