Skip to content

Commit

Permalink
(JS) update appMenuMods.uc.js:
Browse files Browse the repository at this point in the history
stop renaming "Add-ons and themes" to "Extensions".
(CSS) adjust tab throbber icon temporarily because of a Nightly bug.
  • Loading branch information
aminomancer committed Apr 10, 2022
1 parent e2f3ceb commit 141dcca
Show file tree
Hide file tree
Showing 3 changed files with 25 additions and 25 deletions.
32 changes: 16 additions & 16 deletions JS/appMenuMods.uc.js
Original file line number Diff line number Diff line change
@@ -1,14 +1,13 @@
// ==UserScript==
// @name App Menu Mods
// @version 1.3.4
// @version 1.4.0
// @author aminomancer
// @homepage https://github.com/aminomancer/uc.css.js
// @description Makes some minor modifications to the app menu. (the popup opened by clicking the
// hamburger button on the far right of the navbar) It adds a restart button to the app menu (only
// if you're using fx-autoconfig), changes the "Add-ons and Themes" button to say "Extensions" (or
// whatever the equivalent is in your language, since the strings are localized automatically) and
// it adds a separator under the "Manage Account" button in the profile/account panel. I'll continue
// adding more mods to this script as I think of them.
// @description Makes some minor modifications to the app menu (the popup
// opened by clicking the hamburger button on the far right of the navbar). It
// adds a restart button to the app menu and it adds a separator under the
// "Manage Account" button in the profile/account panel. I'll continue adding
// more mods to this script as I think of them.
// @license This Source Code Form is subject to the terms of the Creative Commons Attribution-NonCommercial-ShareAlike International License, v. 4.0. If a copy of the CC BY-NC-SA 4.0 was not distributed with this file, You can obtain one at http://creativecommons.org/licenses/by-nc-sa/4.0/ or send a letter to Creative Commons, PO Box 1866, Mountain View, CA 94042, USA.
// ==/UserScript==

Expand All @@ -20,25 +19,27 @@
this.addSeparatorToAccountPanel();
this.fixSyncSubviewButtonAlignment();
}
static create(aDoc, tag, props, isHTML = false) {
let el = isHTML ? aDoc.createElement(tag) : aDoc.createXULElement(tag);
for (let prop in props) {
el.setAttribute(prop, props[prop]);
}
return el;
}
static sleep(ms) {
return new Promise((resolve) => setTimeout(resolve, ms));
}
async generateStrings() {
if (!this.strings)
this.strings = await new Localization(
["toolkit/about/aboutAddons.ftl", "toolkit/about/aboutSupport.ftl"],
true
);
this.strings = await new Localization(["toolkit/about/aboutSupport.ftl"], true);
await AppMenuMods.sleep(1);
return this.strings;
}
get fxaPanelView() {
return PanelMultiView.getViewNode(document, "PanelUI-fxa");
}
async handleEvent(_e) {
let strings = await this.generateStrings();
await AppMenuMods.sleep(1);
document.getElementById("appMenu-extensions-themes-button").label =
await strings.formatValue(["addon-category-extension"]);
this.addRestartButton(strings);
}
addSeparatorToAccountPanel() {
Expand All @@ -49,8 +50,7 @@
.after(this.manageAccountSeparator);
}
async addRestartButton(strings) {
if (!_ucUtils) return;
let restartButton = _ucUtils.createElement(document, "toolbarbutton", {
let restartButton = AppMenuMods.create(document, "toolbarbutton", {
id: "appMenu-restart-button2",
class: "subviewbutton",
label: await strings.formatValue(["restart-button-label"]),
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -562,7 +562,7 @@ If you can't get the module to work or if you just prefer Firefox's built-in pag

#### [App Menu Mods](/JS/appMenuMods.uc.js):

Makes some minor modifications to the app menu, aka the hamburger menu. It adds a restart button to the app menu, as long as you're using fx-autoconfig to load the script. Right-clicking the button or holding Shift or Ctrl/Cmd while left-clicking it will also clear the startup cache while restarting. Additionally, it changes the "Add-ons and Themes" button to say "Extensions" (or whatever the equivalent is in your language, since the strings are localized automatically) and it adds a separator under the "Manage Account" button in the profile/account panel. I'll continue adding more mods to this script as I think of them.
Makes some minor modifications to the app menu, aka the hamburger menu. It adds a restart button to the app menu. Right-clicking the button or holding Shift or Ctrl/Cmd while left-clicking it will also clear the startup cache while restarting. Additionally, it adds a separator under the "Manage Account" button in the profile/account panel. I'll continue adding more mods to this script as I think of them.

#### [All Tabs Menu Expansion Pack](/JS/allTabsMenuExpansionPack.uc.js):

Expand Down
16 changes: 8 additions & 8 deletions uc-tabs.css
Original file line number Diff line number Diff line change
Expand Up @@ -736,7 +736,7 @@ so in other words it won't show if audio is playing until you hover the general
this version of the animation is implemented by an <animateTransform> tag.
it's the most efficient method but it has broken once for a couple days due to an erroneous nightly patch. */

background-image: url(chrome://userchrome/content/loading-spinner.svg) !important;
/* background-image: url(chrome://userchrome/content/loading-spinner.svg) !important; */

/* ---------------------------------- */

Expand All @@ -747,7 +747,7 @@ so in other words it won't show if audio is playing until you hover the general
giving the element a CSS property "animation" that references the animation in the style tag.
use this if method #1 randomly breaks, *temporarily*. mozilla should patch such a bug quickly. */

/* background-image: url(chrome://userchrome/content/loading-spinner-css.svg) !important; */
/* background-image: url(chrome://userchrome/content/loading-spinner-css.svg) !important; */

/* ---------------------------------- */

Expand All @@ -761,21 +761,21 @@ so in other words it won't show if audio is playing until you hover the general
because the spinner technically is always visible in order to support the sliding tab-hover transitions.
you can't see it but it's not hidden in the DOM sense. so I think that makes this method a last resort. */

/* background-image: url(chrome://userchrome/content/loading-spinner-static.svg) !important;
animation: 0.85s steps(12, end) uc-tab-throbber-spinner infinite !important; */
background-image: url(chrome://userchrome/content/loading-spinner-static.svg) !important;
animation: 0.85s steps(12, end) uc-tab-throbber-spinner infinite !important;
}

/* all tabs menu & vertical tabs pane (script) */
:root[uc-loading-spinner] .tab-throbber-tabslist:is([busy], [progress]) {
/* ANIMATION METHOD #1: */
list-style-image: url(chrome://userchrome/content/loading-spinner.svg) !important;
/* list-style-image: url(chrome://userchrome/content/loading-spinner.svg) !important; */

/* ANIMATION METHOD #2: */
/* list-style-image: url(chrome://userchrome/content/loading-spinner-css.svg) !important; */
/* list-style-image: url(chrome://userchrome/content/loading-spinner-css.svg) !important; */

/* ANIMATION METHOD #3: */
/* animation: 0.85s steps(12, end) uc-tab-throbber-spinner infinite !important;
list-style-image: url(chrome://userchrome/content/loading-spinner-static.svg) !important; */
animation: 0.85s steps(12, end) uc-tab-throbber-spinner infinite !important;
list-style-image: url(chrome://userchrome/content/loading-spinner-static.svg) !important;
}

:root[uc-loading-spinner] .tab-throbber-tabslist[busy] {
Expand Down

0 comments on commit 141dcca

Please sign in to comment.