By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
460,044 Members | 1,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 460,044 IT Pros & Developers. It's quick & easy.

detecting ENTER keypress and click in Address Bar

P: n/a
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
Jun 27 '08 #1
Share this Question
Share on Google+
2 Replies


P: n/a
On Apr 12, 1:26 am, newbiegalore <banerjee.anir...@gmail.comwrote:
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
any pointers would be appreciated! :-)
Jun 27 '08 #2

P: n/a
VK
On Apr 12, 12:26 pm, newbiegalore <banerjee.anir...@gmail.comwrote:
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..
Where the one could be to use the appropriate newsgroup. It is not a
"go away!" message, but clj is primarily targeted to cross-browser
development for the Web. XPCOM and internal Gecko JavaScript layer
questions for privileged extensions are not really within this domain.
You should ask at mozilla.dev.tech.javascript

You may also look through http://developer.mozilla.org/en/docs/XUL and
http://www.xulplanet.com/
Both are a complete permanent mess for years, so some patience will be
needed.
Jun 27 '08 #3

This discussion thread is closed

Replies have been disabled for this discussion.