Over the weekend after the previous weekly report, I completed the Data Sink code. The Data Sink uses Data Store to store the Normalized Data asynchronously using IndexedDB.
To check the Network Producer and the Data Sink, I made a simple UI which just sends an event to the Data Sink (again, async) to start and stop, listens for an update event notification to know that new data is available to read and checks every 100ms for new data. If new data is available, it would retrieve the data from the IndexedDB database with the help of the same shared Data Store object (shared in the sense that both Data Sink and UI import the DataStore.jsm file globally making the scope shared). I will next try to separate the two Data Store instances, but for that I would have to check whether two different scripts can access the same database at the same time without any dangers of loosing data or any thing similar.
The whole code was packed into a restartless extension to see the producer in action. The extension places a toolbar button in the add-on bar. When you click the button, UI sends an event to tell the Data Sink to start producer activity. Data Sink receives that message and starts all the registered producer. For now, I am dumping the collected activity by the producers in the Message tab of Error Console. To stop the producers, click the button again.
Throughout the week, I completed the work on the next producer: PageEventsProducer, which will listen to the various activities on the webpage of the visible tab at the time of clicking the toolbar button. It can capture activities like mouse events, keyboard events, DOMContentLoaded, MozAfterPaint etc. By default only Loading events like load, unload, DOMContentLoaded etc. would be enabled, while other events can be enabled via the addEventTypes method call.
Next week, I will work on the UI part of the add-on and try to visualize the data captured by these two producers.