Skip to content
This repository was archived by the owner on Oct 14, 2020. It is now read-only.
This repository was archived by the owner on Oct 14, 2020. It is now read-only.

Making addons a better path for experimention: List of ideas to change in firefox to eliminate needing privileged shield utils #205

@gregglind

Description

@gregglind

rev: 3

Current Assumptions about Experiment Addons that need revision

  1. They need to "pack their own lunch". Instead, some change to code in the tree, including some possible new "mozilla-only" permissions or APIs could help.
  2. All Experiments run in Firefox. It may be that we build addons that are designed to run on other browsers, and could benefit from CI, testing, and instrumentation.
  3. They should tie to existing Telemetry (including client Id).
  4. They should "store nothing" in firefox between runs.
  5. They should "leave no trace" after finishing.

Help me to stop avoiding firefox.

Lifecycle Event Challenges

First install vs. Second install matters for experiments (and probably other addons)

  • runtime.onInstall 'details' has a little more details (a 'firefox upgraded', 'is this first run for this addon', maybe other things)
  • runtime.onStartup could gets the 'details' from runtime.onInstall, and be called every time.
  • runtime.onStartup() doesn't run in the "incognito" mode, see: mdn: runtime.onStartup docs

Study Endings and Uninstall is hard to untangle.

  • uninstall / shutdown for addons can get messages about the 'full reason' so that normandy vs about:addons click, etc.
  • handle the 'removed by rm from profile' case, if possible

Sending Data

Telemetry requires privileges to

  • fill the payload (clientId, other payload data)

  • send with validation. (using TelemetryClient repsects the prefs, formats data, etc.)

  • semi-permission for telemetry, telmetry client id

  • un-privileged telemetry equivalent for when addons are running on other browsers

Reading and Writing Preferences

Studies care about:

  • permissions for telemetry, shield, pioneer, etc.
  • prefs (or other mechanisms) set to simulate different conditions, such as "expired".
  • storing data across sessions (notably firstRun / secondRun so that we can know if this is a fresh install or not, so that we can decide a variation and send appropriate pings.

Persistent Data and Setup issues

  • to eliminate prefs, have a method (in web-ext cli or elsewhere) for setting storage.local 'initial values'. The allows simiulating 2nd run, force a variation to be selected, etc.

  • "local prefs" or "prefs for this addon" feels like something that would be nice to add here, if we are sticking with prefs. In web-ext configs, allow "prefs" AND "addonPrefs". Having to figure out the name for those prefs as a mangle of the addonId is tedious!

QA / CI

As we discussed, there are some possible beneficial tests that would help to lower the risk profile of these addons

  • does it break the updater?
  • does using it break performance (esp compared to an empty addon)
  • are there templates and tests that would be beneficial to addons we make for other browsers, or other common addons that users might install on Fx?
  • ci for signing and building
  • mach try-with-addon or npm try with addon

@aswan, @rhelmer, @motin @biancadanforth thoughts on if we should turn some of this into true bugs / patches.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions