From 955962504a4d1e34bfbb0a6bc02546cbdaad744b Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Thu, 30 Jan 2020 21:27:11 -0500 Subject: [PATCH 1/6] [Pale-Moon] Follow up to 8a67d2608 - Remove unused import of AppConstants.jsm from setDesktopBackground.js --- .../palemoon/components/shell/content/setDesktopBackground.js | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/palemoon/components/shell/content/setDesktopBackground.js b/application/palemoon/components/shell/content/setDesktopBackground.js index 4c11b9d331..33d459e9db 100644 --- a/application/palemoon/components/shell/content/setDesktopBackground.js +++ b/application/palemoon/components/shell/content/setDesktopBackground.js @@ -2,8 +2,6 @@ * License, v. 2.0. If a copy of the MPL was not distributed with this file, * You can obtain one at http://mozilla.org/MPL/2.0/. */ -Components.utils.import("resource://gre/modules/AppConstants.jsm"); - var Ci = Components.interfaces; var gSetBackground = { From 2f024320346e1ff6411d1d75e3751feb223cda37 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Sun, 2 Feb 2020 17:01:42 +0800 Subject: [PATCH 2/6] [Pale-Moon] Issue #1722 - Part 1: Allow hiding pinned tabs for the Ctrl-Tab graphical pane --- application/palemoon/app/profile/palemoon.js | 1 + application/palemoon/base/content/browser-tabPreviews.js | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index 48da270712..1baa2f3ac8 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -469,6 +469,7 @@ pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000); pref("browser.allTabs.previews", true); pref("browser.ctrlTab.previews", true); +pref("browser.ctrlTab.hidePinnedTabs", false); pref("browser.ctrlTab.recentlyUsedLimit", 7); // By default, do not export HTML at shutdown. diff --git a/application/palemoon/base/content/browser-tabPreviews.js b/application/palemoon/base/content/browser-tabPreviews.js index e0755b81d4..7804b60836 100644 --- a/application/palemoon/base/content/browser-tabPreviews.js +++ b/application/palemoon/base/content/browser-tabPreviews.js @@ -216,6 +216,15 @@ var ctrlTab = { } } + let hidePinnedTabs = gPrefService.getBoolPref("browser.ctrlTab.hidePinnedTabs"); + if (hidePinnedTabs) { + regularTabsList = list.filter(function (tab) !tab.pinned); + // Don't hide pinned tabs if we only have 1 regular tab + if (regularTabsList.length > 1) { + list = regularTabsList; + } + } + return this._tabList = list; }, From 1743bff855b74f29d83f681e9f3619ac06b61dfb Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Sun, 2 Feb 2020 17:01:42 +0800 Subject: [PATCH 3/6] [Pale-Moon] Issue #1722 - Part 1: Allow hiding pinned tabs for the Ctrl-Tab graphical pane --- application/palemoon/base/content/browser-tabPreviews.js | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/application/palemoon/base/content/browser-tabPreviews.js b/application/palemoon/base/content/browser-tabPreviews.js index 7804b60836..a998ea2df9 100644 --- a/application/palemoon/base/content/browser-tabPreviews.js +++ b/application/palemoon/base/content/browser-tabPreviews.js @@ -225,6 +225,15 @@ var ctrlTab = { } } + let hidePinnedTabs = gPrefService.getBoolPref("browser.ctrlTab.hidePinnedTabs"); + if (hidePinnedTabs) { + regularTabsList = list.filter(function (tab) !tab.pinned); + // Don't hide pinned tabs if we only have 1 regular tab + if (regularTabsList.length > 1) { + list = regularTabsList; + } + } + return this._tabList = list; }, From 9b300b010d180771d871e19a4af485fe8e79b30a Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Sun, 2 Feb 2020 17:32:39 +0800 Subject: [PATCH 4/6] [Pale-Moon] Issue #1722 - Part 2: Allow hiding pinned tabs for the All Tabs graphical pane --- application/palemoon/app/profile/palemoon.js | 1 + .../palemoon/base/content/browser-tabPreviews.js | 11 ++++++++++- 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index 1baa2f3ac8..6529728c92 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -468,6 +468,7 @@ pref("browser.tabs.showAudioPlayingIcon", true); pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000); pref("browser.allTabs.previews", true); +pref("browser.allTabs.hidePinnedTabs", false); pref("browser.ctrlTab.previews", true); pref("browser.ctrlTab.hidePinnedTabs", false); pref("browser.ctrlTab.recentlyUsedLimit", 7); diff --git a/application/palemoon/base/content/browser-tabPreviews.js b/application/palemoon/base/content/browser-tabPreviews.js index a998ea2df9..8e593ea86a 100644 --- a/application/palemoon/base/content/browser-tabPreviews.js +++ b/application/palemoon/base/content/browser-tabPreviews.js @@ -667,6 +667,15 @@ var allTabs = { this._currentFilter = this.filterField.value; + let hidePinnedTabs = gPrefService.getBoolPref("browser.allTabs.hidePinnedTabs"); + if (hidePinnedTabs) { + let regularTabsList = Array.filter(this.previews, function (preview) !preview._tab.pinned); + // Show pinned tabs if we don't have any regular tabs + if (regularTabsList.length == 0) { + hidePinnedTabs = false; + } + } + var filter = this._currentFilter.split(/\s+/g); this._visible = 0; Array.forEach(this.previews, function (preview) { @@ -681,7 +690,7 @@ var allTabs = { for (let i = 0; i < filter.length; i++) matches += tabstring.includes(filter[i]); } - if (matches < filter.length || tab.hidden) { + if (matches < filter.length || tab.hidden || (hidePinnedTabs && tab.pinned)) { preview.hidden = true; } else { From fdbd8905813db25069c474d6accb569c86730c91 Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Thu, 6 Feb 2020 13:05:55 -0500 Subject: [PATCH 5/6] [Basilisk] Issue MoonchildProductions/UXP#1392 - Remove usage of MOZ_EME_MODULES --- application/basilisk/app/moz.build | 3 --- application/basilisk/app/profile/basilisk.js | 6 ++---- 2 files changed, 2 insertions(+), 7 deletions(-) diff --git a/application/basilisk/app/moz.build b/application/basilisk/app/moz.build index 72f34d5758..dbf5d1ba25 100644 --- a/application/basilisk/app/moz.build +++ b/application/basilisk/app/moz.build @@ -45,9 +45,6 @@ if CONFIG['OS_ARCH'] == 'WINNT': RCINCLUDE = 'splash.rc' DEFINES['MOZ_PHOENIX'] = True -for cdm in CONFIG['MOZ_EME_MODULES']: - DEFINES['MOZ_%s_EME' % cdm.upper()] = True - # Control the default heap size. # This is the heap returned by GetProcessHeap(). # As we use the CRT heap, the default size is too large and wastes VM. diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index b721370a11..ebb9fccbd2 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -170,7 +170,7 @@ pref("lightweightThemes.update.enabled", true); pref("lightweightThemes.getMoreURL", "http://@AM_DOMAIN@/personas/"); pref("lightweightThemes.recommendedThemes", "[{\"id\":\"recommended-1\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/a-web-browser-renaissance/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.footer.jpg\",\"textcolor\":\"#000000\",\"accentcolor\":\"#f2d9b1\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/1.preview.jpg\",\"author\":\"Sean.Martell\",\"version\":\"0\"},{\"id\":\"recommended-2\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/space-fantasy/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.header.jpg\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.footer.jpg\",\"textcolor\":\"#ffffff\",\"accentcolor\":\"#d9d9d9\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/2.preview.jpg\",\"author\":\"fx5800p\",\"version\":\"1.0\"},{\"id\":\"recommended-3\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/linen-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.footer.png\",\"accentcolor\":\"#ada8a8\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/3.preview.png\",\"author\":\"DVemer\",\"version\":\"1.0\"},{\"id\":\"recommended-4\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/pastel-gradient/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.footer.png\",\"textcolor\":\"#000000\",\"accentcolor\":\"#000000\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.icon.png\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/4.preview.png\",\"author\":\"darrinhenein\",\"version\":\"1.0\"},{\"id\":\"recommended-5\",\"homepageURL\":\"https://addons.mozilla.org/firefox/addon/carbon-light/\",\"headerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.header.png\",\"footerURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.footer.png\",\"textcolor\":\"#3b3b3b\",\"accentcolor\":\"#2e2e2e\",\"iconURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.icon.jpg\",\"previewURL\":\"resource:///chrome/browser/content/browser/defaultthemes/5.preview.jpg\",\"author\":\"Jaxivo\",\"version\":\"1.0\"}]"); -#if defined(MOZ_ADOBE_EME) || defined(MOZ_WIDEVINE_EME) +#ifdef MOZ_EME pref("browser.eme.ui.enabled", true); #else pref("browser.eme.ui.enabled", false); @@ -1182,6 +1182,7 @@ pref("media.gmp.decoder.h264", 2); // decode H.264. pref("media.gmp.trial-create.enabled", true); +#ifdef MOZ_EME // Note: when media.gmp-*.visible is true, provided we're running on a // supported platform/OS version, the corresponding CDM appears in the // plugins list, Firefox will download the GMP/CDM if enabled, and our @@ -1190,16 +1191,13 @@ pref("media.gmp.trial-create.enabled", true); // to enable the CDM if its disabled; it's as if the keysystem is completely // unsupported. -#ifdef MOZ_ADOBE_EME pref("media.gmp-eme-adobe.visible", true); // When Adobe EME is enabled in the build system, we don't actually enable // the plugin by default, so that it doesn't download and install by default. // When Adobe EME is first used, Firefox will prompt the user to enable it, // and then download the CDM. pref("media.gmp-eme-adobe.enabled", false); -#endif -#ifdef MOZ_WIDEVINE_EME pref("media.gmp-widevinecdm.visible", true); pref("media.gmp-widevinecdm.enabled", true); #endif From bb4519ea4f905b80527cb621758be1b4225d6d1b Mon Sep 17 00:00:00 2001 From: "Matt A. Tobin" Date: Thu, 6 Feb 2020 14:03:23 -0500 Subject: [PATCH 6/6] [Basilisk] Issue MoonchildProductions/UXP#1390 - Remove application support for the Presentation API --- application/basilisk/app/profile/basilisk.js | 1 - .../basilisk/base/content/browser-context.inc | 5 - .../basilisk/base/content/browser-menubar.inc | 10 +- application/basilisk/base/content/browser.js | 31 ---- .../basilisk/base/content/nsContextMenu.js | 30 ---- .../basilisk/base/content/tab-content.js | 28 --- .../basilisk/components/nsBrowserGlue.js | 25 --- .../locales/en-US/chrome/browser/browser.dtd | 4 - application/basilisk/modules/CastingApps.jsm | 164 ------------------ application/basilisk/modules/moz.build | 1 - 10 files changed, 1 insertion(+), 298 deletions(-) delete mode 100644 application/basilisk/modules/CastingApps.jsm diff --git a/application/basilisk/app/profile/basilisk.js b/application/basilisk/app/profile/basilisk.js index ebb9fccbd2..60085d9f84 100644 --- a/application/basilisk/app/profile/basilisk.js +++ b/application/basilisk/app/profile/basilisk.js @@ -214,7 +214,6 @@ pref("browser.slowStartup.timeThreshold", 40000); pref("browser.slowStartup.maxSamples", 5); pref("browser.enable_automatic_image_resizing", true); -pref("browser.casting.enabled", false); pref("browser.chrome.site_icons", true); pref("browser.chrome.favicons", true); // browser.warnOnQuit == false will override all other possible prompts when quitting or restarting diff --git a/application/basilisk/base/content/browser-context.inc b/application/basilisk/base/content/browser-context.inc index d400cd0b21..61b20ac75f 100644 --- a/application/basilisk/base/content/browser-context.inc +++ b/application/basilisk/base/content/browser-context.inc @@ -226,11 +226,6 @@ label="&emailVideoCmd.label;" accesskey="&emailVideoCmd.accesskey;" oncommand="gContextMenu.sendMedia();"/> - - - + accesskey="&toolsMenu.accesskey;"> - { - let item = doc.createElement("menuitem"); - item.setAttribute("label", service.friendlyName); - item._service = service; - item.addEventListener("command", mirrorMenuItemClicked); - popup.appendChild(item); - }); -} - function getWebNavigation() { return gBrowser.webNavigation; diff --git a/application/basilisk/base/content/nsContextMenu.js b/application/basilisk/base/content/nsContextMenu.js index 370e5ba609..675b1e4310 100644 --- a/application/basilisk/base/content/nsContextMenu.js +++ b/application/basilisk/base/content/nsContextMenu.js @@ -199,21 +199,10 @@ nsContextMenu.prototype = { // Send media URL (but not for canvas, since it's a big data: URL) this.showItem("context-sendimage", this.onImage); this.showItem("context-sendvideo", this.onVideo); - this.showItem("context-castvideo", this.onVideo); this.showItem("context-sendaudio", this.onAudio); let mediaIsBlob = this.mediaURL.startsWith("blob:"); this.setItemAttr("context-sendvideo", "disabled", !this.mediaURL || mediaIsBlob); this.setItemAttr("context-sendaudio", "disabled", !this.mediaURL || mediaIsBlob); - let shouldShowCast = Services.prefs.getBoolPref("browser.casting.enabled"); - // getServicesForVideo alone would be sufficient here (it depends on - // SimpleServiceDiscovery.services), but SimpleServiceDiscovery is guaranteed - // to be already loaded, since we load it on startup in nsBrowserGlue, - // and CastingApps isn't, so check SimpleServiceDiscovery.services first - // to avoid needing to load CastingApps.jsm if we don't need to. - shouldShowCast = shouldShowCast && this.mediaURL && - SimpleServiceDiscovery.services.length > 0 && - CastingApps.getServicesForVideo(this.target).length > 0; - this.setItemAttr("context-castvideo", "disabled", !shouldShowCast); }, initViewItems: function CM_initViewItems() { @@ -1408,25 +1397,6 @@ nsContextMenu.prototype = { MailIntegration.sendMessage(this.mediaURL, ""); }, - castVideo: function() { - CastingApps.openExternal(this.target, window); - }, - - populateCastVideoMenu: function(popup) { - let videoEl = this.target; - popup.innerHTML = null; - let doc = popup.ownerDocument; - let services = CastingApps.getServicesForVideo(videoEl); - services.forEach(service => { - let item = doc.createElement("menuitem"); - item.setAttribute("label", service.friendlyName); - item.addEventListener("command", event => { - CastingApps.sendVideoToService(videoEl, service); - }); - popup.appendChild(item); - }); - }, - playPlugin: function() { gPluginHandler.contextMenuCommand(this.browser, this.target, "play"); }, diff --git a/application/basilisk/base/content/tab-content.js b/application/basilisk/base/content/tab-content.js index 7fbe40c2d6..f66f536fa0 100644 --- a/application/basilisk/base/content/tab-content.js +++ b/application/basilisk/base/content/tab-content.js @@ -25,21 +25,6 @@ XPCOMUtils.defineLazyModuleGetter(this, "ReaderMode", "resource://gre/modules/ReaderMode.jsm"); XPCOMUtils.defineLazyModuleGetter(this, "Readerable", "resource://gre/modules/Readerable.jsm"); -XPCOMUtils.defineLazyGetter(this, "SimpleServiceDiscovery", function() { - let ssdp = Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm", {}).SimpleServiceDiscovery; - // Register targets - ssdp.registerDevice({ - id: "roku:ecp", - target: "roku:ecp", - factory: function(aService) { - Cu.import("resource://gre/modules/RokuApp.jsm"); - return new RokuApp(aService); - }, - types: ["video/mp4"], - extensions: ["mp4"] - }); - return ssdp; -}); // TabChildGlobal var global = this; @@ -94,19 +79,6 @@ addMessageListener("MixedContent:ReenableProtection", function() { docShell.mixedContentChannel = null; }); -addMessageListener("SecondScreen:tab-mirror", function(message) { - if (!Services.prefs.getBoolPref("browser.casting.enabled")) { - return; - } - let app = SimpleServiceDiscovery.findAppForService(message.data.service); - if (app) { - let width = content.innerWidth; - let height = content.innerHeight; - let viewport = {cssWidth: width, cssHeight: height, width: width, height: height}; - app.mirror(function() {}, content, viewport, function() {}, content); - } -}); - var AboutHomeListener = { init: function(chromeGlobal) { chromeGlobal.addEventListener('AboutHomeLoad', this, false, true); diff --git a/application/basilisk/components/nsBrowserGlue.js b/application/basilisk/components/nsBrowserGlue.js index 5d3e4689bb..7e73bd9751 100644 --- a/application/basilisk/components/nsBrowserGlue.js +++ b/application/basilisk/components/nsBrowserGlue.js @@ -56,7 +56,6 @@ XPCOMUtils.defineLazyServiceGetter(this, "AlertsService", "@mozilla.org/alerts-s ["RemotePrompt", "resource:///modules/RemotePrompt.jsm"], ["SessionStore", "resource:///modules/sessionstore/SessionStore.jsm"], ["ShellService", "resource:///modules/ShellService.jsm"], - ["SimpleServiceDiscovery", "resource://gre/modules/SimpleServiceDiscovery.jsm"], ["TabCrashHandler", "resource:///modules/ContentCrashHandlers.jsm"], ["Task", "resource://gre/modules/Task.jsm"], ["URLBarZoom", "resource:///modules/URLBarZoom.jsm"], @@ -1017,32 +1016,8 @@ BrowserGlue.prototype = { } }, - _initServiceDiscovery: function () { - if (!Services.prefs.getBoolPref("browser.casting.enabled")) { - return; - } - var rokuDevice = { - id: "roku:ecp", - target: "roku:ecp", - factory: function(aService) { - Cu.import("resource://gre/modules/RokuApp.jsm"); - return new RokuApp(aService); - }, - types: ["video/mp4"], - extensions: ["mp4"] - }; - - // Register targets - SimpleServiceDiscovery.registerDevice(rokuDevice); - - // Search for devices continuously every 120 seconds - SimpleServiceDiscovery.search(120 * 1000); - }, - // All initial windows have opened. _onWindowsRestored: function BG__onWindowsRestored() { - this._initServiceDiscovery(); - // Show update notification, if needed. if (Services.prefs.prefHasUserValue("app.update.postupdate")) this._showUpdateNotification(); diff --git a/application/basilisk/locales/en-US/chrome/browser/browser.dtd b/application/basilisk/locales/en-US/chrome/browser/browser.dtd index fe856129f9..044fd303b7 100644 --- a/application/basilisk/locales/en-US/chrome/browser/browser.dtd +++ b/application/basilisk/locales/en-US/chrome/browser/browser.dtd @@ -94,8 +94,6 @@ when there are no windows but Firefox is still running. --> - - @@ -492,8 +490,6 @@ These should match what Safari and other Apple applications use on OS X Lion. -- - - diff --git a/application/basilisk/modules/CastingApps.jsm b/application/basilisk/modules/CastingApps.jsm deleted file mode 100644 index 6f32753e89..0000000000 --- a/application/basilisk/modules/CastingApps.jsm +++ /dev/null @@ -1,164 +0,0 @@ -// -*- Mode: js; tab-width: 2; indent-tabs-mode: nil; js2-basic-offset: 2; js2-skip-preprocessor-directives: t; -*- -/* This Source Code Form is subject to the terms of the Mozilla Public - * License, v. 2.0. If a copy of the MPL was not distributed with this file, - * You can obtain one at http://mozilla.org/MPL/2.0/. */ -"use strict"; -this.EXPORTED_SYMBOLS = ["CastingApps"]; - -const { classes: Cc, interfaces: Ci, utils: Cu } = Components; - -Cu.import("resource://gre/modules/Services.jsm"); -Cu.import("resource://gre/modules/SimpleServiceDiscovery.jsm"); - - -var CastingApps = { - _sendEventToVideo: function (element, data) { - let event = element.ownerDocument.createEvent("CustomEvent"); - event.initCustomEvent("media-videoCasting", false, true, JSON.stringify(data)); - element.dispatchEvent(event); - }, - - makeURI: function (url, charset, baseURI) { - return Services.io.newURI(url, charset, baseURI); - }, - - getVideo: function (element) { - if (!element) { - return null; - } - - let extensions = SimpleServiceDiscovery.getSupportedExtensions(); - let types = SimpleServiceDiscovery.getSupportedMimeTypes(); - - // Grab the poster attribute from the