From 55966bbd93febdc8915ddc329a98113664a56290 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Malte=20J=C3=BCrgens?= Date: Sun, 2 Jan 2022 12:13:35 +0100 Subject: [PATCH 1/2] fix console errors --- themes/browser/base/content/aboutDialog.js | 201 +++++++----------- themes/browser/base/content/aboutDialog.xhtml | 1 - 2 files changed, 82 insertions(+), 120 deletions(-) diff --git a/themes/browser/base/content/aboutDialog.js b/themes/browser/base/content/aboutDialog.js index bad9f10..61ddb4e 100644 --- a/themes/browser/base/content/aboutDialog.js +++ b/themes/browser/base/content/aboutDialog.js @@ -2,123 +2,86 @@ * 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"; +"use strict"; - /* import-globals-from aboutDialog-appUpdater.js */ - - // Services = object with smart getters for common XPCOM services - var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); - var { AppConstants } = ChromeUtils.import( - "resource://gre/modules/AppConstants.jsm" - ); - if (AppConstants.MOZ_UPDATER) { - Services.scriptloader.loadSubScript( - "chrome://browser/content/aboutDialog-appUpdater.js", - this - ); - } - - async function init(aEvent) { - if (aEvent.target != document) { - return; - } - - var distroId = Services.prefs.getCharPref("distribution.id", ""); - if (distroId) { - var distroAbout = Services.prefs.getStringPref("distribution.about", ""); - // If there is about text, we always show it. - if (distroAbout) { - var distroField = document.getElementById("distribution"); - distroField.value = distroAbout; - distroField.style.display = "block"; - } - // If it's not a mozilla distribution, show the rest, - // unless about text exists, then we always show. - if (!distroId.startsWith("mozilla-") || distroAbout) { - var distroVersion = Services.prefs.getCharPref( - "distribution.version", - "" - ); - if (distroVersion) { - distroId += " - " + distroVersion; - } - - var distroIdField = document.getElementById("distributionId"); - distroIdField.value = distroId; - distroIdField.style.display = "block"; - } - } - - // Include the build ID and display warning if this is an "a#" (nightly or aurora) build - let versionId = "aboutDialog-version"; - let versionAttributes = { - version: AppConstants.MOZ_APP_VERSION_DISPLAY, - bits: Services.appinfo.is64Bit ? 64 : 32, - }; - - let version = Services.appinfo.version; - if (/a\d+$/.test(version)) { - versionId = "aboutDialog-version-nightly"; - let buildID = Services.appinfo.appBuildID; - let year = buildID.slice(0, 4); - let month = buildID.slice(4, 6); - let day = buildID.slice(6, 8); - versionAttributes.isodate = `${year}-${month}-${day}`; - - document.getElementById("experimental").hidden = false; - document.getElementById("communityDesc").hidden = true; - } - - // Use Fluent arguments for append version and the architecture of the build - let versionField = document.getElementById("version"); - - document.l10n.setAttributes(versionField, versionId, versionAttributes); - - await document.l10n.translateElements([versionField]); - - // Show a release notes link if we have a URL. - let relNotesLink = document.getElementById("releasenotes"); - let relNotesPrefType = Services.prefs.getPrefType( - "app.releaseNotesURL.aboutDialog" - ); - if (relNotesPrefType != Services.prefs.PREF_INVALID) { - let relNotesURL = Services.urlFormatter.formatURLPref( - "app.releaseNotesURL.aboutDialog" - ); - if (relNotesURL != "about:blank") { - relNotesLink.href = relNotesURL; - relNotesLink.hidden = false; - } - } - - if (AppConstants.MOZ_UPDATER) { - gAppUpdater = new appUpdater({ buttonAutoFocus: true }); - - let channelLabel = document.getElementById("currentChannel"); - let currentChannelText = document.getElementById("currentChannelText"); - channelLabel.value = UpdateUtils.UpdateChannel; - let hasWinPackageId = false; - try { - hasWinPackageId = Services.sysinfo.getProperty("hasWinPackageId"); - } catch (_ex) { - // The hasWinPackageId property doesn't exist; assume it should be false. - } - if (/^release($|\-)/.test(channelLabel.value) || hasWinPackageId) { - currentChannelText.hidden = true; - } - } - - if (AppConstants.IS_ESR) { - document.getElementById("release").hidden = false; - } - - window.sizeToContent(); - - if (AppConstants.platform == "macosx") { - window.moveTo( - screen.availWidth / 2 - window.outerWidth / 2, - screen.availHeight / 5 - ); - } - } - \ No newline at end of file +/* import-globals-from aboutDialog-appUpdater.js */ + +// Services = object with smart getters for common XPCOM services +var { Services } = ChromeUtils.import("resource://gre/modules/Services.jsm"); +var { AppConstants } = ChromeUtils.import( + "resource://gre/modules/AppConstants.jsm" +); +if (AppConstants.MOZ_UPDATER) { + Services.scriptloader.loadSubScript( + "chrome://browser/content/aboutDialog-appUpdater.js", + this + ); +} + +async function init(aEvent) { + if (aEvent.target != document) { + return; + } + + var distroId = Services.prefs.getCharPref("distribution.id", ""); + if (distroId) { + var distroAbout = Services.prefs.getStringPref("distribution.about", ""); + // If there is about text, we always show it. + if (distroAbout) { + var distroField = document.getElementById("distribution"); + distroField.value = distroAbout; + distroField.style.display = "block"; + } + // If it's not a mozilla distribution, show the rest, + // unless about text exists, then we always show. + if (!distroId.startsWith("mozilla-") || distroAbout) { + var distroVersion = Services.prefs.getCharPref( + "distribution.version", + "" + ); + if (distroVersion) { + distroId += " - " + distroVersion; + } + + var distroIdField = document.getElementById("distributionId"); + distroIdField.value = distroId; + distroIdField.style.display = "block"; + } + } + + // Include the build ID and display warning if this is an "a#" (nightly or aurora) build + let versionId = "aboutDialog-version"; + let versionAttributes = { + version: AppConstants.MOZ_APP_VERSION_DISPLAY, + bits: Services.appinfo.is64Bit ? 64 : 32, + }; + + let version = Services.appinfo.version; + if (/a\d+$/.test(version)) { + versionId = "aboutDialog-version-nightly"; + let buildID = Services.appinfo.appBuildID; + let year = buildID.slice(0, 4); + let month = buildID.slice(4, 6); + let day = buildID.slice(6, 8); + versionAttributes.isodate = `${year}-${month}-${day}`; + + document.getElementById("experimental").hidden = false; + document.getElementById("communityDesc").hidden = true; + } + + // Use Fluent arguments for append version and the architecture of the build + let versionField = document.getElementById("version"); + + document.l10n.setAttributes(versionField, versionId, versionAttributes); + + await document.l10n.translateElements([versionField]); + + window.sizeToContent(); + + if (AppConstants.platform == "macosx") { + window.moveTo( + screen.availWidth / 2 - window.outerWidth / 2, + screen.availHeight / 5 + ); + } +} diff --git a/themes/browser/base/content/aboutDialog.xhtml b/themes/browser/base/content/aboutDialog.xhtml index 3d03f46..849a041 100644 --- a/themes/browser/base/content/aboutDialog.xhtml +++ b/themes/browser/base/content/aboutDialog.xhtml @@ -6,7 +6,6 @@ - Date: Sun, 2 Jan 2022 12:47:42 +0100 Subject: [PATCH 2/2] add "empty" files for new tab page logo --- themes/browser/branding/librewolf/content/jar.mn | 2 ++ themes/browser/branding/librewolf/empty.png | Bin 0 -> 563 bytes themes/browser/branding/librewolf/empty.svg | 1 + 3 files changed, 3 insertions(+) create mode 100644 themes/browser/branding/librewolf/empty.png create mode 100644 themes/browser/branding/librewolf/empty.svg diff --git a/themes/browser/branding/librewolf/content/jar.mn b/themes/browser/branding/librewolf/content/jar.mn index 6dd1639..b3713eb 100644 --- a/themes/browser/branding/librewolf/content/jar.mn +++ b/themes/browser/branding/librewolf/content/jar.mn @@ -12,3 +12,5 @@ browser.jar: content/branding/logo.svg content/branding/identity-icons-brand.svg content/branding/horizontal-lockup.svg + content/branding/about-logo.png (../empty.png) + content/branding/firefox-wordmark.svg (../empty.svg) diff --git a/themes/browser/branding/librewolf/empty.png b/themes/browser/branding/librewolf/empty.png new file mode 100644 index 0000000000000000000000000000000000000000..63294275a395e8fa7507a1796676f0ec41c1c4ab GIT binary patch literal 563 zcmV-30?hr1P)EX>4Tx04R}tkvmAkP!xv$ri!8!2Rn#3WT>4i_(B}D3Pq?8YK2xEOm6yuCJjl7 zi=*ILaPYBMb#QUk)xlK|1Ro%dPELw0QsTKup+$@bF8AZV=l{9)TtKLonPzp20h(@` zsYG1NWLL$mR|FuS7g3DM%rfRADGA^Dx~FccyBN>%@B6d*)SShDfJi*c4AUmwAfDc| z4bJ<-VOEq?;&b9rlP*a7$aTfzH_io@1)do;)2VslFtJ!@W2KE*(bR~ih$E_|Q@)V# zSmnIMSu0mr^Pc>Lp`5<5%ynABNMI35kRU=q6(y8mBSyPUiiH%N$9?=mu3sXTLaq`R zITlcX2HEw4|H1FsTKUNdFDVoUI$s>;V+82h1sXNS`95}>#t9I72Cnp$zfuQgK1r{& zw8#ta)>5p5ycZNYkv6H^9Lm z5G_#ly3f12+voOgPjh}hYYK9t@$#T600006VoOIv0RI600RN!9r;`8x010qNS#tmY zE+YT{E+YYWr9XB6000McNliru<^ci=Ckn0Q2c7@`02y>eSad^gZEa<4bO1wgWnpw> zWFU8GbZ8()Nlj2!fese{000X~L_t&t*JEG+0ssI700H7A1)Bf>002ovPDHLkV1n2) B=cWJv literal 0 HcmV?d00001 diff --git a/themes/browser/branding/librewolf/empty.svg b/themes/browser/branding/librewolf/empty.svg new file mode 100644 index 0000000..f128cc7 --- /dev/null +++ b/themes/browser/branding/librewolf/empty.svg @@ -0,0 +1 @@ +