开发者

How to get Selected Text into a Variable or a variable from a Database?

开发者 https://www.devze.com 2023-02-12 21:30 出处:网络
I am currently working on Firefox extensions. My extension works as follows: Whenever user double clicks any word on page(any开发者_StackOverflow社区 webpage), the word selected must be stored in a

I am currently working on Firefox extensions. My extension works as follows:

  1. Whenever user double clicks any word on page(any开发者_StackOverflow社区 webpage), the word selected must be stored in a variable and sent to server to find its meaning from database.
  2. When he/she single clicks at any other place in the same document the popup showing meaning from DB should get disposed.

Any Answers?


How do I write a Firefox Addon? is more or less the official "How to get started" question for Firefox addons. I would probably add an event listener to the browser (gBrowser) to listen for click events. The easiest way to make the server call is probably using an XMLHttpRequest. Hopefully that's enough to get you started. Come back with more specific questions when you get stuck. Good luck!

0

精彩评论

暂无评论...
验证码 换一张
取 消