detecting ENTER keypress and click in Address Bar

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • newbiegalore

    detecting ENTER keypress and click in Address Bar

    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.co ntent.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
  • newbiegalore

    #2
    Re: detecting ENTER keypress and click in Address Bar

    On Apr 12, 1:26 am, newbiegalore <banerjee.anir. ..@gmail.comwro te:
    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.co ntent.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! :-)

    Comment

    • VK

      #3
      Re: detecting ENTER keypress and click in Address Bar

      On Apr 12, 12:26 pm, newbiegalore <banerjee.anir. ..@gmail.comwro te:
      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.tec h.javascript

      You may also look through http://developer.mozilla.org/en/docs/XUL and

      Both are a complete permanent mess for years, so some patience will be
      needed.

      Comment

      Working...