Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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.

like image 282
Rakesh Pai Avatar asked Oct 26 '22 10:10

Rakesh Pai


1 Answers

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.

like image 123
lucideer Avatar answered Nov 08 '22 13:11

lucideer