URLBar selected text. - Mozilla

This is a discussion on URLBar selected text. - Mozilla ; Hi, I've been trying for a while to get the selected text in the urlbar, with limited success (ie none). I guess i'm looking for the correct context to call getSelection(). I've tried the methods listed in e.g. http://developer.mozilla.org/en/docs...w.getSelection but ...

+ Reply to Thread
Results 1 to 3 of 3

Thread: URLBar selected text.

  1. URLBar selected text.

    Hi,

    I've been trying for a while to get the selected text in the urlbar, with
    limited success (ie none).
    I guess i'm looking for the correct context to call getSelection(). I've
    tried the methods listed in e.g.
    http://developer.mozilla.org/en/docs...w.getSelection but that didn't
    work. Calling content.getSelection() works just perfectly fine for content
    in the browser window but alas I am not looking for that. Any help is
    appreciated.

    Cheers!


    Chris






  2. Re: URLBar selected text.

    WakA wrote:

    >I've been trying for a while to get the selected text in the urlbar, with limited success (ie none).
    >
    >

    The urlbar is a textbox so use .selectionStart and .selectionEnd etc.

    --
    Warning: May contain traces of nuts.

  3. Re: URLBar selected text.

    Thanks for the tip, I actually had this in my code but thought it wasn't
    working because I called .focus()
    (thus setting selectionStart and selectionEnd to the entire value of the
    box).
    Is there actually a way of calling getSelection for content inside the
    browser main-window?

    Problem solved, thank you. (:

    "Neil" wrote in message
    news:cb6dnXvu24pLCinYnZ2dnUVZ_s7inZ2d@mozilla.org. ..
    > WakA wrote:
    >
    >>I've been trying for a while to get the selected text in the urlbar, with
    >>limited success (ie none).
    >>

    > The urlbar is a textbox so use .selectionStart and .selectionEnd etc.
    >
    > --
    > Warning: May contain traces of nuts.




+ Reply to Thread