summaryrefslogtreecommitdiffstats
path: root/browser/actors/DecoderDoctorChild.sys.mjs
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-07 19:33:14 +0000
commit36d22d82aa202bb199967e9512281e9a53db42c9 (patch)
tree105e8c98ddea1c1e4784a60a5a6410fa416be2de /browser/actors/DecoderDoctorChild.sys.mjs
parentInitial commit. (diff)
downloadfirefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.tar.xz
firefox-esr-36d22d82aa202bb199967e9512281e9a53db42c9.zip
Adding upstream version 115.7.0esr.upstream/115.7.0esrupstream
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'browser/actors/DecoderDoctorChild.sys.mjs')
-rw-r--r--browser/actors/DecoderDoctorChild.sys.mjs28
1 files changed, 28 insertions, 0 deletions
diff --git a/browser/actors/DecoderDoctorChild.sys.mjs b/browser/actors/DecoderDoctorChild.sys.mjs
new file mode 100644
index 0000000000..d85be3656e
--- /dev/null
+++ b/browser/actors/DecoderDoctorChild.sys.mjs
@@ -0,0 +1,28 @@
+/* -*- mode: js; indent-tabs-mode: nil; js-indent-level: 2 -*- */
+/* vim: set ts=2 sw=2 sts=2 et tw=80: */
+/* This Source Code Form is subject to the terms of the Mozilla Public
+ * License, v. 2.0. If a copy of the MPL was not distributed with this
+ * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
+
+export class DecoderDoctorChild extends JSWindowActorChild {
+ // Observes 'decoder-doctor-notification'. This actor handles most such notifications, but does not deal with notifications with the 'cannot-play' type, which is handled
+ // @param aSubject the nsPIDOMWindowInner associated with the notification.
+ // @param aTopic should be "decoder-doctor-notification".
+ // @param aData json data that contains analysis information from Decoder Doctor:
+ // - 'type' is the type of issue, it determines which text to show in the
+ // infobar.
+ // - 'isSolved' is true when the notification actually indicates the
+ // resolution of that issue, to be reported as telemetry.
+ // - 'decoderDoctorReportId' is the Decoder Doctor issue identifier, to be
+ // used here as key for the telemetry (counting infobar displays,
+ // "Learn how" buttons clicks, and resolutions) and for the prefs used
+ // to store at-issue formats.
+ // - 'formats' contains a comma-separated list of formats (or key systems)
+ // that suffer the issue. These are kept in a pref, which the backend
+ // uses to later find when an issue is resolved.
+ // - 'decodeIssue' is a description of the decode error/warning.
+ // - 'resourceURL' is the resource with the issue.
+ observe(aSubject, aTopic, aData) {
+ this.sendAsyncMessage("DecoderDoctor:Notification", aData);
+ }
+}