diff --git a/devtools/client/accessibility/accessibility-startup.js b/devtools/client/accessibility/accessibility-startup.js index a1f29b4cc71e..2f402ed6ff6b 100644 --- a/devtools/client/accessibility/accessibility-startup.js +++ b/devtools/client/accessibility/accessibility-startup.js @@ -96,6 +96,12 @@ class AccessibilityStartup { * accessibility service is initialized or shutdown. */ async _updateToolHighlight() { + // Only update the tab highlighted state when the panel can be + // enabled/disabled manually. + if (this.accessibilityProxy.supports.autoInit) { + return; + } + const isHighlighted = await this.toolbox.isToolHighlighted("accessibility"); if (this.accessibilityProxy.enabled && !isHighlighted) { this.toolbox.highlightTool("accessibility"); diff --git a/devtools/client/accessibility/test/browser/browser_accessibility_panel_highlighter.js b/devtools/client/accessibility/test/browser/browser_accessibility_panel_highlighter.js index 9f463b11a077..3a9ee5ba7858 100644 --- a/devtools/client/accessibility/test/browser/browser_accessibility_panel_highlighter.js +++ b/devtools/client/accessibility/test/browser/browser_accessibility_panel_highlighter.js @@ -6,6 +6,7 @@ const TEST_URI = '
paragraph
'; add_task(async function tabNotHighlighted() { + Services.prefs.setBoolPref("devtools.accessibility.auto-init.enabled", false); await addTab(buildURL(TEST_URI)); const { toolbox } = await openInspector(); const isHighlighted = await toolbox.isToolHighlighted("accessibility"); @@ -17,9 +18,11 @@ add_task(async function tabNotHighlighted() { ); gBrowser.removeCurrentTab(); + Services.prefs.clearUserPref("devtools.accessibility.auto-init.enabled"); }); add_task(async function tabHighlighted() { + Services.prefs.setBoolPref("devtools.accessibility.auto-init.enabled", false); let a11yService = await initA11y(); ok(a11yService, "Accessibility service was started"); await addTab(buildURL(TEST_URI)); @@ -28,4 +31,5 @@ add_task(async function tabHighlighted() { a11yService = null; gBrowser.removeCurrentTab(); + Services.prefs.clearUserPref("devtools.accessibility.auto-init.enabled"); });