Bug 1531584 - catch promise error when updating a11y menu item when DOMWalker connection is already closed. r=gl
authorYura Zenevich <yura.zenevich@gmail.com>
Wed, 13 Mar 2019 15:44:55 +0000
changeset 525048 31dc14d0b906b79c5feb63a745bb05a71b93160b
parent 525047 3903ec67f703bfddc21211dcebca7141e099f29f
child 525049 eca35ef284c1b73bc29bd086180c5fb33f5f2ba7
push id2032
push userffxbld-merge
push dateMon, 13 May 2019 09:36:57 +0000
treeherdermozilla-release@455c1065dcbe [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgl
bugs1531584
milestone67.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1531584 - catch promise error when updating a11y menu item when DOMWalker connection is already closed. r=gl Differential Revision: https://phabricator.services.mozilla.com/D23321
devtools/client/inspector/markup/markup-context-menu.js
--- a/devtools/client/inspector/markup/markup-context-menu.js
+++ b/devtools/client/inspector/markup/markup-context-menu.js
@@ -752,18 +752,20 @@ class MarkupContextMenu {
       menu.append(menuitem);
     }
 
     menu.popup(screenX, screenY, this.toolbox);
     return menu;
   }
 
   async _updateA11YMenuItem(menuItem) {
-    const hasMethod = await this.target.actorHasMethod("domwalker",
-                                                       "hasAccessibilityProperties");
+    const hasMethod = await this.target.actorHasMethod(
+      "domwalker", "hasAccessibilityProperties").catch(
+        // Connection to DOMWalker might have been already closed.
+        error => console.warn(error));
     if (!hasMethod) {
       return;
     }
 
     const hasA11YProps = await this.walker.hasAccessibilityProperties(
       this.selection.nodeFront);
     if (hasA11YProps) {
       this.toolbox.doc.getElementById(menuItem.id).disabled = menuItem.disabled = false;