From 53e2e5d8d6c6f550756ca2a9da9d7ce2d9c6482f Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Mon, 27 Feb 2023 09:48:31 +0800 Subject: [PATCH 01/11] Issue #1375 - Part 1: Allow moving a reference into nsInterfaceHashtable --- xpcom/glue/nsInterfaceHashtable.h | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/xpcom/glue/nsInterfaceHashtable.h b/xpcom/glue/nsInterfaceHashtable.h index 54a5b79cd6..cdd36924ec 100644 --- a/xpcom/glue/nsInterfaceHashtable.h +++ b/xpcom/glue/nsInterfaceHashtable.h @@ -52,6 +52,21 @@ public: * @return The entry, or nullptr if not found. Do not release this pointer! */ Interface* GetWeak(KeyType aKey, bool* aFound = nullptr) const; + + /** + * Allows inserting a value into the hashtable, moving its owning reference + * count into the hashtable, avoiding an AddRef. + */ + void Put(KeyType aKey, already_AddRefed&& aData) + { + if (!Put(aKey, mozilla::Move(aData), mozilla::fallible)) { + NS_ABORT_OOM(this->mTable.EntrySize() * this->mTable.EntryCount()); + } + } + + MOZ_MUST_USE bool Put(KeyType aKey, already_AddRefed&& aData, + const mozilla::fallible_t&); + using base_type::Put; }; template @@ -138,4 +153,19 @@ nsInterfaceHashtable::GetWeak(KeyType aKey, return nullptr; } +template +bool +nsInterfaceHashtable::Put(KeyType aKey, + already_AddRefed&& aValue, + const mozilla::fallible_t&) +{ + typename base_type::EntryType* ent = this->PutEntry(aKey); + if (!ent) { + return false; + } + + ent->mData = aValue; + return true; +} + #endif // nsInterfaceHashtable_h__ From 6781f5b6c52b5e0f6e3b5b603411cdbf964ec11c Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Mon, 27 Feb 2023 10:02:44 +0800 Subject: [PATCH 02/11] Issue #1375 - Part 2: customElements.define must upgrade custom element in shadow-including tree order Based on https://bugzilla.mozilla.org/show_bug.cgi?id=1326028 --- dom/base/CustomElementRegistry.cpp | 98 +++++++++++++++++++++++++++--- 1 file changed, 91 insertions(+), 7 deletions(-) diff --git a/dom/base/CustomElementRegistry.cpp b/dom/base/CustomElementRegistry.cpp index b97115e7c4..fdf90401ed 100644 --- a/dom/base/CustomElementRegistry.cpp +++ b/dom/base/CustomElementRegistry.cpp @@ -416,6 +416,95 @@ CustomElementRegistry::EnqueueLifecycleCallback(nsIDocument::ElementCallbackType reactionsStack->EnqueueCallbackReaction(aCustomElement, Move(callback)); } +namespace { + +class CandidateFinder +{ +public: + CandidateFinder(nsTArray&& aCandidates, nsIDocument* aDoc); + nsTArray> OrderedCandidates(); + +private: + bool Traverse(Element* aRoot, nsTArray>& aOrderedElements); + + nsCOMPtr mDoc; + nsInterfaceHashtable, Element> mCandidates; +}; + +CandidateFinder::CandidateFinder(nsTArray&& aCandidates, + nsIDocument* aDoc) + : mDoc(aDoc) + , mCandidates(aCandidates.Length()) +{ + MOZ_ASSERT(mDoc); + for (auto& candidate : aCandidates) { + nsCOMPtr elem = do_QueryReferent(candidate); + if (!elem) { + continue; + } + + Element* key = elem.get(); + mCandidates.Put(key, elem.forget()); + } +} + +nsTArray> +CandidateFinder::OrderedCandidates() +{ + if (mCandidates.Count() == 1) { + // Fast path for one candidate. + for (auto iter = mCandidates.Iter(); !iter.Done(); iter.Next()) { + nsTArray> rval({ Move(iter.Data()) }); + iter.Remove(); + return rval; + } + } + + nsTArray> orderedElements(mCandidates.Count()); + for (Element* child = mDoc->GetFirstElementChild(); child; child = child->GetNextElementSibling()) { + if (!Traverse(child->AsElement(), orderedElements)) { + break; + } + } + + return orderedElements; +} + +bool +CandidateFinder::Traverse(Element* aRoot, nsTArray>& aOrderedElements) +{ + nsCOMPtr elem = mCandidates.Get(aRoot); + if (elem) { + mCandidates.Remove(aRoot); + aOrderedElements.AppendElement(Move(elem)); + if (mCandidates.Count() == 0) { + return false; + } + } + + if (ShadowRoot* root = aRoot->GetShadowRoot()) { + // First iterate the children of the shadow root if aRoot is a shadow host. + for (Element* child = root->GetFirstElementChild(); child; + child = child->GetNextElementSibling()) { + if (!Traverse(child, aOrderedElements)) { + return false; + } + } + } + + // Iterate the explicit children of aRoot. + for (Element* child = aRoot->GetFirstElementChild(); child; + child = child->GetNextElementSibling()) { + if (!Traverse(child, aOrderedElements)) { + return false; + } + } + + return true; +} + +} + void CustomElementRegistry::UpgradeCandidates(nsIAtom* aKey, CustomElementDefinition* aDefinition, @@ -427,18 +516,13 @@ CustomElementRegistry::UpgradeCandidates(nsIAtom* aKey, return; } - // TODO: Bug 1326028 - Upgrade custom element in shadow-including tree order nsAutoPtr> candidates; mCandidatesMap.RemoveAndForget(aKey, candidates); if (candidates) { CustomElementReactionsStack* reactionsStack = docGroup->CustomElementReactionsStack(); - for (size_t i = 0; i < candidates->Length(); ++i) { - nsCOMPtr elem = do_QueryReferent(candidates->ElementAt(i)); - if (!elem) { - continue; - } - + CandidateFinder finder(Move(*candidates), mWindow->GetExtantDoc()); + for (auto& elem : finder.OrderedCandidates()) { reactionsStack->EnqueueUpgradeReaction(elem, aDefinition); } } From 52dbe973359375881fb66008127eaeba21f58236 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 1 Mar 2023 23:49:34 +0100 Subject: [PATCH 03/11] Issue #1361 - Enable WebComponents' getRootNode by default. Since we're enabling WebComponents, we should enable this too. TODO: merge the two relevant prefs. --- modules/libpref/init/all.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/libpref/init/all.js b/modules/libpref/init/all.js index 41233f63c4..9478c92bd8 100644 --- a/modules/libpref/init/all.js +++ b/modules/libpref/init/all.js @@ -1239,8 +1239,11 @@ pref("privacy.trackingprotection.pbmode.enabled", false); pref("dom.event.contextmenu.enabled", true); pref("dom.event.clipboardevents.enabled", true); +// TODO: merge these two prefs! // Enable Google WebComponents? pref("dom.webcomponents.enabled", true); +// Whether WC getRootNode is available +pref("dom.getRootNode.enabled", true); pref("javascript.enabled", true); // Enable Array.prototype.values @@ -4606,9 +4609,6 @@ pref("dom.push.http2.reset_retry_count_after_ms", 60000); pref("dom.push.http2.maxRetries", 2); pref("dom.push.http2.retryInterval", 5000); -// Whether WC getRootNode is available -pref("dom.getRootNode.enabled", false); - // WebNetworkStats pref("dom.mozNetworkStats.enabled", false); From 21f0c3de63ffa8a97f526d45363659641f5fc6a7 Mon Sep 17 00:00:00 2001 From: FranklinDM Date: Sun, 5 Feb 2023 19:20:02 +0800 Subject: [PATCH 04/11] [Pale-Moon] Issue #1908 - Fade tab titles instead of using ellipses --- application/palemoon/app/profile/palemoon.js | 4 ++++ application/palemoon/base/content/browser.css | 10 +++++++++ .../palemoon/base/content/tabbrowser.xml | 22 ++++++++++++++++--- .../components/sessionstore/SessionStore.jsm | 3 +++ 4 files changed, 36 insertions(+), 3 deletions(-) diff --git a/application/palemoon/app/profile/palemoon.js b/application/palemoon/app/profile/palemoon.js index bde0a28dff..45f0e9925f 100644 --- a/application/palemoon/app/profile/palemoon.js +++ b/application/palemoon/app/profile/palemoon.js @@ -473,6 +473,10 @@ pref("browser.tabs.delayHidingAudioPlayingIconMS", 3000); // window is enabled. pref("browser.tabs.allowTabDetach", true); +// Whether to fade tab labels instead of using ellipses when cutting off +// long page titles. +pref("browser.tabs.fadeLabels", true); + pref("browser.allTabs.previews", true); pref("browser.allTabs.hidePinnedTabs", false); pref("browser.ctrlTab.previews", true); diff --git a/application/palemoon/base/content/browser.css b/application/palemoon/base/content/browser.css index af15a0e55f..9051d31f1b 100644 --- a/application/palemoon/base/content/browser.css +++ b/application/palemoon/base/content/browser.css @@ -82,6 +82,16 @@ tabbrowser { transition: transform 200ms ease-out; } +@supports -moz-bool-pref("browser.tabs.fadeLabels") { + .tabbrowser-tab .tab-text[_is_cropped] { + mask-image: linear-gradient(to left, transparent, black 2em); + } + + .tabbrowser-tab .tab-text[_is_cropped]:-moz-locale-dir(rtl) { + mask-image: linear-gradient(to right, transparent, black 2em); + } +} + #alltabs-popup { -moz-binding: url("chrome://browser/content/tabbrowser.xml#tabbrowser-alltabs-popup"); } diff --git a/application/palemoon/base/content/tabbrowser.xml b/application/palemoon/base/content/tabbrowser.xml index f57ea14ab9..6bc5a33ce9 100644 --- a/application/palemoon/base/content/tabbrowser.xml +++ b/application/palemoon/base/content/tabbrowser.xml @@ -1258,7 +1258,11 @@ @@ -1298,6 +1302,10 @@ title = this.mStringBundle.getString("tabs.emptyTabTitle"); } + if (Services.prefs.getBoolPref("browser.tabs.fadeLabels")) { + crop = "clip"; + } + if (aTab.label == title && aTab.crop == crop) return false; @@ -1521,7 +1529,11 @@ else t.setAttribute("label", aURI); - t.setAttribute("crop", "end"); + if (Services.prefs.getBoolPref("browser.tabs.fadeLabels")) { + t.setAttribute("crop", "clip"); + } else { + t.setAttribute("crop", "end"); + } t.setAttribute("validate", "never"); //PMed t.setAttribute("onerror", "this.removeAttribute('image');"); @@ -3602,7 +3614,11 @@ var tab = this.firstChild; tab.setAttribute("label", this.tabbrowser.mStringBundle.getString("tabs.emptyTabTitle")); - tab.setAttribute("crop", "end"); + if (Services.prefs.getBoolPref("browser.tabs.fadeLabels")) { + tab.setAttribute("crop", "clip"); + } else { + tab.setAttribute("crop", "end"); + } tab.setAttribute("onerror", "this.removeAttribute('image');"); this.adjustTabstrip(); diff --git a/application/palemoon/components/sessionstore/SessionStore.jsm b/application/palemoon/components/sessionstore/SessionStore.jsm index 084af92240..3609037d93 100644 --- a/application/palemoon/components/sessionstore/SessionStore.jsm +++ b/application/palemoon/components/sessionstore/SessionStore.jsm @@ -3045,6 +3045,9 @@ var SessionStoreInternal = { tab.label = activePageData.url; tab.crop = "center"; } + if (this._prefBranch.getBoolPref("tabs.fadeLabels")) { + tab.crop = "clip"; + } } } From 021d76f3ab89e00c46573a60de59143d480e2dc1 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 15 Feb 2023 18:48:22 +0100 Subject: [PATCH 05/11] [Pale-Moon] Remove DailyMotion override (apparently no longer needed) See https://forum.palemoon.org/viewtopic.php?f=3&t=29468&p=236759#p236754 --- application/palemoon/branding/shared/pref/uaoverrides.inc | 2 -- 1 file changed, 2 deletions(-) diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index aa2cdc56da..076a03368a 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -41,8 +41,6 @@ pref("@GUAO_PREF@.calendar.yahoo.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) pref("@GUAO_PREF@.www.amazon.com","Mozilla/5.0 (%OS_SLICE% rv:45.9) @GK_SLICE@ Firefox/45.9 (Pale Moon)"); // Soundcloud uses Firefox-exclusive combinations of code. Never pass Firefox slice. pref("@GUAO_PREF@.soundcloud.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @PM_SLICE@"); -// Daily motion only likes strict Firefox UAs -pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (%OS_SLICE% rv:52.0) @GK_SLICE@ Firefox/52.0"); pref("@GUAO_PREF@.players.brightcove.net","Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko"); // Google fonts serves physically different fonts to later Firefox versions that render incorrectly unless on Gecko pref("@GUAO_PREF@.fonts.googleapis.com", "Mozilla/5.0 (%OS_SLICE% rv:61.9) Gecko/20100101 Firefox/61.9"); From 889dfd8820e04f91f8566c556c0f0097ed6f13b3 Mon Sep 17 00:00:00 2001 From: Moonchild Date: Wed, 1 Mar 2023 10:07:36 +0100 Subject: [PATCH 06/11] [Pale-Moon] Update SSUAOs for known sites no longer needing workarounds. --- .../palemoon/branding/shared/pref/uaoverrides.inc | 12 ++++-------- 1 file changed, 4 insertions(+), 8 deletions(-) diff --git a/application/palemoon/branding/shared/pref/uaoverrides.inc b/application/palemoon/branding/shared/pref/uaoverrides.inc index 076a03368a..ae541965e7 100644 --- a/application/palemoon/branding/shared/pref/uaoverrides.inc +++ b/application/palemoon/branding/shared/pref/uaoverrides.inc @@ -4,7 +4,7 @@ #define GRE_VERSION @MOZILLA_UAVERSION_U@ #define GRE_VERSION_SLICE Goanna/@GRE_VERSION@ -#define GRE_DATE_SLICE Goanna/20170101 +#define GRE_DATE_SLICE Goanna/20230101 #define PM_SLICE PaleMoon/@MOZ_APP_VERSION@ #define GK_VERSION @MOZILLA_COMPATVERSION_U@ @@ -23,9 +23,6 @@ pref("@GUAO_PREF@.aol.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ pref("@GUAO_PREF@.bing.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)"); pref("@GUAO_PREF@.chase.com","Mozilla/5.0 (%OS_SLICE% rv:79.0) @GK_SLICE@ Firefox/79.0"); pref("@GUAO_PREF@.dropbox.com","Mozilla/5.0 (%OS_SLICE% rv:68.9) @GK_SLICE@ Firefox/68.9 (Pale Moon)"); -pref("@GUAO_PREF@.google.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0 @PM_SLICE@"); -pref("@GUAO_PREF@.googlevideos.com","Mozilla/5.0 (%OS_SLICE% rv:38.9) @GK_SLICE@ @GRE_VERSION_SLICE@ Firefox/38.9 @PM_SLICE@"); -pref("@GUAO_PREF@.gstatic.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0 @PM_SLICE@"); pref("@GUAO_PREF@.kroger.com","Mozilla/5.0 (%OS_SLICE% rv:86.0) @GK_SLICE@ Firefox/86.0 (Pale Moon)"); pref("@GUAO_PREF@.live.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)"); pref("@GUAO_PREF@.msn.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Pale Moon)"); @@ -65,13 +62,12 @@ pref("@GUAO_PREF@.citi.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox pref("@GUAO_PREF@.facebook.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ Firefox/68.0 @PM_SLICE@"); pref("@GUAO_PREF@.netflix.com","Mozilla/5.0 (Windows NT 6.1; rv:45.9) @GK_SLICE@ Firefox/45.9"); pref("@GUAO_PREF@.netflximg.net","Mozilla/5.0 (Windows NT 6.1; rv:45.9) @GK_SLICE@ Firefox/45.9"); -pref("@GUAO_PREF@.mewe.com", "Mozilla/5.0 (%OS_SLICE% rv:102.0) Gecko/20100101 Firefox/102.0"); +pref("@GUAO_PREF@.mewe.com", "Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); // UA-sniffing domains that are "app/vendor-specific" and do not like Pale Moon pref("@GUAO_PREF@.web.whatsapp.com","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"); -pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:60.0) @GK_SLICE@ Firefox/60.0"); -pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ @GRE_VERSION_SLICE@ Firefox/68.0 @PM_SLICE@"); -pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0"); +pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); +pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @GRE_VERSION_SLICE@ @FX_SLICE@ @PM_SLICE@"); // The following domains do not like the Goanna slice pref("@GUAO_PREF@.hitbox.tv","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@"); From cf80fbdb759baa1d28a86de9b33c8323bf652cec Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Tue, 11 Oct 2022 18:19:36 -0400 Subject: [PATCH 07/11] [Basilisk] SSUAO - Use native mode for Zoho --- application/basilisk/branding/shared/uaoverrides.inc | 1 + 1 file changed, 1 insertion(+) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index 4fbba14fa1..69b67baf00 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -56,6 +56,7 @@ pref("@GUAO_PREF@.mozilla.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_D pref("@GUAO_PREF@.github.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); pref("@GUAO_PREF@.spotify.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); pref("@GUAO_PREF@.twitter.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.zoho.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); // UA-Sniffing domains below have indicated no interest in supporting Basilisk (BOO!) pref("@GUAO_PREF@.humblebundle.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Basilisk)"); From b7aac7342e89a67814970ffdae113c60c9a4d000 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Wed, 26 Oct 2022 12:26:03 -0400 Subject: [PATCH 08/11] [Basilisk] SSUAO - Add pale moon addons slice --- .../basilisk/branding/shared/uaoverrides.inc | 41 +++++++++++-------- 1 file changed, 23 insertions(+), 18 deletions(-) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index 69b67baf00..bffd5ef489 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -1,20 +1,23 @@ #define GUAO_PREF general.useragent.override -#define GRE_VERSION @MOZILLA_UAVERSION_U@ -#define GRE_VERSION_SLICE Goanna/@GRE_VERSION@ -#define GRE_DATE_SLICE Goanna/20170101 +#define UXP_VERSION @MOZILLA_UAVERSION_U@ +#define UXP_VERSION_SLICE Goanna/@UXP_VERSION@ +#define UXP_DATE_SLICE Goanna/20170101 #define APP_SLICE Basilisk/@MOZ_APP_VERSION@ #define GK_VERSION 52.9 #define GK_SLICE Gecko/20100101 #define FX_SLICE Firefox/@GK_VERSION@ +#define PALE_MOON_VERSION 31.3.0.1 +#define PALE_MOON_SLICE PaleMoon/@PALE_MOON_VERSION@ + // %OS_SLICE% macro is resolved at runtime, see MoonchildProductions/UXP/issues/1473 // Special-case AMO // We send the native UA slice now, since they no longer offer any compatible extensions for us. // This will result in an "only with Firefox" message which suits us fine, because it's the truth. -pref("@GUAO_PREF@.addons.mozilla.org","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.addons.mozilla.org","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); // Required for domains that are unresponsive to requests from users (or likely to be) pref("@GUAO_PREF@.aol.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Basilisk)"); @@ -22,7 +25,7 @@ pref("@GUAO_PREF@.bing.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ pref("@GUAO_PREF@.chase.com","Mozilla/5.0 (%OS_SLICE% rv:79.0) @GK_SLICE@ Firefox/79.0"); pref("@GUAO_PREF@.dropbox.com","Mozilla/5.0 (%OS_SLICE% rv:68.9) @GK_SLICE@ Firefox/68.9 (Basilisk)"); pref("@GUAO_PREF@.google.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0 @APP_SLICE@"); -pref("@GUAO_PREF@.googlevideos.com","Mozilla/5.0 (%OS_SLICE% rv:38.9) @GK_SLICE@ @GRE_VERSION_SLICE@ Firefox/38.9 @APP_SLICE@"); +pref("@GUAO_PREF@.googlevideos.com","Mozilla/5.0 (%OS_SLICE% rv:38.9) @GK_SLICE@ @UXP_VERSION_SLICE@ Firefox/38.9 @APP_SLICE@"); pref("@GUAO_PREF@.gstatic.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0 @APP_SLICE@"); pref("@GUAO_PREF@.kroger.com","Mozilla/5.0 (%OS_SLICE% rv:86.0) @GK_SLICE@ Firefox/86.0 (Basilisk)"); pref("@GUAO_PREF@.live.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Basilisk)"); @@ -38,7 +41,7 @@ pref("@GUAO_PREF@.calendar.yahoo.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) // For Amazon Prime videos pref("@GUAO_PREF@.www.amazon.com","Mozilla/5.0 (%OS_SLICE% rv:45.9) @GK_SLICE@ Firefox/45.9 (Basilisk)"); // Soundcloud uses Firefox-exclusive combinations of code. Never pass Firefox slice. -pref("@GUAO_PREF@.soundcloud.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.soundcloud.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); // Daily motion only likes strict Firefox UAs pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (%OS_SLICE% rv:52.0) @GK_SLICE@ Firefox/52.0"); pref("@GUAO_PREF@.players.brightcove.net","Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko"); @@ -46,17 +49,17 @@ pref("@GUAO_PREF@.players.brightcove.net","Mozilla/5.0 (Windows NT 6.1; Trident/ pref("@GUAO_PREF@.fonts.googleapis.com", "Mozilla/5.0 (%OS_SLICE% rv:61.9) Gecko/20100101 Firefox/61.9"); // The following requires native mode. Or it blocks.. "too old firefox", breakage, etc. -pref("@GUAO_PREF@.deviantart.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.deviantart.net","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.altibox.dk","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.altibox.no","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.firefox.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.mozilla.org","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.mozilla.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.github.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.spotify.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.twitter.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); -pref("@GUAO_PREF@.zoho.com","Mozilla/5.0 (%OS_SLICE% rv:@GRE_VERSION@) @GRE_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.deviantart.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.deviantart.net","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.altibox.dk","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.altibox.no","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.firefox.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.mozilla.org","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.mozilla.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.github.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.spotify.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.twitter.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); +pref("@GUAO_PREF@.zoho.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); // UA-Sniffing domains below have indicated no interest in supporting Basilisk (BOO!) pref("@GUAO_PREF@.humblebundle.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @FX_SLICE@ (Basilisk)"); @@ -70,7 +73,7 @@ pref("@GUAO_PREF@.mewe.com", "Mozilla/5.0 (%OS_SLICE% rv:102.0) Gecko/20100101 F // UA-sniffing domains that are "app/vendor-specific" and do not like Basilisk pref("@GUAO_PREF@.web.whatsapp.com","Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/70.0.3538.77 Safari/537.36"); pref("@GUAO_PREF@.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:60.0) @GK_SLICE@ Firefox/60.0"); -pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ @GRE_VERSION_SLICE@ Firefox/68.0 @APP_SLICE@"); +pref("@GUAO_PREF@.studio.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:68.0) @GK_SLICE@ @UXP_VERSION_SLICE@ Firefox/68.0 @APP_SLICE@"); pref("@GUAO_PREF@.gaming.youtube.com","Mozilla/5.0 (%OS_SLICE% rv:71.0) @GK_SLICE@ Firefox/71.0"); // The following domains do not like the Goanna slice @@ -79,5 +82,7 @@ pref("@GUAO_PREF@.yuku.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ // Domains Basilisk overrides that are not in the Pale Moon overrides pref("@GUAO_PREF@.slack.com","Mozilla/5.0 (%OS_SLICE% rv:100.0) @GK_SLICE@ Firefox/100.0 @APP_SLICE@"); +// There are multiple addons on the Pale Moon addons site that work with Basilisk that are not listed on the Basilisk addons site. +pref("@GUAO_PREF@.addons.palemoon.org","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) @GK_SLICE@ @UXP_VERSION_SLICE@ @FX_SLICE@ @PALE_MOON_SLICE@"); // ============================================================================ From 42c8c7ff15e10f93c2bfb286f6216d15319070c2 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Tue, 20 Dec 2022 21:09:57 -0500 Subject: [PATCH 09/11] [Basilisk] Bundle fonts on GTK platforms, not just Linux This is a port of MoonchildProductions/Pale-Moon commit 4f7ad641ab --- application/basilisk/confvars.sh | 5 +++-- application/basilisk/installer/package-manifest.in | 2 +- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/application/basilisk/confvars.sh b/application/basilisk/confvars.sh index 6f980c3674..7175957f73 100644 --- a/application/basilisk/confvars.sh +++ b/application/basilisk/confvars.sh @@ -10,8 +10,9 @@ MOZ_AUSTRALIS=1 MC_BASILISK=1 MOZ_UPDATER= -if test "$OS_ARCH" = "WINNT" -o \ - "$OS_ARCH" = "Linux"; then +if test "$MOZ_WIDGET_TOOLKIT" = "windows" -o \ + "$MOZ_WIDGET_TOOLKIT" = "gtk2" -o \ + "$MOZ_WIDGET_TOOLKIT" = "gtk3"; then MOZ_BUNDLED_FONTS=1 fi diff --git a/application/basilisk/installer/package-manifest.in b/application/basilisk/installer/package-manifest.in index 44b23f962e..c650e16954 100644 --- a/application/basilisk/installer/package-manifest.in +++ b/application/basilisk/installer/package-manifest.in @@ -50,7 +50,7 @@ @RESPATH@/chrome/@AB_CD@@JAREXT@ @RESPATH@/chrome/@AB_CD@.manifest @RESPATH@/dictionaries/* -#if defined(XP_WIN) || defined(XP_LINUX) +#if defined(XP_WIN) || defined(MOZ_WIDGET_GTK) @RESPATH@/fonts/* #endif @RESPATH@/hyphenation/* From 3c54aa7ebf3eadce49bc553c3202e01574f382bb Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Tue, 21 Feb 2023 17:15:15 -0500 Subject: [PATCH 10/11] [Basilisk] Remove dailymotion override Port of MoonchildProductions/Pale-Moon commit 7e5819dcbb --- application/basilisk/branding/shared/uaoverrides.inc | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/application/basilisk/branding/shared/uaoverrides.inc b/application/basilisk/branding/shared/uaoverrides.inc index bffd5ef489..d0cb13b923 100644 --- a/application/basilisk/branding/shared/uaoverrides.inc +++ b/application/basilisk/branding/shared/uaoverrides.inc @@ -9,7 +9,7 @@ #define GK_SLICE Gecko/20100101 #define FX_SLICE Firefox/@GK_VERSION@ -#define PALE_MOON_VERSION 31.3.0.1 +#define PALE_MOON_VERSION 32.0.1 #define PALE_MOON_SLICE PaleMoon/@PALE_MOON_VERSION@ // %OS_SLICE% macro is resolved at runtime, see MoonchildProductions/UXP/issues/1473 @@ -42,8 +42,6 @@ pref("@GUAO_PREF@.calendar.yahoo.com","Mozilla/5.0 (%OS_SLICE% rv:@GK_VERSION@) pref("@GUAO_PREF@.www.amazon.com","Mozilla/5.0 (%OS_SLICE% rv:45.9) @GK_SLICE@ Firefox/45.9 (Basilisk)"); // Soundcloud uses Firefox-exclusive combinations of code. Never pass Firefox slice. pref("@GUAO_PREF@.soundcloud.com","Mozilla/5.0 (%OS_SLICE% rv:@UXP_VERSION@) @UXP_DATE_SLICE@ @APP_SLICE@"); -// Daily motion only likes strict Firefox UAs -pref("@GUAO_PREF@.dailymotion.com","Mozilla/5.0 (%OS_SLICE% rv:52.0) @GK_SLICE@ Firefox/52.0"); pref("@GUAO_PREF@.players.brightcove.net","Mozilla/5.0 (Windows NT 6.1; Trident/7.0; rv:11.0) like Gecko"); // Google fonts serves physically different fonts to later Firefox versions that render incorrectly unless on Gecko pref("@GUAO_PREF@.fonts.googleapis.com", "Mozilla/5.0 (%OS_SLICE% rv:61.9) Gecko/20100101 Firefox/61.9"); From 89dd425fd22a6cbbbbef2d2b47e2a4bc9fc14fc3 Mon Sep 17 00:00:00 2001 From: Basilisk-Dev Date: Tue, 21 Feb 2023 17:26:36 -0500 Subject: [PATCH 11/11] [Basilisk] Fade out tab label on overflow instead of ellipsis This is a port of Mozilla bug 658467. See also MoonchildProductions/Pale-Moon#1908 See also https://forum.palemoon.org/viewtopic.php?f=5&t=29423 --- .../basilisk/base/content/tabbrowser.css | 22 +++++++++--- .../basilisk/base/content/tabbrowser.xml | 36 ++++++++++--------- application/basilisk/themes/osx/browser.css | 5 +-- .../basilisk/themes/shared/tabs.inc.css | 2 +- 4 files changed, 40 insertions(+), 25 deletions(-) diff --git a/application/basilisk/base/content/tabbrowser.css b/application/basilisk/base/content/tabbrowser.css index 9085304f6c..2d9b7dd903 100644 --- a/application/basilisk/base/content/tabbrowser.css +++ b/application/basilisk/base/content/tabbrowser.css @@ -39,12 +39,24 @@ display: -moz-box; } -.tab-label[pinned] { +.tab-label { + white-space: nowrap; +} + +.tab-label-container { + overflow: hidden; +} + +.tab-label-container[pinned] { width: 0; - margin-left: 0 !important; - margin-right: 0 !important; - padding-left: 0 !important; - padding-right: 0 !important; +} + +.tab-label-container[textoverflow]:not([pinned]) { + mask-image: linear-gradient(to left, transparent, black 1em); +} + +.tab-label-container[textoverflow]:not([pinned]):-moz-locale-dir(rtl) { + mask-image: linear-gradient(to right, transparent, black 1em); } .tab-stack { diff --git a/application/basilisk/base/content/tabbrowser.xml b/application/basilisk/base/content/tabbrowser.xml index fec7c9ecca..bce2c06d8f 100644 --- a/application/basilisk/base/content/tabbrowser.xml +++ b/application/basilisk/base/content/tabbrowser.xml @@ -1397,8 +1397,7 @@ @@ -1408,7 +1407,6 @@ - + + + .toolbarbutton-menu-dropmarker { .tab-label { margin-top: 1px; margin-bottom: 0; + -moz-box-flex: 1; text-align: center; } @@ -2503,7 +2504,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker { opacity: 0.9999; } -.tab-label:not([selected="true"]) { +.tab-label-container:not([selected="true"]) { opacity: .7; } @@ -2529,7 +2530,7 @@ toolbarbutton.chevron > .toolbarbutton-menu-dropmarker { border-width: 0 11px; } -.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label:not([pinned]), +.tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-label-container:not([pinned]), .tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-icon-image[pinned], .tabbrowser-tab:focus > .tab-stack > .tab-content > .tab-throbber[pinned] { box-shadow: @focusRingShadow@; diff --git a/application/basilisk/themes/shared/tabs.inc.css b/application/basilisk/themes/shared/tabs.inc.css index c505416e46..a69e9f4d58 100644 --- a/application/basilisk/themes/shared/tabs.inc.css +++ b/application/basilisk/themes/shared/tabs.inc.css @@ -192,7 +192,7 @@ } .tab-close-button { - margin-inline-start: 4px; + margin-inline-start: 2px; margin-inline-end: -2px; padding: 0; }