Removed zen-browser scripts and fixed tools command

This commit is contained in:
Mauro Balades
2024-04-30 18:58:26 +02:00
parent c3d5764da7
commit 0ae5937ce9
6 changed files with 5 additions and 88 deletions

View File

@@ -1,12 +0,0 @@
diff --git a/browser/base/content/browser-sets.inc b/browser/base/content/browser-sets.inc
index 019b3cc4691520667f9bd595444e7cc752307c98..17057b24e86dce43da30bf95d1d229044704546f 100644
--- a/browser/base/content/browser-sets.inc
+++ b/browser/base/content/browser-sets.inc
@@ -15,6 +15,7 @@
</stringbundleset>
<commandset id="mainCommandSet">
+ <command id="Tools:ZenProfiles" oncommand="BrowserOpenZenProfilesMgr();"/>
<command id="cmd_newNavigator" oncommand="OpenBrowserWindow()"/>
<command id="cmd_handleBackspace" oncommand="BrowserHandleBackspace();" />
<command id="cmd_handleShiftBackspace" oncommand="BrowserHandleShiftBackspace();" />

View File

@@ -1,16 +1,8 @@
diff --git a/browser/base/content/global-scripts.inc b/browser/base/content/global-scripts.inc
index f5f43b8f9509c37bf217b3ed1c6c562be85430e0..41fb7b9439a1be9c47a7f200546b0230ec6a7505 100644
index f5f43b8f9509c37bf217b3ed1c6c562be85430e0..c8ab55760f817aa14e3db15f6b5556118e65d218 100644
--- a/browser/base/content/global-scripts.inc
+++ b/browser/base/content/global-scripts.inc
@@ -12,6 +12,7 @@
# tools/lint/eslint/eslint-plugin-mozilla/lib/environments/browser-window.js
<script type="text/javascript">
+Services.scriptloader.loadSubScript("chrome://browser/content/zen-browser.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/browser.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/places/browserPlacesViews.js", this);
Services.scriptloader.loadSubScript("chrome://browser/content/browser-places.js", this);
@@ -22,4 +23,6 @@ if (AppConstants.platform == "macosx") {
@@ -22,4 +22,6 @@ if (AppConstants.platform == "macosx") {
Services.scriptloader.loadSubScript("chrome://global/content/macWindowMenu.js", this);
}

View File

@@ -1,61 +0,0 @@
var { XPCOMUtils } = ChromeUtils.importESModule(
"resource://gre/modules/XPCOMUtils.sys.mjs"
);
function BrowserOpenZenProfilesMgr(aView, { selectTabByViewId = false } = {}) {
return new Promise(resolve => {
let emWindow;
let browserWindow;
var receivePong = function (aSubject, aTopic, aData) {
let browserWin = aSubject.browsingContext.topChromeWindow;
if (!emWindow || browserWin == window /* favor the current window */) {
if (
selectTabByViewId &&
aSubject.gViewController.currentViewId !== aView
) {
return;
}
emWindow = aSubject;
browserWindow = browserWin;
}
};
Services.obs.addObserver(receivePong, "EM-pong");
Services.obs.notifyObservers(null, "EM-ping");
Services.obs.removeObserver(receivePong, "EM-pong");
if (emWindow) {
if (aView && !selectTabByViewId) {
emWindow.loadView(aView);
}
let tab = browserWindow.gBrowser.getTabForBrowser(
emWindow.docShell.chromeEventHandler
);
browserWindow.gBrowser.selectedTab = tab;
emWindow.focus();
resolve(emWindow);
return;
}
if (selectTabByViewId) {
const target = isBlankPageURL(gBrowser.currentURI.spec)
? "current"
: "tab";
openTrustedLinkIn("about:profiles", target);
} else {
// This must be a new load, else the ping/pong would have
// found the window above.
switchToTabHavingURI("about:profiles", true);
}
Services.obs.addObserver(function observer(aSubject, aTopic, aData) {
Services.obs.removeObserver(observer, aTopic);
if (aView) {
aSubject.loadView(aView);
}
aSubject.focus();
resolve(aSubject);
}, "EM-loaded");
});
}

View File

@@ -8,7 +8,7 @@
<p id="PanelUI-zen-profiles-current-profile-current" data-l10n-id="zen-panel-ui-current-profile-text"></p>
</vbox>
<toolbarbutton id="PanelUI-zen-profiles-privateWin" command="Tools:PrivateBrowsing" data-l10n-id="appmenuitem-new-private-window" class="subviewbutton"></toolbarbutton>
<toolbarbutton id="PanelUI-zen-profiles-managePrfs" command="Tools:ZenProfiles" data-l10n-id="appmenu-manage-profiles" class="subviewbutton"></toolbarbutton>
<toolbarbutton id="PanelUI-zen-profiles-managePrfs" oncommand="switchToTabHavingURI('about:profiles', true);" data-l10n-id="appmenu-manage-profiles" class="subviewbutton"></toolbarbutton>
<toolbarbutton id="PanelUI-zen-profiles-newProfile" oncommand="ZenProfileDialogUI.createProfileWizard();" data-l10n-id="appmenu-create-profile" class="subviewbutton"></toolbarbutton>
<vbox id="PanelUI-zen-profiles-list">
</vbox>

View File

@@ -1,4 +1,3 @@
content/browser/zen-browser-places.js (content/zen-browser-places.js)
content/browser/zen-browser.js (content/zen-browser.js)
content/browser/zenThemeModifier.js (content/zenThemeModifier.js)
content/browser/ZenSidebarManager.mjs (content/ZenSidebarManager.mjs)

View File

@@ -7,7 +7,6 @@
#PanelUI-zen-profiles-header {
width: -moz-available;
height: 100px;
border-radius: 7px;
background: var(--zen-main-browser-background);
position: relative;
}
@@ -30,7 +29,7 @@
.PanelUI-zen-profiles-item {
position: relative;
display: flex;
padding: 10px;
padding: 6px 10px;
font: menu;
align-items: center;
}
@@ -115,7 +114,7 @@
#PanelUI-zen-profiles-current-profile-current {
font-size: 13px;
opacity: 0.5;
margin: 0 auto 5px auto;
margin: 0 auto 15px auto;
}