简体   繁体   中英

Setting focus to the address bar using a firefox extension

I'm developing an extension that requires to set focus to the address bar at some point. I've been trying to RTFM, but the FM is so hard to read!

Does anyone know of any way to set focus to the address bar from within a firefox extension?

TIA.

I would imagine it would be something like:

var addressBar=document.getElementById('urlbar');
addressBar.focus();

assuming document is in the XUL Chrome context.

I haven't tested that yet though, so I'm not 100% yet.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM