diff options
author | FranklinDM <mrmineshafter17@gmail.com> | 2018-11-18 15:38:15 +0800 |
---|---|---|
committer | FranklinDM <mrmineshafter17@gmail.com> | 2018-11-18 15:38:15 +0800 |
commit | af0164310dd94e24bf7b44ebb6d9b146eb5db241 (patch) | |
tree | 7fc305c8f83ac25d45c3f7143725c32e1161bed4 /application | |
parent | a681891e66255bfc466782ee5714e5cff80e0004 (diff) | |
download | UXP-af0164310dd94e24bf7b44ebb6d9b146eb5db241.tar UXP-af0164310dd94e24bf7b44ebb6d9b146eb5db241.tar.gz UXP-af0164310dd94e24bf7b44ebb6d9b146eb5db241.tar.lz UXP-af0164310dd94e24bf7b44ebb6d9b146eb5db241.tar.xz UXP-af0164310dd94e24bf7b44ebb6d9b146eb5db241.zip |
Hide mute menu item and disable mute hotkey with existing pref
Diffstat (limited to 'application')
-rw-r--r-- | application/palemoon/base/content/browser.js | 39 |
1 files changed, 39 insertions, 0 deletions
diff --git a/application/palemoon/base/content/browser.js b/application/palemoon/base/content/browser.js index 5d44f0066..591d00fbb 100644 --- a/application/palemoon/base/content/browser.js +++ b/application/palemoon/base/content/browser.js @@ -976,6 +976,7 @@ var gBrowserInit = { CombinedStopReload.init(); allTabs.readPref(); TabsOnTop.init(); + AudioIndicator.init(); gPrivateBrowsingUI.init(); TabsInTitlebar.init(); retrieveToolbarIconsizesFromTheme(); @@ -1364,6 +1365,8 @@ var gBrowserInit = { BookmarkingUI.uninit(); TabsOnTop.uninit(); + + AudioIndicator.uninit(); TabsInTitlebar.uninit(); @@ -4597,6 +4600,42 @@ function setToolbarVisibility(toolbar, isVisible) { ToolbarIconColor.inferFromText(); } +var AudioIndicator = { + init: function () { + Services.prefs.addObserver(this._prefName, this, false); + this.syncUI(); + }, + + uninit: function () { + Services.prefs.removeObserver(this._prefName, this); + }, + + toggle: function () { + this.enabled = !Services.prefs.getBoolPref(this._prefName); + }, + + syncUI: function () { + document.getElementById("context_toggleMuteTab").setAttribute("hidden", this.enabled); + document.getElementById("key_toggleMute").setAttribute("disabled", this.enabled); + }, + + get enabled () { + return !Services.prefs.getBoolPref(this._prefName); + }, + + set enabled (val) { + Services.prefs.setBoolPref(this._prefName, !!val); + return val; + }, + + observe: function (subject, topic, data) { + if (topic == "nsPref:changed") + this.syncUI(); + }, + + _prefName: "browser.tabs.showAudioPlayingIcon" +} + var TabsOnTop = { init: function TabsOnTop_init() { Services.prefs.addObserver(this._prefName, this, false); |