From 19b4306973b74f024828b926db105cf8d749447f Mon Sep 17 00:00:00 2001 From: Malte Juergens Date: Thu, 21 Dec 2023 10:34:49 +0100 Subject: [PATCH] Potentially fix patches --- patches/fullpage-translations.patch | 57 ++++------------------ patches/ui-patches/firefox-view.patch | 69 +-------------------------- 2 files changed, 11 insertions(+), 115 deletions(-) diff --git a/patches/fullpage-translations.patch b/patches/fullpage-translations.patch index e642287..cd163c2 100644 --- a/patches/fullpage-translations.patch +++ b/patches/fullpage-translations.patch @@ -1,4 +1,3 @@ -diff --git a/services/settings/Attachments.sys.mjs b/services/settings/Attachments.sys.mjs --- a/services/settings/Attachments.sys.mjs +++ b/services/settings/Attachments.sys.mjs @@ -133,6 +133,7 @@ export class Downloader { @@ -73,10 +72,9 @@ diff --git a/services/settings/Attachments.sys.mjs b/services/settings/Attachmen } async _fetchAttachment(url) { -diff --git a/services/settings/RemoteSettingsClient.sys.mjs b/services/settings/RemoteSettingsClient.sys.mjs --- a/services/settings/RemoteSettingsClient.sys.mjs +++ b/services/settings/RemoteSettingsClient.sys.mjs -@@ -305,6 +305,7 @@ export class RemoteSettingsClient extend +@@ -305,6 +305,7 @@ export class RemoteSettingsClient extends EventEmitter { localFields = [], keepAttachmentsIds = [], lastCheckTimePref, @@ -84,7 +82,7 @@ diff --git a/services/settings/RemoteSettingsClient.sys.mjs b/services/settings/ } = {} ) { // Remote Settings cannot be used in child processes (no access to disk, -@@ -334,6 +335,7 @@ export class RemoteSettingsClient extend +@@ -334,6 +335,7 @@ export class RemoteSettingsClient extends EventEmitter { this._lastCheckTimePref = lastCheckTimePref; this._verifier = null; this._syncRunning = false; @@ -92,7 +90,7 @@ diff --git a/services/settings/RemoteSettingsClient.sys.mjs b/services/settings/ // This attribute allows signature verification to be disabled, when running tests // or when pulling data from a dev server. -@@ -375,9 +377,12 @@ export class RemoteSettingsClient extend +@@ -375,9 +377,12 @@ export class RemoteSettingsClient extends EventEmitter { } httpClient() { @@ -108,7 +106,7 @@ diff --git a/services/settings/RemoteSettingsClient.sys.mjs b/services/settings/ return api.bucket(this.bucketName).collection(this.collectionName); } -@@ -600,7 +605,7 @@ export class RemoteSettingsClient extend +@@ -604,7 +609,7 @@ export class RemoteSettingsClient extends EventEmitter { // We want to know which timestamp we are expected to obtain in order to leverage // cache busting. We don't provide ETag because we don't want a 304. const { changes } = await lazy.Utils.fetchLatestChanges( @@ -117,46 +115,9 @@ diff --git a/services/settings/RemoteSettingsClient.sys.mjs b/services/settings/ { filters: { collection: this.collectionName, -diff --git a/toolkit/components/translations/actors/TranslationsParent.sys.mjs b/toolkit/components/translations/actors/TranslationsParent.sys.mjs --- a/toolkit/components/translations/actors/TranslationsParent.sys.mjs +++ b/toolkit/components/translations/actors/TranslationsParent.sys.mjs -@@ -854,9 +854,8 @@ export class TranslationsParent extends - // Place the records into a promise to prevent any races. - TranslationsParent.#languageIdModelRecord = (async () => { - /** @type {LanguageIdModelRecord[]} */ -- let modelRecords = await TranslationsParent.getMaxVersionRecords( -- client -- ); -+ let modelRecords = -+ await TranslationsParent.getMaxVersionRecords(client); - - if (modelRecords.length === 0) { - throw new Error( -@@ -881,7 +880,10 @@ export class TranslationsParent extends - try { - /** @type {{buffer: ArrayBuffer}} */ - const { buffer } = await client.attachments.download( -- await TranslationsParent.#languageIdModelRecord -+ await TranslationsParent.#languageIdModelRecord, -+ { -+ serverUrl: "https://firefox.settings.services.mozilla.com/v1", -+ } - ); - - const duration = (Date.now() - now) / 1000; -@@ -968,7 +970,10 @@ export class TranslationsParent extends - - /** @type {{buffer: ArrayBuffer}} */ - const { buffer } = await client.attachments.download( -- await TranslationsParent.#languageIdWasmRecord -+ await TranslationsParent.#languageIdWasmRecord, -+ { -+ serverUrl: "https://firefox.settings.services.mozilla.com/v1", -+ } - ); - - const duration = (Date.now() - start) / 1000; -@@ -1147,7 +1152,9 @@ export class TranslationsParent extends +@@ -1143,7 +1143,9 @@ export class TranslationsParent extends JSWindowActorParent { } /** @type {RemoteSettingsClient} */ @@ -167,7 +128,7 @@ diff --git a/toolkit/components/translations/actors/TranslationsParent.sys.mjs b TranslationsParent.#translationModelsRemoteClient = client; client.on("sync", TranslationsParent.#handleTranslationsModelsSync); return client; -@@ -1456,7 +1463,10 @@ export class TranslationsParent extends +@@ -1489,7 +1491,10 @@ export class TranslationsParent extends JSWindowActorParent { /** @type {{buffer: ArrayBuffer}} */ const { buffer } = await client.attachments.download( @@ -179,7 +140,7 @@ diff --git a/toolkit/components/translations/actors/TranslationsParent.sys.mjs b ); const duration = Date.now() - start; -@@ -1507,7 +1517,9 @@ export class TranslationsParent extends +@@ -1540,7 +1545,9 @@ export class TranslationsParent extends JSWindowActorParent { )) { const download = () => { lazy.console.log("Downloading record", record.name, record.id); @@ -190,7 +151,7 @@ diff --git a/toolkit/components/translations/actors/TranslationsParent.sys.mjs b }; queue.push({ download }); } -@@ -1531,7 +1543,10 @@ export class TranslationsParent extends +@@ -1564,7 +1571,10 @@ export class TranslationsParent extends JSWindowActorParent { onFailure: () => { console.error("Failed to download", record.name); }, @@ -202,7 +163,7 @@ diff --git a/toolkit/components/translations/actors/TranslationsParent.sys.mjs b }); } -@@ -1700,7 +1715,9 @@ export class TranslationsParent extends +@@ -1727,7 +1737,9 @@ export class TranslationsParent extends JSWindowActorParent { await chaosMode(1 / 3); /** @type {{buffer: ArrayBuffer }} */ diff --git a/patches/ui-patches/firefox-view.patch b/patches/ui-patches/firefox-view.patch index f1871f2..e252f64 100644 --- a/patches/ui-patches/firefox-view.patch +++ b/patches/ui-patches/firefox-view.patch @@ -8,10 +8,9 @@ # This patch removes the Firefox View from the toolbar by default. Users can # enable it again by using the "Customize Toolbar" mode and dragging it back to # the titlebar. -diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js -@@ -9929,10 +9929,11 @@ var FirefoxViewHandler = { +@@ -9940,10 +9940,11 @@ var FirefoxViewHandler = { !this._enabled ); document.getElementById("menu_openFirefoxView").hidden = !this._enabled; @@ -27,7 +26,6 @@ diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js }, onWidgetRemoved(aWidgetId) { if (aWidgetId == this.BUTTON_ID && this.tab) { -diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/content/navigator-toolbox.inc.xhtml --- a/browser/base/content/navigator-toolbox.inc.xhtml +++ b/browser/base/content/navigator-toolbox.inc.xhtml @@ -35,16 +35,6 @@ @@ -47,7 +45,7 @@ diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/con @@ -63,7 +61,6 @@ diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/con + removable="true"/> -diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs --- a/browser/components/customizableui/CustomizableUI.sys.mjs +++ b/browser/components/customizableui/CustomizableUI.sys.mjs @@ -287,7 +287,6 @@ var CustomizableUIInternal = { @@ -93,7 +90,6 @@ diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/ // Unified Extensions addon button migration, which puts any browser action // buttons in the overflow menu into the addons panel instead. if (currentVersion < 19) { -diff --git a/browser/components/firefoxview/firefoxview.html b/browser/components/firefoxview/firefoxview.html --- a/browser/components/firefoxview/firefoxview.html +++ b/browser/components/firefoxview/firefoxview.html @@ -61,6 +61,7 @@ @@ -104,64 +100,3 @@ diff --git a/browser/components/firefoxview/firefoxview.html b/browser/component > [ - trigger: { id: "protectionsPanelOpen" }, - }, - { -- id: "CFR_FIREFOX_VIEW", -- groups: ["cfr"], -- template: "cfr_doorhanger", -- //If Firefox View button has been moved to the overflow menu, we want to change the anchor element -- content: { -- bucket_id: "CFR_FIREFOX_VIEW", -- anchor_id: "firefox-view-button", -- alt_anchor_id: "nav-bar-overflow-button", -- layout: "icon_and_message", -- icon: "chrome://browser/content/cfr-lightning.svg", -- icon_dark_theme: "chrome://browser/content/cfr-lightning-dark.svg", -- icon_class: "cfr-doorhanger-small-icon", -- heading_text: { -- string_id: "firefoxview-cfr-header-v2", -- }, -- text: { -- string_id: "firefoxview-cfr-body-v2", -- }, -- buttons: { -- primary: { -- label: { -- string_id: "firefoxview-cfr-primarybutton", -- }, -- action: { -- type: "OPEN_FIREFOX_VIEW", -- navigate: true, -- }, -- }, -- secondary: [ -- { -- label: { -- string_id: "firefoxview-cfr-secondarybutton", -- }, -- action: { -- type: "CANCEL", -- }, -- }, -- ], -- }, -- skip_address_bar_notifier: true, -- }, -- frequency: { -- lifetime: 1, -- }, -- trigger: { -- id: "nthTabClosed", -- }, -- // Avoid breaking existing tests that close tabs for now. -- targeting: `!inMr2022Holdback && fxViewButtonAreaType != null && (currentDate|date - profileAgeCreated) / 86400000 >= 2 && tabsClosedCount >= 3 && 'browser.firefox-view.view-count'|preferenceValue == 0 && !'browser.newtabpage.activity-stream.asrouter.providers.cfr'|preferenceIsUserSet`, -- }, -- { - id: "FX_MR_106_UPGRADE", - template: "spotlight", - targeting: "true",