tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

DecoderDoctorChild.sys.mjs (1680B)


      1 /* -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- */
      2 /* vim: set ts=2 sw=2 sts=2 et tw=80: */
      3 /* This Source Code Form is subject to the terms of the Mozilla Public
      4 * License, v. 2.0. If a copy of the MPL was not distributed with this
      5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      6 
      7 export class DecoderDoctorChild extends JSWindowActorChild {
      8  // Observes 'decoder-doctor-notification'. This actor handles most such notifications, but does not deal with notifications with the 'cannot-play' type, which is handled
      9  // @param aSubject the nsPIDOMWindowInner associated with the notification.
     10  // @param aTopic should be "decoder-doctor-notification".
     11  // @param aData json data that contains analysis information from Decoder Doctor:
     12  // - 'type' is the type of issue, it determines which text to show in the
     13  //   infobar.
     14  // - 'isSolved' is true when the notification actually indicates the
     15  //   resolution of that issue, to be reported as telemetry.
     16  // - 'decoderDoctorReportId' is the Decoder Doctor issue identifier, to be
     17  //   used here as key for the telemetry (counting infobar displays,
     18  //   "Learn how" buttons clicks, and resolutions) and for the prefs used
     19  //   to store at-issue formats.
     20  // - 'formats' contains a comma-separated list of formats (or key systems)
     21  //   that suffer the issue. These are kept in a pref, which the backend
     22  //   uses to later find when an issue is resolved.
     23  // - 'decodeIssue' is a description of the decode error/warning.
     24  // - 'resourceURL' is the resource with the issue.
     25  observe(aSubject, aTopic, aData) {
     26    this.sendAsyncMessage("DecoderDoctor:Notification", aData);
     27  }
     28 }