使用Firefox扩展将焦点设置到地址栏 [英] Setting focus to the address bar using a firefox extension

查看:152
本文介绍了使用Firefox扩展将焦点设置到地址栏的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在开发一个扩展,需要将焦点设置到地址栏上。我一直在尝试RTFM,但FM是如此难以阅读!

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!

有谁知道任何方式来设置焦点地址栏从一个Firefox扩展?

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

TIA。

TIA.

推荐答案

例如:

I would imagine it would be something like:

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

假设文档位于XUL Chrome上下文中。

assuming document is in the XUL Chrome context.

我还没有测试过,所以我还没有100%。

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

这篇关于使用Firefox扩展将焦点设置到地址栏的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆