N
newbiegalore
Hello everyone
I have just finished going through some tutorials on developing
extensions for mozilla and have made a version of the born-geek
toolbar. Being a newbie I am stuck at a relatively simple-sounding
problem and would greatly appreciate any pointers/examples..
The problem: I want to detect an ENTER keypress.
Why: I am developing an extension which should say the site you are
visiting is xyz.com. I can pick up the main URL using
alert(window.content.document.location.href); (thanks to people on
this forum!) but then I need to send it to my server and receive a
reply back. I want to pick up the URL only when an ENTER is pressed or
when the user clicks on the GO in the address bar.
Can someone please point me to a solution?
I checked up this forum and google groups, and did try out if the
keycode==13 thing, but I am confused about the fact that who should
call this function? This function should keep running in the
background irrespective of whether any toolbar buttons are clicked or
not. The same goes for detecting whether the GO key has been clicked.
How do I access this key? Is there a standard name/ID for it?
Thanks in advance,
-A
I have just finished going through some tutorials on developing
extensions for mozilla and have made a version of the born-geek
toolbar. Being a newbie I am stuck at a relatively simple-sounding
problem and would greatly appreciate any pointers/examples..
The problem: I want to detect an ENTER keypress.
Why: I am developing an extension which should say the site you are
visiting is xyz.com. I can pick up the main URL using
alert(window.content.document.location.href); (thanks to people on
this forum!) but then I need to send it to my server and receive a
reply back. I want to pick up the URL only when an ENTER is pressed or
when the user clicks on the GO in the address bar.
Can someone please point me to a solution?
I checked up this forum and google groups, and did try out if the
keycode==13 thing, but I am confused about the fact that who should
call this function? This function should keep running in the
background irrespective of whether any toolbar buttons are clicked or
not. The same goes for detecting whether the GO key has been clicked.
How do I access this key? Is there a standard name/ID for it?
Thanks in advance,
-A