0
Fork 0
mirror of https://codeberg.org/librewolf/source.git synced 2025-01-03 11:20:11 -05:00
LibreWolf/patches/ui-patches/firefox-view.patch

168 lines
6.4 KiB
Diff
Raw Normal View History

2023-10-30 14:59:31 -05:00
# LibreWolf firefox-view.patch
2023-01-18 18:07:26 -05:00
#
# Author: Malte Jürgens <maltejur@dismail.de>
2023-10-30 14:59:31 -05:00
# Description: Hide "Firefox View" by default
# Last Updated: 2023-11-04
2023-01-18 18:07:26 -05:00
# License: MPL 2.0
#
# 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 = {
!this._enabled
);
document.getElementById("menu_openFirefoxView").hidden = !this._enabled;
- document.getElementById("firefox-view-button").style.listStyleImage =
- NimbusFeatures.firefoxViewNext.getVariable("newIcon")
- ? ""
- : 'url("chrome://branding/content/about-logo.png")';
+ if (this.button)
+ this.button.style.listStyleImage =
+ NimbusFeatures.firefoxViewNext.getVariable("newIcon")
+ ? ""
+ : 'url("chrome://branding/content/about-logo.png")';
},
onWidgetRemoved(aWidgetId) {
if (aWidgetId == this.BUTTON_ID && this.tab) {
2023-10-30 14:59:31 -05:00
diff --git a/browser/base/content/navigator-toolbox.inc.xhtml b/browser/base/content/navigator-toolbox.inc.xhtml
2022-12-14 07:33:59 -05:00
--- a/browser/base/content/navigator-toolbox.inc.xhtml
+++ b/browser/base/content/navigator-toolbox.inc.xhtml
2023-10-30 14:59:31 -05:00
@@ -35,16 +35,6 @@
2022-12-14 07:33:59 -05:00
<hbox flex="1" align="end" class="toolbar-items">
<toolbartabstop/>
<hbox id="TabsToolbar-customization-target" flex="1">
- <toolbarbutton id="firefox-view-button"
- class="toolbarbutton-1 chromeclass-toolbar-additional"
2023-10-27 02:45:04 -05:00
- data-l10n-id="toolbar-button-firefox-view-2"
2022-12-14 07:33:59 -05:00
- role="button"
- aria-pressed="false"
- oncommand="FirefoxViewHandler.openTab(event);"
- onmousedown="FirefoxViewHandler.openTab(event);"
- cui-areatype="toolbar"
- removable="true"/>
-
<tabs id="tabbrowser-tabs"
is="tabbrowser-tabs"
2023-10-30 14:59:31 -05:00
aria-multiselectable="true"
@@ -716,5 +706,15 @@
2022-12-14 07:33:59 -05:00
closemenu="none"
cui-areatype="toolbar"
data-l10n-id="navbar-library"/>
+
+ <toolbarbutton id="firefox-view-button"
+ class="toolbarbutton-1 chromeclass-toolbar-additional"
2023-10-27 02:45:04 -05:00
+ data-l10n-id="toolbar-button-firefox-view-2"
2022-12-14 07:33:59 -05:00
+ role="button"
+ aria-pressed="false"
+ oncommand="FirefoxViewHandler.openTab(event);"
+ onmousedown="FirefoxViewHandler.openTab(event);"
+ cui-areatype="toolbar"
+ removable="true"/>
</html:template>
</toolbox>
2023-10-30 14:59:31 -05:00
diff --git a/browser/components/customizableui/CustomizableUI.sys.mjs b/browser/components/customizableui/CustomizableUI.sys.mjs
2023-07-05 09:24:28 -05:00
--- a/browser/components/customizableui/CustomizableUI.sys.mjs
+++ b/browser/components/customizableui/CustomizableUI.sys.mjs
2023-10-30 14:59:31 -05:00
@@ -287,7 +287,6 @@ var CustomizableUIInternal = {
2022-10-20 17:49:50 -05:00
{
type: CustomizableUI.TYPE_TOOLBAR,
defaultPlacements: [
- "firefox-view-button",
"tabbrowser-tabs",
"new-tab-button",
"alltabs-button",
2023-10-30 14:59:31 -05:00
@@ -616,18 +615,6 @@ var CustomizableUIInternal = {
2022-10-20 17:49:50 -05:00
}
}
2023-03-15 06:10:20 -05:00
2022-10-20 17:49:50 -05:00
- // Add firefox-view if not present
- if (currentVersion < 18) {
- let tabstripPlacements =
- gSavedState.placements[CustomizableUI.AREA_TABSTRIP];
- if (
- tabstripPlacements &&
- !tabstripPlacements.includes("firefox-view-button")
- ) {
- tabstripPlacements.unshift("firefox-view-button");
- }
- }
2023-03-15 06:10:20 -05:00
-
// Unified Extensions addon button migration, which puts any browser action
// buttons in the overflow menu into the addons panel instead.
if (currentVersion < 19) {
2023-10-30 14:59:31 -05:00
diff --git a/browser/components/firefoxview/firefoxview.html b/browser/components/firefoxview/firefoxview.html
2022-10-20 17:49:50 -05:00
--- a/browser/components/firefoxview/firefoxview.html
+++ b/browser/components/firefoxview/firefoxview.html
2023-10-30 14:59:31 -05:00
@@ -61,6 +61,7 @@
2023-07-05 09:24:28 -05:00
is="tab-pickup-container"
id="tab-pickup-container"
open
+ hidden
>
2022-10-20 17:49:50 -05:00
<summary class="page-section-header">
2023-07-05 09:24:28 -05:00
<span
2023-10-30 14:59:31 -05:00
diff --git a/browser/components/newtab/lib/OnboardingMessageProvider.jsm b/browser/components/newtab/lib/OnboardingMessageProvider.jsm
2022-10-22 06:55:59 -05:00
--- a/browser/components/newtab/lib/OnboardingMessageProvider.jsm
+++ b/browser/components/newtab/lib/OnboardingMessageProvider.jsm
2023-10-30 14:59:31 -05:00
@@ -78,57 +78,6 @@ const BASE_MESSAGES = () => [
2022-10-22 06:55:59 -05:00
trigger: { id: "protectionsPanelOpen" },
},
2023-10-30 14:59:31 -05:00
{
2022-10-22 06:55:59 -05:00
- id: "CFR_FIREFOX_VIEW",
- groups: ["cfr"],
- template: "cfr_doorhanger",
2022-12-14 07:33:59 -05:00
- //If Firefox View button has been moved to the overflow menu, we want to change the anchor element
2022-10-22 06:55:59 -05:00
- content: {
- bucket_id: "CFR_FIREFOX_VIEW",
- anchor_id: "firefox-view-button",
2022-12-14 07:33:59 -05:00
- alt_anchor_id: "nav-bar-overflow-button",
2022-10-22 06:55:59 -05:00
- 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: {
2023-01-16 15:42:59 -05:00
- string_id: "firefoxview-cfr-header-v2",
2022-10-22 06:55:59 -05:00
- },
- text: {
2023-01-16 15:42:59 -05:00
- string_id: "firefoxview-cfr-body-v2",
2022-10-22 06:55:59 -05:00
- },
- 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.
2022-12-14 07:33:59 -05:00
- 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`,
2022-10-22 06:55:59 -05:00
- },
2023-10-30 14:59:31 -05:00
- {
2022-10-22 06:55:59 -05:00
id: "FX_MR_106_UPGRADE",
template: "spotlight",
2023-10-30 14:59:31 -05:00
targeting: "true",