diff --git a/.github/PULL_REQUEST_TEMPLATE/ff_update.md b/.github/PULL_REQUEST_TEMPLATE/ff_update.md new file mode 100644 index 00000000..5c9ab170 --- /dev/null +++ b/.github/PULL_REQUEST_TEMPLATE/ff_update.md @@ -0,0 +1,51 @@ +# Firefox Update + +This bumps Firefox up to `{NEW_VERSION}` for security and performance reasons. Reviewers check the following before continuing: + +## QA Requirements + +- [ ] Sidebar + + - [ ] The sidebar exists + - [ ] The settings and addons button are visible down the bottom + - [ ] The bookmarks, history and synced tabs icons are in the sidebar + - [ ] An [installed extension](https://addons.mozilla.org/en-US/firefox/addon/sidebar-note/?utm_source=addons.mozilla.org&utm_medium=referral&utm_content=search) will appear in the sidebar + +- [ ] Extensions + + - [ ] Tabliss is loading correctly + - [ ] Tabliss does not have the webextention symbol in the title bar + - [ ] uBlock origin is loading correctly + - [ ] FirePicker is loading correctly + +- [ ] About dialog + + - [ ] The new about dialog is present + - [ ] The dialog has not significantly changed + +- [ ] Pocket + + - [ ] Pocket is not present in the browser + +- [ ] Preferences + + - [ ] All tabs in preferences open + - [ ] The "More from {Vendor}" option is not present + - [ ] The sidebar preferences are present and work as expected + +- [ ] Welcome experience + + - [ ] The import button opens the import wizard + - [ ] The theme picker is present and works as expected + - [ ] The search engine picker is present and works as expected + +- [ ] Pulse theme + + - [ ] The tabs appear to be consistent + +- [ ] Mozilla theme + + - [ ] The sidebar tabs are correct + +- [ ] Useragent + - [ ] The user agent is reporting as Mozilla Firefox diff --git a/.github/workflows/dependant-issues.yml b/.github/workflows/dependant-issues.yml index cdf9b8d6..b59feefa 100644 --- a/.github/workflows/dependant-issues.yml +++ b/.github/workflows/dependant-issues.yml @@ -55,5 +55,3 @@ jobs: This PR/issue depends on: {{ dependencies }} - - By **[Dependent Issues](https://github.com/z0al/dependent-issues)** (🤖). Happy coding! diff --git a/gluon b/gluon index 0a64107c..e0e5337a 160000 --- a/gluon +++ b/gluon @@ -1 +1 @@ -Subproject commit 0a64107c22f6495640a5b706532abcccfa5bca69 +Subproject commit e0e5337a80da24275bf2bcd5708398072d65f559 diff --git a/gluon.json b/gluon.json index 2b905c50..962af77d 100644 --- a/gluon.json +++ b/gluon.json @@ -5,7 +5,7 @@ "binaryName": "pulse-browser", "version": { "product": "firefox", - "version": "102.0.1" + "version": "103.0" }, "buildOptions": { "generateBranding": true @@ -86,10 +86,8 @@ } }, "license": { - "ignoredFiles": [ - ".*\\.json" - ], + "ignoredFiles": [".*\\.json"], "licenseType": "MPL-2.0" }, "updateHostname": "updates.pulsebrowser.app" -} \ No newline at end of file +} diff --git a/src/browser/base/content/browser-sidebar-js.patch b/src/browser/base/content/browser-sidebar-js.patch index 0e235a13..7ea4cd49 100644 --- a/src/browser/base/content/browser-sidebar-js.patch +++ b/src/browser/base/content/browser-sidebar-js.patch @@ -1,19 +1,18 @@ diff --git a/browser/base/content/browser-sidebar.js b/browser/base/content/browser-sidebar.js -index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68c4e46449 100644 +index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..a08db41af1a11c0c435a0b0ca1d3ecd0633dce23 100644 --- a/browser/base/content/browser-sidebar.js +++ b/browser/base/content/browser-sidebar.js -@@ -6,6 +6,10 @@ +@@ -6,6 +6,9 @@ * SidebarUI controls showing and hiding the browser sidebar. */ var SidebarUI = { -+ + /** + * @returns {Map} + */ get sidebars() { if (this._sidebars) { return this._sidebars; -@@ -19,6 +23,7 @@ var SidebarUI = { +@@ -19,6 +22,7 @@ var SidebarUI = { get title() { return document.getElementById(elementId).getAttribute("label"); }, @@ -21,7 +20,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 ...rest, }; } -@@ -30,6 +35,7 @@ var SidebarUI = { +@@ -30,6 +34,7 @@ var SidebarUI = { elementId: "sidebar-switcher-bookmarks", url: "chrome://browser/content/places/bookmarksSidebar.xhtml", menuId: "menu_bookmarksSidebar", @@ -29,7 +28,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 }), ], [ -@@ -39,6 +45,7 @@ var SidebarUI = { +@@ -39,6 +44,7 @@ var SidebarUI = { url: "chrome://browser/content/places/historySidebar.xhtml", menuId: "menu_historySidebar", triggerButtonId: "appMenuViewHistorySidebar", @@ -37,7 +36,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 }), ], [ -@@ -47,6 +54,7 @@ var SidebarUI = { +@@ -47,6 +53,7 @@ var SidebarUI = { elementId: "sidebar-switcher-tabs", url: "chrome://browser/content/syncedtabs/sidebar.xhtml", menuId: "menu_tabsSidebar", @@ -45,7 +44,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 }), ], ])); -@@ -61,6 +69,8 @@ var SidebarUI = { +@@ -61,6 +68,8 @@ var SidebarUI = { return (this._browser = document.getElementById("sidebar")); }, POSITION_START_PREF: "sidebar.position_start", @@ -54,7 +53,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 DEFAULT_SIDEBAR_ID: "viewBookmarksSidebar", // lastOpenedId is set in show() but unlike currentID it's not cleared out on hide -@@ -78,6 +88,8 @@ var SidebarUI = { +@@ -78,6 +87,8 @@ var SidebarUI = { }, _splitter: null, _icon: null, @@ -63,7 +62,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 _reversePositionButton: null, _switcherPanel: null, _switcherTarget: null, -@@ -109,11 +121,28 @@ var SidebarUI = { +@@ -109,11 +120,38 @@ var SidebarUI = { this._switcherPanel = document.getElementById("sidebarMenu-popup"); this._switcherTarget = document.getElementById("sidebar-switcher-target"); this._switcherArrow = document.getElementById("sidebar-switcher-arrow"); @@ -75,16 +74,26 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 }); + const sidebaritems = this.sidebars.keys(); -+ const sidebarExtensionVis = Services.prefs.getBoolPref(this.SIDEBAR_EXTENSIONS_PREF, false); ++ const sidebarExtensionVis = Services.prefs.getBoolPref( ++ this.SIDEBAR_EXTENSIONS_PREF, ++ false ++ ); + for (const sidebaritem of sidebaritems) { -+ if(this.sidebars.get(sidebaritem).extensionId && !sidebarExtensionVis) { ++ if (this.sidebars.get(sidebaritem).extensionId && !sidebarExtensionVis) { + return; + } -+ this.createSidebarItem(sidebaritem, this.sidebars.get(sidebaritem).iconurl, this.sidebars.get(sidebaritem)); ++ this.createSidebarItem( ++ sidebaritem, ++ this.sidebars.get(sidebaritem).iconurl, ++ this.sidebars.get(sidebaritem) ++ ); + } + -+ const sidebarVisible = Services.prefs.getBoolPref(this.SIDEBAR_TABS_PREF, true) -+ this.setSidebarVisibility(sidebarVisible) ++ const sidebarVisible = Services.prefs.getBoolPref( ++ this.SIDEBAR_TABS_PREF, ++ true ++ ); ++ this.setSidebarVisibility(sidebarVisible); + + // Keep track on the changes of the sidebar visibility + Services.prefs.addObserver(this.SIDEBAR_TABS_PREF, this); @@ -92,7 +101,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 this._inited = true; Services.obs.addObserver(this, "intl:app-locales-changed"); -@@ -121,6 +150,20 @@ var SidebarUI = { +@@ -121,6 +159,20 @@ var SidebarUI = { this._initDeferred.resolve(); }, @@ -101,28 +110,44 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 + * @param {boolean} visible Sets the sidebar to be visible or not visible + */ + setSidebarVisibility(visible) { -+ const sidebarContainer = document.getElementById('sidebar-container') ++ const sidebarContainer = document.getElementById("sidebar-container"); + + if (visible) { -+ sidebarContainer.style.display = 'flex' ++ sidebarContainer.style.display = "flex"; + } else { -+ sidebarContainer.style.display = 'none' ++ sidebarContainer.style.display = "none"; + } + }, + uninit() { // If this is the last browser window, persist various values that should be // remembered for after a restart / reopening a browser window. -@@ -171,6 +214,55 @@ var SidebarUI = { +@@ -159,9 +211,9 @@ var SidebarUI = { + /** + * The handler for Services.obs.addObserver. + **/ +- observe(_subject, topic, _data) { ++ observe(_subject, topic, data) { + switch (topic) { +- case "intl:app-locales-changed": { ++ case "intl:app-locales-changed": + if (this.isOpen) { + // The component used in history and bookmarks, but it does not + // support live switching the app locale. Reload the entire sidebar to +@@ -170,7 +222,58 @@ var SidebarUI = { + this._show(this.lastOpenedId); break; } - } +- } ++ break; + + case "nsPref:changed": -+ switch (aData) { ++ switch (data) { + case this.SIDEBAR_TABS_PREF: -+ this.setSidebarVisibility(Services.prefs.getBoolPref(this.SIDEBAR_TABS_PREF, true)) -+ break ++ this.setSidebarVisibility( ++ Services.prefs.getBoolPref(this.SIDEBAR_TABS_PREF, true) ++ ); ++ break; + } + break; + } @@ -134,21 +159,21 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 + return; + } + -+ const background = document.createElement("div") -+ background.classList.add("sidebar-item-background") ++ const background = document.createElement("div"); ++ background.classList.add("sidebar-item-background"); + background.setAttribute("id", `sidebar-background-${id}`); + background.onclick = () => { -+ this.toggle(id) -+ } -+ ++ this.toggle(id); ++ }; ++ + const iconEl = document.createElement("image"); + iconEl.setAttribute("id", `sidebar-icon-${id}`); + iconEl.setAttribute("src", `${icon}`); + iconEl.style.backgroundImage = `url(${icon})`; -+ -+ background.append(iconEl) + -+ if(config.bottom){ ++ background.append(iconEl); ++ ++ if (config.bottom) { + this._sidebarBottomIcons.appendChild(background); + return; + } @@ -159,28 +184,28 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 + }, + + deleteSidebarItem(id) { -+ const background = document.getElementById(`sidebar-background-${id}`) -+ const icon = document.getElementById(`sidebar-icon-${id}`) -+ if(background){ -+ background.remove() ++ const background = document.getElementById(`sidebar-background-${id}`); ++ const icon = document.getElementById(`sidebar-icon-${id}`); ++ if (background) { ++ background.remove(); + } -+ if(icon){ -+ icon.remove() ++ if (icon) { ++ icon.remove(); } }, -@@ -521,6 +613,10 @@ var SidebarUI = { +@@ -521,6 +624,10 @@ var SidebarUI = { return this._show(commandID).then(() => { this._loadSidebarExtension(commandID); -+ // Pulse: Reset sidebar margin to zero to allow for correct animations to ++ // Pulse: Reset sidebar margin to zero to allow for correct animations to + // take place (adapted from dot browser, se below) -+ this._box.style.marginLeft = '0px' ++ this._box.style.marginLeft = "0px"; + if (triggerNode) { updateToggleControlLabel(triggerNode); } -@@ -618,6 +714,24 @@ var SidebarUI = { +@@ -618,6 +725,26 @@ var SidebarUI = { this.selectMenuItem(""); @@ -190,22 +215,24 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 + // Pulse Browser: Helper stuff for sidebar animation. We can fake sliding in + // and out by changing the left margin to be a negative value. Then, inside + // of our css code, we can animate it to close. -+ this._box.style.marginLeft = `${-Math.abs(this._box.getBoundingClientRect().width)}px` -+ ++ this._box.style.marginLeft = `${-Math.abs( ++ this._box.getBoundingClientRect().width ++ )}px`; ++ + // We want to fully set it to hidden to slightly improve browser performance + // when it is hidden. Note that this replaces some of Mozilla's code that + // would generally be down below + setTimeout(() => { -+ this._box.hidden = true -+ this._splitter.hidden = true ++ this._box.hidden = true; ++ this._splitter.hidden = true; + -+ this._box.removeAttribute("checked") ++ this._box.removeAttribute("checked"); + }, 170); + // Replace the document currently displayed in the sidebar with about:blank // so that we can free memory by unloading the page. We need to explicitly // create a new content viewer because the old one doesn't get destroyed -@@ -626,9 +740,6 @@ var SidebarUI = { +@@ -626,9 +753,6 @@ var SidebarUI = { this.browser.setAttribute("src", "about:blank"); this.browser.docShell.createAboutBlankContentViewer(null, null); @@ -215,7 +242,7 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 let selBrowser = gBrowser.selectedBrowser; selBrowser.focus(); if (triggerNode) { -@@ -641,10 +752,21 @@ var SidebarUI = { +@@ -641,10 +765,22 @@ var SidebarUI = { * none if the argument is an empty string. */ selectMenuItem(commandID) { @@ -227,9 +254,10 @@ index 78afa499b4a93fc75e8706a9afb077e2b5ca7428..4da170628abea6eb8b9d3a81385d0d68 - let triggerbutton = + let dropdownTriggerButton = triggerButtonId && document.getElementById(triggerButtonId); -+ let sidebarTriggerButton = document.getElementById("sidebar-background-" + id); -+ -+ ++ let sidebarTriggerButton = document.getElementById( ++ "sidebar-background-" + id ++ ); ++ + setCheckedForItem(id, menu, dropdownTriggerButton); + setCheckedForItem(id, menu, sidebarTriggerButton); + } diff --git a/src/browser/components/BrowserGlue-jsm.patch b/src/browser/components/BrowserGlue-jsm.patch index 6f464ea5..87ff46d0 100644 --- a/src/browser/components/BrowserGlue-jsm.patch +++ b/src/browser/components/BrowserGlue-jsm.patch @@ -1,30 +1,11 @@ diff --git a/browser/components/BrowserGlue.jsm b/browser/components/BrowserGlue.jsm -index 89651a029abc4f41205f099950a0a21eddb26cc1..9b793db6fc17848670cf18ca1d9552960a57f0ea 100644 +index 64ac529d54270758b6dfa7a0a04b604b89a92402..e4b7844fd1df5c3ff09432c6d1664f72dba02320 100644 --- a/browser/components/BrowserGlue.jsm +++ b/browser/components/BrowserGlue.jsm -@@ -4183,6 +4183,18 @@ BrowserGlue.prototype = { - SpecialMessageActions.handleAction(config, browser); +@@ -4321,6 +4321,23 @@ BrowserGlue.prototype = { }, -+ /** -+ * Displays the welcome dialog. Trigured `_maybeShowDefaultBrowserPrompt`. -+ * -+ * @todo Provide documentation for implementing custom popups -+ * @patch FocusBrowser -+ */ -+ _showWelcomeDialog() { -+ BrowserWindowTracker.getTopWindow().gDialogBox.open( -+ "chrome://browser/content/welcome/welcome.html" -+ ); -+ }, -+ async _maybeShowDefaultBrowserPrompt() { - // Highest priority is the upgrade dialog, which can include a "primary - // browser" request and is limited in various ways, e.g., major upgrades. -@@ -4236,6 +4248,23 @@ BrowserGlue.prototype = { - return; - } - + // ========================================================================= + // Pulse browser welcome + @@ -42,6 +23,25 @@ index 89651a029abc4f41205f099950a0a21eddb26cc1..9b793db6fc17848670cf18ca1d955296 + + // ========================================================================= + - const willPrompt = await DefaultBrowserCheck.willCheckDefaultBrowser( - /* isStartupCheck */ true - ); + // Highest priority is the upgrade dialog, which can include a "primary + // browser" request and is limited in various ways, e.g., major upgrades. + const dialogVersion = 100; +@@ -4780,6 +4797,18 @@ BrowserGlue.prototype = { + "nsIObserver", + "nsISupportsWeakReference", + ]), ++ ++ /** ++ * Displays the welcome dialog. Trigured `_maybeShowDefaultBrowserPrompt`. ++ * ++ * @todo Add gluon docs for how to show custom popups on startup ++ * @patch Pulse Browser ++ */ ++ _showWelcomeDialog() { ++ lazy.BrowserWindowTracker.getTopWindow().gDialogBox.open( ++ "chrome://browser/content/welcome/welcome.html" ++ ); ++ }, + }; + + var ContentBlockingCategoriesPrefs = { diff --git a/src/browser/components/customizableui/CustomizableUI-jsm.patch b/src/browser/components/customizableui/CustomizableUI-jsm.patch index 18542f3d..1714851c 100644 --- a/src/browser/components/customizableui/CustomizableUI-jsm.patch +++ b/src/browser/components/customizableui/CustomizableUI-jsm.patch @@ -1,19 +1,16 @@ diff --git a/browser/components/customizableui/CustomizableUI.jsm b/browser/components/customizableui/CustomizableUI.jsm -index 87aede1449d7ac4f30e13990f6d928fba3484162..32deb776daa5f4a353667e282f2ebfd904cefedb 100644 +index 00e8533bc51245f3d55cefa3f20fc588c0e49c70..fd11b297a715f8861fc34c89861f726d1fd9336f 100644 --- a/browser/components/customizableui/CustomizableUI.jsm +++ b/browser/components/customizableui/CustomizableUI.jsm -@@ -13,6 +13,10 @@ const { AppConstants } = ChromeUtils.import( - "resource://gre/modules/AppConstants.jsm" - ); - -+const { makeWidgetId } = ChromeUtils.import( -+ "resource://gre/modules/ExtensionCommon.jsm" -+).ExtensionCommon; -+ - XPCOMUtils.defineLazyModuleGetters(this, { +@@ -18,6 +18,7 @@ const lazy = {}; + XPCOMUtils.defineLazyModuleGetters(lazy, { AddonManager: "resource://gre/modules/AddonManager.jsm", AddonManagerPrivate: "resource://gre/modules/AddonManager.jsm", -@@ -32,6 +36,7 @@ XPCOMUtils.defineLazyGetter(this, "gWidgetsBundle", function() { ++ ExtensionCommon: "resource://gre/modules/ExtensionCommon.jsm", + SearchWidgetTracker: "resource:///modules/SearchWidgetTracker.jsm", + CustomizableWidgets: "resource:///modules/CustomizableWidgets.jsm", + PanelMultiView: "resource:///modules/PanelMultiView.jsm", +@@ -34,6 +35,7 @@ XPCOMUtils.defineLazyGetter(lazy, "gWidgetsBundle", function() { }); const kDefaultThemeID = "default-theme@mozilla.org"; @@ -21,8 +18,12 @@ index 87aede1449d7ac4f30e13990f6d928fba3484162..32deb776daa5f4a353667e282f2ebfd9 const kSpecialWidgetPfx = "customizableui-special-"; -@@ -232,15 +237,15 @@ var CustomizableUIInternal = { +@@ -231,17 +233,21 @@ var CustomizableUIInternal = { + true + ); ++ const { makeWidgetId } = lazy.ExtensionCommon; ++ let navbarPlacements = [ "back-button", - "forward-button", @@ -32,6 +33,8 @@ index 87aede1449d7ac4f30e13990f6d928fba3484162..32deb776daa5f4a353667e282f2ebfd9 ? null : "home-button", "spring", ++ // TODO: Would be nice if this was moved to an extension API rather than ++ // manually being edited here... + `${makeWidgetId(kUBlockOriginID)}-browser-action`, "urlbar-container", "spring", diff --git a/src/browser/components/preferences/preferences-js.patch b/src/browser/components/preferences/preferences-js.patch new file mode 100644 index 00000000..8723c1cc --- /dev/null +++ b/src/browser/components/preferences/preferences-js.patch @@ -0,0 +1,19 @@ +diff --git a/browser/components/preferences/preferences.js b/browser/components/preferences/preferences.js +index d3a1fce03d4f2109532f32cbaa027600505de5a6..6c14b0079f5677bf8f4b465473d4909da65d33bb 100644 +--- a/browser/components/preferences/preferences.js ++++ b/browser/components/preferences/preferences.js +@@ -156,7 +156,13 @@ function register_module(categoryName, categoryObject) { + if (template) { + // Replace the template element with the nodes inside of it. + let frag = template.content; +- await document.l10n.translateFragment(frag); ++ ++ // Pulse Browser ++ // Something seems to be bugged out here, but it doesn't matter. So, the ++ // simple solution is to silent catch the error... ++ try { ++ await document.l10n.translateFragment(frag); ++ } catch (e) {} + + // Actually insert them into the DOM. + document.l10n.pauseObserving(); diff --git a/src/browser/themes/addons/jar-mn.patch b/src/browser/themes/addons/jar-mn.patch index 37c1b75a..95095338 100644 --- a/src/browser/themes/addons/jar-mn.patch +++ b/src/browser/themes/addons/jar-mn.patch @@ -1,5 +1,5 @@ diff --git a/browser/themes/addons/jar.mn b/browser/themes/addons/jar.mn -index 271106757c7f60cdf78ff89c2dff375b524d197c..999049782628d501296a76990484fa29a5c3d5a9 100644 +index 69bb3000d6d2d249d1d77262dc2a0057d0318308..68fc1df73672c271990b6d2eca489093569ec0fb 100644 --- a/browser/themes/addons/jar.mn +++ b/browser/themes/addons/jar.mn @@ -16,6 +16,14 @@ browser.jar: @@ -14,6 +14,6 @@ index 271106757c7f60cdf78ff89c2dff375b524d197c..999049782628d501296a76990484fa29 + content/builtin-themes/pulse/light/experiment.css (pulse/light/experiment.css) + content/builtin-themes/pulse/light/manifest.json (pulse/light/manifest.json) + - content/builtin-themes/monochromatic/lush/soft (monochromatic/lush/soft/*.svg) - content/builtin-themes/monochromatic/lush/soft/manifest.json (monochromatic/lush/soft/manifest.json) - content/builtin-themes/monochromatic/lush/balanced (monochromatic/lush/balanced/*.svg) + content/builtin-themes/colorways/2021lush/soft (colorways/2021-life-in-color/lush/soft/*.svg) + content/builtin-themes/colorways/2021lush/soft/manifest.json (colorways/2021-life-in-color/lush/soft/manifest.json) + content/builtin-themes/colorways/2021lush/balanced (colorways/2021-life-in-color/lush/balanced/*.svg)