41497

Firefox Extension - Monitor refresh and change of tab

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

Answer1:

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.

Recommend

  • Making a QList of an abstract class objects in C++/QT?
  • Shortest path in a 3D maze
  • How can I generate integers that satisfy some restrictions?
  • How to get the relative position of a Dictionary element?
  • Making mono cross platform support for Task/Intent
  • How to query property value when property name is a parameter?
  • I am looking for an algorithm that calculates the power of a number. (x^y), x and y are integers . I
  • Using Python objects in C++
  • AWS Cognito- get user information with ID
  • Keep Sql Connection open for iterating many requests? Or close each step?
  • How to clear out the contents of a map when clear() method call throws UnsupportedOperationException
  • Weird session behaviour in codeigniter
  • What is the first step to using a REST API in Rails?
  • Complex trait requirements on struct
  • Simple Factory with reflection C#
  • Build Matrix of Comparisons in SQl Server
  • composer dependency stating in doesn't have php-xsl
  • Is there a way to choose which files are displayed to the user via the standard OPENFILE dialogs?
  • Why are “sc.addFile” and “spark-submit --files” not distributing a local file to all workers?
  • Comparing user's facebook/twitter friends to site's users in Python/Django
  • A class implementing two different IObservables?
  • Why can't UI components be accessed from a backgroundworker?
  • python: forcing relative imports to search from script file
  • accepts_nested_attributes_for practical form use for in Rails 3
  • Intel-64 and ia32 atomic operations acquire-release semantics and GCC 5+
  • Zoom in and out of jPanel
  • Firefox Extension - Monitor refresh and change of tab
  • Saving Changes After In-App Purchase Has Been Purchased
  • Change multiple background-images with jQuery
  • C# - Serializing and deserializing static member
  • Align navbar back button on right side
  • Window Size for Mac application
  • Trying to switch camera back to front but getting exception
  • To display the title for the current loaction in map in iphone
  • VB.net deserialize, JSON Conversion from type 'Dictionary(Of String,Object)' to type '
  • Free memory of cv::Mat loaded using FileStorage API
  • Angular 2 constructor injection vs direct access
  • Does armcc optimizes non-volatile variables with -O0?
  • Programmatically clearing map cache
  • How to push additional view controllers onto NavigationController but keep the TabBar?