Send Global keystroke using JavaScript in FireFox/Greasemonkey

后端 未结 2 589
谎友^
谎友^ 2021-01-20 21:16

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

2条回答
  •  清歌不尽
    2021-01-20 22:01

    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:

    • Mozilla extensions home page
    • Add-on Builder
    • 10 Things They Never Tell You In Firefox Extension School
    • Developing Firefox Extensions – Paper

提交回复
热议问题