Firefox Extension - Monitor refresh and change of tab

北城余情 提交于 2019-12-11 00:45:16

问题


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


回答1:


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.



来源:https://stackoverflow.com/questions/6045906/firefox-extension-monitor-refresh-and-change-of-tab

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!