开发者

Firefox Extension - Monitor refresh and change of tab

开发者 https://www.devze.com 2023-03-07 05:06 出处:网络
I need to know when a user refreshs开发者_如何学Python the page and when he switches to another tab.

I need to know when a user refreshs开发者_如何学Python 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.

0

精彩评论

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