Bug 1602075 - add an accessibility-panel-auto-init feature to control the panel auto enabling functionality. r=mythmon,mtigley

Differential Revision: https://phabricator.services.mozilla.com/D71582
This commit is contained in:
Yura Zenevich 2020-05-05 21:13:38 +00:00
parent b874802505
commit afd1feade0
2 changed files with 16 additions and 1 deletions

View File

@ -2134,6 +2134,11 @@ pref("devtools.dom.enabled", false);
// Enable the Accessibility panel.
pref("devtools.accessibility.enabled", true);
#if defined(NIGHTLY_BUILD)
pref("devtools.accessibility.auto-init.enabled", true);
#else
pref("devtools.accessibility.auto-init.enabled", false);
#endif
// Web console filters
pref("devtools.webconsole.filter.error", true);

View File

@ -4,6 +4,8 @@
"use strict";
const Services = require("Services");
const {
accessibility: { AUDIT_TYPE },
} = require("devtools/shared/constants");
@ -24,6 +26,7 @@ class AccessibilityProxy {
this.accessibilityEventsMap = new Map();
this.accessibleWalkerEventsMap = new Map();
this.supports = {};
this.audit = this.audit.bind(this);
this.disableAccessibility = this.disableAccessibility.bind(this);
@ -256,6 +259,14 @@ class AccessibilityProxy {
[this.toolbox.targetList.TYPES.FRAME],
this._onTargetAvailable
);
// Bug 1602075: auto init feature definition is used for an experiment to
// determine if we can automatically enable accessibility panel when it
// opens.
this.supports.autoInit = Services.prefs.getBoolPref(
"devtools.accessibility.auto-init.enabled",
false
);
return true;
} catch (e) {
// toolbox may be destroyed during this step.
@ -342,7 +353,6 @@ class AccessibilityProxy {
// Finalize accessibility front initialization. See accessibility front
// bootstrap method description.
await this.accessibilityFront.bootstrap();
this.supports = {};
// To add a check for backward compatibility add something similar to the
// example below:
//