如何从Firefox扩展中的地址栏中获取文本 [英] How to get text from Address Bar in Firefox extension

查看:214
本文介绍了如何从Firefox扩展中的地址栏中获取文本的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在构建 Firefox扩展程序。我正在使用 XUL Javascript 来执行此操作。我需要从我的Firefox浏览器的地址栏中获取文本。
请不要混淆浏览器导航的URL,只是用户在页面重定向之前输入的文本。假设用户在 http://www.myexample.com 或任何页面。现在,他在地址栏中键入Cricket,一旦他进入,我想从地址栏中捕获文本(Cricket)。我需要这些数据来进一步处理我的代码。

I am building a Firefox Extension. I am using XUL and Javascript to do this. I need to get the text from my Firefox browser's address bar. Please don't get confused with URL where the browser has navigated, its just the text that user enters before the page redirects. Suppose user is at http://www.myexample.com or whatever page. Now he types Cricket in the Address Bar and as soon as he hits enter, I want to capture the text ("Cricket") from the address bar. I need this data to do some processing further in my code.

推荐答案

Google Chrome似乎不可能,作为这个问题的答案说。

It doesn't seem to be possible in Google Chrome, as answers to this question say.

但随着Firefox,你可以看看这里提到或者在这个,并试图弄清楚他们是如何做到的。我搜索了MDC ,但没有成功。

But with Firefox, you may have a look at several extensions mentioned here or at this one and try to figure out how they did what they did. I searched MDC a bit, but without luck.

我对Firefox扩展没有任何经验,所以我希望这对于能给出更精确解释的人有所帮助。

I don't have any experience with Firefox extensions, so I hope this will be helpful to someone who can give a more precise explanation.

这篇关于如何从Firefox扩展中的地址栏中获取文本的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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