开发者

Setting focus to the address bar using a firefox extension

开发者 https://www.devze.com 2023-01-07 06:17 出处:网络
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!

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.

0

精彩评论

暂无评论...
验证码 换一张
取 消