-
Notifications
You must be signed in to change notification settings - Fork 27
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
3.1.4: new script and script updates.
(JS) add new script: tabLoadingSpinner. the loading spinner icon functionality has been adjusted so it now requires this script. make sure to download it if you want the spinner. update urlbarMods.uc.js to 1.6.1 to fix a minor issue. update tabMods.uc.js to 1.3.2 to fix another minor issue. (CSS) minor changes related to the above JS changes. see the commit notes for more details. thanks again to my sponsor KleinByte!
- Loading branch information
1 parent
23eb92c
commit bb8d76b
Showing
12 changed files
with
144 additions
and
103 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,38 @@ | ||
// ==UserScript== | ||
// @name Tab Loading Spinner Animation | ||
// @version 1.0 | ||
// @author aminomancer | ||
// @homepage https://github.com/aminomancer/uc.css.js | ||
// @description Required for duskFox's custom loading spinner animation. This isn't strictly necessary, since the spinner is implemented in CSS, but duskFox restricts the use of the spinner to conditions laid out by this script. This is done in order to allow the loading throbber icon to smoothly fade in and out without harming performance. Without this, the spinner would potentially reduce framerate and, for at least one user, would cause problems during startup. So if you don't install this script, you'll end up with Firefox's vanilla loading throbber icon rather than duskFox's spinner icon. | ||
// @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== | ||
|
||
(function () { | ||
document.documentElement.setAttribute("uc-loading-spinner", "true"); | ||
function init() { | ||
gBrowser.tabContainer.addEventListener("TabAttrModified", (e) => { | ||
let changed = e.detail.changed; | ||
if (!(changed && (changed.includes("busy") || changed.includes("progress")))) return; | ||
let tab = e.target; | ||
let throbber = tab.querySelector(".tab-throbber"); | ||
if (tab.getAttribute("busy") == "true") { | ||
throbber.setAttribute("throbber-loaded", "true"); | ||
} else { | ||
setTimeout( | ||
tab.querySelector(".tab-throbber").removeAttribute("throbber-loaded"), | ||
850 | ||
); | ||
} | ||
}); | ||
} | ||
if (gBrowserInit.delayedStartupFinished) init(); | ||
else { | ||
let delayedListener = (subject, topic) => { | ||
if (topic == "browser-delayed-startup-finished" && subject == window) { | ||
Services.obs.removeObserver(delayedListener, topic); | ||
init(); | ||
} | ||
}; | ||
Services.obs.addObserver(delayedListener, "browser-delayed-startup-finished"); | ||
} | ||
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.