Skip to content
This repository has been archived by the owner on Aug 3, 2018. It is now read-only.

Latest commit

 

History

History
68 lines (42 loc) · 2.58 KB

development.md

File metadata and controls

68 lines (42 loc) · 2.58 KB

👈 Back to README

Development

Prerequisites: node v7.0.0, npm v3.10.

  1. Create a new profile for Pulse development. Launch that profile in either Developer Edition or Nightly.

  2. Install the DevPrefs and Extension Auto-Installer add-ons.

  3. Clone the repository and install the dependencies:

    git clone https://github.com/mozilla/pulse.git
    cd pulse
    npm install
  4. Run the following command to build the extension and install it to Firefox. While running, it will watch for changes and update the browser to the latest version of the add-on:

    npm run watch
  5. Use the Browser Console to debug. Filter the log with pulse. to filter out messages not logged by Pulse.

Architecture

Pulse is an Embedded WebExtension; an SDK add-on that wholly wraps a WebExtension.

The SDK add-on is responsible for:

  • Creating a <notificationbox> element to collect prompted feedback.
  • Establishing a communication channel with the WebExtension.
  • Collecting browser analytics to be submitted to telemetry.
  • Relaying those analytics to Test Pilot for submission.

While the WebExtension:

  • Adds the toolbar icon to the address bar.
  • Serves the survey to collect information from the user.

Survey

Because extensions cannot run content scripts on other extensions' hosted pages, you cannot use the React Developer Tools to debug the survey in context of the add-on. To work around this, a command is included to run the survey from a development server:

npm run survey

While the server is running, it can be accessed at http://localhost:8080/webextension/survey/. The survey bundle is recompiled with each change, but is not hot reloaded.

Style

Pulse follows the default formatting recommendations provided by prettier, but with single quotes. To lint the source tree:

npm run lint

Builds will fail if linting fails.

To automatically clean up the working tree, run:

npm run prettier