Giter Club home page Giter Club logo

eventtrackr's Introduction

EventTrackr

A Chrome extension for logging and viewing event tracking messages sent in the background.

Popup UI

event-listener

Options UI

event-listener

Overview

EventTrackr only listens for http requests sent to specific, whitelisted, URLs. It picks from these only POST requests and extracts the event message from details.requestBody.raw.

The event message object is stored in Chrome sync storage. If the extension's popup is closed, the message remains in storage until the popup is opened.

Upon opening the popup, two things occur:

  1. A message is sent from the popup.js file to the background.js file to let it know that the popup is now open
  2. Any event messages stored in the Chrome sync storage are retrieved in the popup.js file and further parsed.

Any messages received while the popup is open are stored in the Chrome sync storage. A message is then sent from background.js to popup.js to alert it to the newly received events. They are then retrieved in popup.js and parsed in preparation for display.

Parsing event messages will be dependent on how they are formatted. My example works with event messages that may be batched (an array of messages) where each message can contain a number of nest objects, some of which may be an array of objects or contain a nested array of objects.

After parsing, the desired fields of the event message are displayed in a jQuery table using a mixture of HTML and CSS.

A "Clear Log" button is available via the popup UI allowing a user to clear the previously stored messages. The popup.js file listens for the click and clears local objects of the event messages and also sends a message to background.js telling it to do the same, as well as clearing the Chrome sync storage.

eventtrackr's People

Contributors

camdey avatar

Stargazers

 avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.