Bug 1330232 - show the label of 'play tab' in the pop-up menu. draft
authorAlastor Wu <alwu@mozilla.com>
Wed, 18 Jan 2017 14:39:08 +0800
changeset 462906 82ca0f1c25bc838719d89131d08f20c09269d091
parent 462868 f2659a9e964d35b109d7469b352f0068f018198f
child 462955 3e526e605ef7090a27ecbc2027206e9d991c24ac
child 462956 4bea6eb959081459a3352f6bacabe0d8482690f4
child 462959 27e40011f694437b9a400247d6ce84a278a091f4
child 462961 39b2d91f62ab5cb0c37341d19dea0eb5d266fe6c
push id41895
push useralwu@mozilla.com
push dateWed, 18 Jan 2017 06:38:13 +0000
bugs1330232
milestone53.0a1
Bug 1330232 - show the label of 'play tab' in the pop-up menu. If the tab is blocked, we should show "play tab" in the pop-up menu instead of "mute tab". MozReview-Commit-ID: 9SQOtgK4vgv
browser/base/content/browser.js
browser/locales/en-US/chrome/browser/browser.properties
--- a/browser/base/content/browser.js
+++ b/browser/base/content/browser.js
@@ -7829,17 +7829,20 @@ var TabContextMenu = {
     // Hide "Bookmark All Tabs" for a pinned tab.  Update its state if visible.
     let bookmarkAllTabs = document.getElementById("context_bookmarkAllTabs");
     bookmarkAllTabs.hidden = this.contextTab.pinned;
     if (!bookmarkAllTabs.hidden)
       PlacesCommandHook.updateBookmarkAllTabsCommand();
 
     // Adjust the state of the toggle mute menu item.
     let toggleMute = document.getElementById("context_toggleMuteTab");
-    if (this.contextTab.hasAttribute("muted")) {
+    if (this.contextTab.hasAttribute("blocked")) {
+      toggleMute.label = gNavigatorBundle.getString("playTab.label");
+      toggleMute.accessKey = gNavigatorBundle.getString("playTab.accesskey");
+    } else if (this.contextTab.hasAttribute("muted")) {
       toggleMute.label = gNavigatorBundle.getString("unmuteTab.label");
       toggleMute.accessKey = gNavigatorBundle.getString("unmuteTab.accesskey");
     } else {
       toggleMute.label = gNavigatorBundle.getString("muteTab.label");
       toggleMute.accessKey = gNavigatorBundle.getString("muteTab.accesskey");
     }
 
     this.contextTab.toggleMuteMenuItem = toggleMute;
--- a/browser/locales/en-US/chrome/browser/browser.properties
+++ b/browser/locales/en-US/chrome/browser/browser.properties
@@ -699,16 +699,18 @@ userContext.aboutPage.label = Manage con
 userContext.aboutPage.accesskey = O
 
 userContextOpenLink.label = Open Link in New %S Tab
 
 muteTab.label = Mute Tab
 muteTab.accesskey = M
 unmuteTab.label = Unmute Tab
 unmuteTab.accesskey = M
+playTab.label = Play Tab
+playTab.accesskey = M
 
 # LOCALIZATION NOTE (weakCryptoOverriding.message): %S is brandShortName
 weakCryptoOverriding.message = %S recommends that you don’t enter your password, credit card and other personal information on this website.
 revokeOverride.label = Don’t Trust This Website
 revokeOverride.accesskey = D
 
 # LOCALIZATION NOTE (certErrorDetails*.label): These are text strings that
 # appear in the about:certerror page, so that the user can copy and send them to