Firefox扩展 - 监视器刷新和更改选项卡 [英] Firefox Extension - Monitor refresh and change of tab

查看:188
本文介绍了Firefox扩展 - 监视器刷新和更改选项卡的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



有没有人知道如何在Firefox扩展中捕捉到这个?



最好的祝福
基督徒

解决方案

要知道位置栏中的值何时改变。这需要实现 nsIWebProgressListener 接口。你真正需要的唯一方法是 onLocationChange ,其余的应该是假的。您可以在这里找到文档以及代码示例: https://developer.mozilla.org/en/ Code_snippets / Progress_Listeners 的。您还可以使用进度侦听器来监控页面加载情况。


I need to know when a user refreshs the page and when he switches to another tab.

Does anyone has a clue how to capture this in a firefox extension?

Best regards Christian

解决方案

What you seem to want is knowing when the value in the location bar changes. This requires implementing nsIWebProgressListener interface. The only method you really need is onLocationChange, rest of them should be dummies. You can find the documentation along with code examples here: https://developer.mozilla.org/en/Code_snippets/Progress_Listeners. You can also use progress listeners to monitor page loads.

这篇关于Firefox扩展 - 监视器刷新和更改选项卡的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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