Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About:profiles and Incognito buttons in the "people" button #342

Open
wants to merge 20 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
57 changes: 57 additions & 0 deletions Profile Folder/chrome/JS/Geckium_peoplemenu.uc.js
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
// ==UserScript==
// @name Geckium - People Menu
// @author ImSwordQueen
// @loadorder 4
// ==/UserScript==

(function() {
'use strict';

// Replace the URL redirects in the "People" menu.
function modifyButtons() {
// Firefox Monitor
waitForElm('#PanelUI-fxa-menu #PanelUI-fxa-menu-monitor-button').then((monitorButton) => {
monitorButton.addEventListener('click', function(event) {
event.preventDefault();
openTrustedLinkIn("about:profiles", "tab");
});
});

// Firefox R(D)elay
waitForElm('#PanelUI-fxa-menu #PanelUI-fxa-menu-relay-button').then((relayButton) => {
relayButton.addEventListener('click', function(event) {
event.preventDefault();
OpenBrowserWindow({ private: true });
});
});
}

// Replace the strings
// TODO: This is pretty much a hack but it works for what it is supposed to do. (I won't blame you bruni if you decide to make custom buttons instead. This
// TODO: is straight up ass to deal with.)
function replaceMenuText() {
const peopleBundle = Services.strings.createBundle("chrome://geckium/locale/properties/people.properties");


function observeTextChange(selector, targetText) {
waitForElm(selector).then((element) => {
if (element) {
const observer = new MutationObserver(() => {
if (element.textContent !== targetText) {
element.textContent = targetText;
}
});
observer.observe(element, { childList: true, subtree: true });
}
});
}
observeTextChange('#PanelUI-fxa-menu-monitor-button #fxa-menu-header-title', peopleBundle.GetStringFromName("switchperson"));
observeTextChange('#PanelUI-fxa-menu-relay-button #fxa-menu-header-title', peopleBundle.GetStringFromName("goincognito"));
}

window.addEventListener('load', function() {
replaceMenuText();
modifyButtons();
});

})();
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
2 changes: 2 additions & 0 deletions Profile Folder/chrome/locale/ca/properties/people.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=Switch person
goincognito=Go incognito
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=Switch person
goincognito=Go incognito
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
2 changes: 2 additions & 0 deletions Profile Folder/chrome/locale/fr/properties/people.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
2 changes: 2 additions & 0 deletions Profile Folder/chrome/locale/it/properties/people.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=Cambia persona
goincognito=Navigazione in incognito
2 changes: 2 additions & 0 deletions Profile Folder/chrome/locale/ja/properties/people.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
2 changes: 2 additions & 0 deletions Profile Folder/chrome/locale/ro/properties/people.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
2 changes: 2 additions & 0 deletions Profile Folder/chrome/locale/uk/properties/people.properties
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
switchperson=[!!! §ωïƭçλ ƥèřƨôñ !!!]
goincognito=[!!! Gô ïñçôϱñïƭô !!!]
Original file line number Diff line number Diff line change
Expand Up @@ -155,4 +155,12 @@
display: flex !important;
}
}

// Replace Menu Icons
.PanelUI-fxa-menu-monitor-button.ctaMenuLogo {
list-style-image: url("chrome://userchrome/content/assets/img/chrome-1/peoplemenu/switchperson.png") !important;
}
.PanelUI-fxa-menu-relay-button.ctaMenuLogo {
list-style-image: url("chrome://userchrome/content/assets/img/chrome-1/peoplemenu/goincognito.svg") !important;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -51,8 +51,8 @@
}

#PanelUI-fxa-menu {
#PanelUI-fxa-menu-monitor-button,
#PanelUI-fxa-menu-relay-button,
#PanelUI-fxa-menu-monitor-button #cta-menu-header-description,
#PanelUI-fxa-menu-relay-button #cta-menu-header-description,
#PanelUI-fxa-menu-vpn-button {
display: none !important;
}
Expand Down