Bug 1395398 - Send to Device notification shouldn't appear after clicking "Sign in" and other non-device menu items. r=jaws
authorDrew Willcoxon <adw@mozilla.com>
Thu, 31 Aug 2017 09:38:37 -0700
changeset 378042 a3689ab6e5be6b53c2c018c6e2ecac4646ad979e
parent 378041 9c13f2c5b9515e456a2a9abd1107affeb3709b93
child 378043 23e8ef26bb4066c71f78b107481426e12d05d79c
push id50167
push userdwillcoxon@mozilla.com
push dateThu, 31 Aug 2017 20:37:57 +0000
treeherderautoland@a3689ab6e5be [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjaws
bugs1395398
milestone57.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 1395398 - Send to Device notification shouldn't appear after clicking "Sign in" and other non-device menu items. r=jaws MozReview-Commit-ID: Gm35IfZCJPQ
browser/base/content/browser-pageActions.js
--- a/browser/base/content/browser-pageActions.js
+++ b/browser/base/content/browser-pageActions.js
@@ -815,17 +815,21 @@ BrowserPageActions.sendToDevice = {
       }
       let item = document.createElement("toolbarbutton");
       item.classList.add("pageAction-sendToDevice-device", "subviewbutton");
       if (clientId) {
         item.classList.add("subviewbutton-iconic");
       }
       item.setAttribute("tooltiptext", name);
       item.addEventListener("command", event => {
-        BrowserPageActionFeedback.show("sendToDevice", event);
+        // There are items in the subview that don't represent devices: "Sign
+        // in", "Learn about Sync", etc.  Device items will be .sendtab-target.
+        if (event.target.classList.contains("sendtab-target")) {
+          BrowserPageActionFeedback.show("sendToDevice", event);
+        }
       });
       return item;
     });
 
     bodyNode.removeAttribute("state");
     // In the first ~10 sec after startup, Sync may not be loaded and the list
     // of devices will be empty.
     if (gSync.syncConfiguredAndLoading) {