Wednesday, October 22, 2008

How to set a value of a textbox in a sidebar of firefox browser [ Firefox Extension Development]


function setTextSideBar(txtbx,  str){

    var sidebarDoc = document.getElementById("sidebar").contentDocument;

    // Verify that our sidebar is open at this moment:
    if (sidebarDoc.location.href ==  "chrome://grabtext/content/gtsidebar.xul") {

     // set text:
    sidebarDoc.getElementById(txtbx).value = str; 

   }

}

0 comments: