characters to searchbar - Mozilla

This is a discussion on characters to searchbar - Mozilla ; Hi, However hard I try, I can't find the correct way to send some characters to the searchbar by clicking a button in my xul addon. Please, can someone point me to the right code to do this. Thank you ...

+ Reply to Thread
Results 1 to 4 of 4

Thread: characters to searchbar

  1. characters to searchbar

    Hi,

    However hard I try, I can't find the correct way to send some
    characters to the searchbar by clicking a button in my xul addon.

    Please, can someone point me to the right code to do this.

    Thank you so much for your help.

    François

  2. Re: characters to searchbar

    On Apr 11, 2:32*pm, Malte Kraus wrote:

    > BrowserSearch.loadSearch:http://mxr.mozilla.org/mozilla-centr...ase/content/br...
    >



    Thank you Malte, Hopefully I will find out why

    alert(document.getElementById('searchbar').childNo des.length)

    returns null for document.getElementById('searchbar').


    Regards

    François

  3. Re: characters to searchbar

    On Apr 12, 2:23*pm, Malte Kraus wrote:

    > The searchbar is a XBL widget. You can get to the anonymous children you
    > see in the DOM Inspector with one of these methods:https://developer.mozilla.org/en/XBL...DOM_Interfaces...
    >
    > You can also look at what the searchbar code is doing to get these elements:http://mxr.mozilla.org/mozilla-centr...omponents/sear...
    >



    Thank you very much for this interface. I can access some of the "red"
    nodes from the dom inspector.

    Nevertheless, I still can't access the "html:input" node through this
    method. The tree I get with getAnonymousNodes doesn't reflect what I
    can see from the dom inspector. Some nodes are missing.

    For example:

    alert(mainWindow.document.getAnonymousElementByAtt ribute
    (mainWindow.document.getElementById('searchbar'),' anonid',
    'input').tagName);

    throws an exception as null.

    Regards.

    François


  4. SOLVED Re: characters to searchbar

    It works !!!

    I had to do put twice the getAnonymous to have it right:

    var mySearchbar = mainWindow.document.getAnonymousNodes
    (mainWindow.document.getElementById('searchbar'));
    var mySearchbarInput = mainWindow.document.getAnonymousNodes
    (mySearchbar[1])[0].childNodes[0].childNodes[0];


+ Reply to Thread