Skip to content
This repository was archived by the owner on Oct 3, 2024. It is now read-only.

Commit a762228

Browse files
Closed Beta 0.7
Final? perhaps closed beta. Additions: - New custom site info (the one you click on lock) panel. - New custom homepage replacing the default Firefox one with top 8 sites and Apps page with some links (It doesn't have the same Apps function like Chrome did, its mainly added for accuracy sake). - New custom incognito page replacing the old one. - Checkboxes and Radios are now themed. - Added "surprise" for April 1st. shhhhh. - For first time users, you will now see "If you see this, Silverfox has been correctly installed banner" instead of old one. Fixes/Removals/Changes: - Silverfox Beta "bookmark" has been removed. - Website.com is now fullscreen popup has been disabled. - Downloads page is now unscrollable. - No more ugly .xhtml path pages. Now you access them via about:x pages (about:history, about:bookmarks, about:silverfox, about:flags, etc). See pages.uc.js for more. Thanks to abuymori, ephemeralViolette and others. - Fixed titlebar buttons location for Win 10 Aero native theme. - Updater is now built-in hamburgermenu.uc.js which should fix it for some OSes such as Linux. - One easter egg has been changed. Another was added somewhere : p. - Updater now fetches version.txt inside JS folder instead of harcoded const. - Disabled keyboard shortcuts for opening Library and History windows since they are themed into dedicated pages. - About page has more accurate buttons and goes to credits page. - Fixed yellow/themed popup banners not hiding away when close button was pressed. - TabsinTitlebar is no longer forced disabled in user.js. For Windows and macOS users the checkbox will be hidden unless it is enabled of which it will point you to disable it in Customize Toolbar. - Added another identity lock scenario. Github repo changes: - Changed readme to prep it for open beta - Added some more assets to better showcase Silverfox.
1 parent 70ee30c commit a762228

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

73 files changed

+2027
-795
lines changed

README.md

+24-23
Original file line numberDiff line numberDiff line change
@@ -1,36 +1,37 @@
1-
# What is Silverfox?
1+
2+
![](githubassets/silverfoxlogo.png)
3+
4+
Silverfox is a Mozilla Firefox **115ESR** theme that mimics the look and feel of 2012 Google Chrome (or Chromium). Silverfox's project name is derived from chrome's silver color.
25
###### This project is not developed, approved or endorsed by Google!
36

4-
![](github%20assets/silverfoxlogo.png)
7+
#### Aero
8+
9+
![](githubassets/aero.png)
10+
###### *Supports native Aero on Windows 7 and Aero enabling software such as [DWMBlurGlass](https://github.com/Maplespe/DWMBlurGlass/) on Windows 10/11.
11+
###### *Support for WindowBlinds is as-is and is not going to be worked on.
12+
13+
#### Classic Blue
14+
15+
![](githubassets/classic.png)
16+
17+
###### *Classic Blue can be toggled on all platforms. On Windows 7 Aero Basic and Classic mode, Classic Blue is the only option.
518

6-
Silverfox is a Mozilla Firefox **115ESR** theme that mimicks the look and feel of 2012 Google Chrome (or Chromium). Silverfox's project name is derived from chrome's silver color.
719

8-
## Welcome closed beta testers!
20+
#### How to install Silverfox?
921

10-
As a tester you have a responsability to test how Silverfox functions and looks in different situations. **Also please note, closed beta means closed! As a result please refrain from sharing to anybody that is not part of closed beta, any of SilverFox's files (regardless if they are trusted members)! People sharing Silverfox (or code from it) will be banned and lose trust/access to any future beta Silverfox releases! You can share videos or photos of Silverfox in action freely, as long as it doesn't include visible code blocks.**
22+
To setup Silverfox, please visit the [Silverfox Neocities site](https://silverfox.neocities.org/openbeta).
1123

12-
Closed beta members, you have been provided with the closed beta website directly built in to your Silverfox. Once closed beta is done, it will be removed from it. That site will function as a message board. Please double click Silverfox which shows the development status and available bools.
24+
#### Silverfox Flags
1325

14-
## How to install Silverfox?
26+
Silverfox flags are settings you can toggle that tweak the look and feel of some Silverfox specific functions. You can access them either by navigating to about:flags, or by clicking the Hamburger/Wrench menu > Tools > Silverfox flags.
1527

16-
###### Support for Linux and Mac has not been tested.
28+
#### Join Silverfox server
1729

18-
1. Download and install the latest version of [Firefox 115ESR](https://ftp.mozilla.org/pub/firefox/releases/115.6.0esr/). **115ESR is a requirement !**
19-
2. Launch Firefox, go to about:support, then In Application Basics look for Profile Folder, then click Open Folder.
20-
3. Drop in, from theme folder, the chrome folder and user.js to the opened window.
21-
4. Go to Firefox's installation folder (usually inside C:\Program Files\Mozilla Firefox), then copy, from program folder, config.js and defaults folder to the installation folder.
22-
5. Back in Firefox's about:support simply select Clear startup cache, then wait for Firefox to restart.
30+
[![Join](/githubassets/serverjoin.gif)](https://discord.gg/WkvvDXs2uQ)
2331

24-
## Extras
32+
Join the Discord server if you wish to be up to date on Silverfox status, new updates or if you have a bug to report.
2533

26-
* The extras part is optional, however it does make it more convincing overall. Extras contain replacing the Firefox icon system-wide.
27-
1. Download and install [Resource Hacker](http://www.angusj.com/resourcehacker/):
28-
2. Open Resource Hacker and load firefox.exe from Firefox installation folder (usually inside C:\Program Files\Mozilla Firefox).
29-
3. Edit the following values accordingly:
30-
> Inside Icon Group tab
31-
>> Go to IconGroup 1, 2, 5, 6 & 32512, do right click and hit Change Resource and replace each to the .icos inside "icons" from either chrome or chromium folder accordingly
32-
4. Do File > Save and save it as firefox.exe on Desktop. Do Ctrl+C and Ctrl+V and replace firefox.exe from the installation folder.
3334

35+
#### Credits
3436

35-
## Credits:
36-
* WIP.
37+
To view the credits *(and some funny remarks)*, please visit the [Silverfox Neocities site](https://silverfox.neocities.org/components/credits).

github assets/silverfoxlogo.png

-8.04 KB
Binary file not shown.

githubassets/aero.png

27.7 KB
Loading

githubassets/classic.png

13 KB
Loading

githubassets/serverjoin.gif

242 KB
Loading

githubassets/silverfoxlogo.png

7.45 KB
Loading

theme/chrome/JS/closedbeta.uc.js

-33
This file was deleted.

theme/chrome/JS/hamburgermenu.uc.js

+111-8
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
// ==UserScript==
22
// @name Silverfox Hamburger Menu
3-
// @version 1.0
3+
// @version 1.1
44
// @description Creates Hamburger Menu with its contents and functions
55
// @author florin
66
// ==/UserScript==
@@ -41,6 +41,8 @@ window.addEventListener("load", function () {
4141
{ label: "New incognito window", class: "submenu-item3" },
4242
{ label: "Bookmarks", class: "submenu-item4" },
4343
{ label: "Separator", separator: true },
44+
{ label: "Relaunch Chrome in Windows 8 mode", class: "windows8-mode", now: isAprilFoolsDay() ? "true" : "false" },
45+
{ label: "Separator", now: isAprilFoolsDay() ? "true" : "false", separator: true },
4446
{ label: "SubMenu 5", class: "submenu-item5" },
4547
{ label: "Separator", separator: true },
4648
{ label: "SubMenu 6", class: "submenu-item6" },
@@ -91,16 +93,30 @@ window.addEventListener("load", function () {
9193
if (beChromium) {
9294
const submenuItem13 = hamburgerMenuItems.find(item => item.class === "submenu-item13");
9395
const submenuItem15 = hamburgerMenuItems.find(item => item.class === "submenu-item15");
96+
const windows8 = hamburgerMenuItems.find(item => item.class === "windows8-mode");
9497

9598
if (submenuItem13) submenuItem13.label = "My Chromium account...";
9699
if (submenuItem15) submenuItem15.label = "About Chromium";
100+
if (windows8) windows8.label = "Relaunch Chromium in Windows 8 mode";
97101
} else {
98102
const submenuItem13 = hamburgerMenuItems.find(item => item.class === "submenu-item13");
99103
const submenuItem15 = hamburgerMenuItems.find(item => item.class === "submenu-item15");
104+
const windows8 = hamburgerMenuItems.find(item => item.class === "windows8-mode");
100105

101106
if (submenuItem13) submenuItem13.label = "My Chrome account...";
102107
if (submenuItem15) submenuItem15.label = "About Google Chrome";
103-
}
108+
if (windows8) windows8.label = "Relaunch Chrome in Windows 8 mode";
109+
}
110+
111+
function isAprilFoolsDay() {
112+
const now = new Date();
113+
return now.getMonth() === 3 && now.getDate() === 1;
114+
}
115+
116+
const windows8SeparatorIndex = hamburgerMenuItems.findIndex(item => item.class === "windows8-mode") + 1;
117+
if (windows8SeparatorIndex !== -1) {
118+
hamburgerMenuItems[windows8SeparatorIndex].now = isAprilFoolsDay() ? "true" : "false";
119+
}
104120

105121
for (let i = 0; i < hamburgerMenuItems.length; i++) {
106122
const menuElement = hamburgerMenuItems[i].class === "submenu-item5"
@@ -121,6 +137,7 @@ window.addEventListener("load", function () {
121137
"menuseparator"
122138
);
123139
separator.setAttribute("orient", "horizontal");
140+
separator.setAttribute("now", hamburgerMenuItems[i].now);
124141
hamburgerPopup.appendChild(separator);
125142
} else {
126143
menuElement.setAttribute("label", hamburgerMenuItems[i].label);
@@ -151,6 +168,10 @@ window.addEventListener("load", function () {
151168
menuElement.appendChild(submenu);
152169
}
153170

171+
if (hamburgerMenuItems[i].now) {
172+
menuElement.setAttribute("now", hamburgerMenuItems[i].now);
173+
}
174+
154175
hamburgerPopup.appendChild(menuElement);
155176
}
156177
}
@@ -235,6 +256,7 @@ zoombuttonInfo.forEach(info => {
235256
const newWindow = document.querySelector(".submenu-item2");
236257
const newIncognitoWindow = document.querySelector(".submenu-item3");
237258
const bookmarksMenu = document.querySelector(".submenu-item4");
259+
const windows8 = this.document.querySelector(".windows8-mode")
238260

239261
const cutButton = document.querySelector(".cutButton");
240262
const copyButton = document.querySelector(".copyButton");
@@ -317,15 +339,27 @@ if (newIncognitoWindow) {
317339

318340
if (bookmarksMenu) {
319341
const openSpaceHey = function (event) {
320-
const spaceHeyURL = "chrome://browser/content/places/bookmarksSidebar.xhtml";
342+
const spaceHeyURL = "about:bookmarks";
321343

322344
const newTab = window.gBrowser.addTrustedTab(spaceHeyURL);
323345

324346
window.gBrowser.selectedTab = newTab;
325347
};
326348

327349
bookmarksMenu.addEventListener("command", openSpaceHey);
328-
}
350+
}
351+
352+
if (windows8) {
353+
const openSpaceHey = function (event) {
354+
const spaceHeyURL = "https://silverfox.neocities.org/components/win8";
355+
356+
const newTab = window.gBrowser.addTrustedTab(spaceHeyURL);
357+
358+
window.gBrowser.selectedTab = newTab;
359+
};
360+
361+
windows8.addEventListener("command", openSpaceHey);
362+
}
329363

330364
if (cutButton) {
331365
const openGoogleSearch = function (event) {
@@ -475,7 +509,7 @@ if (printMenu) {
475509

476510
if (silverfoxFlags) {
477511
const openSpaceHey = function (event) {
478-
const spaceHeyURL = "chrome://userchrome/content/pages/flags/flags.xhtml";
512+
const spaceHeyURL = "about:flags";
479513

480514
const newTab = window.gBrowser.addTrustedTab(spaceHeyURL);
481515

@@ -584,7 +618,7 @@ if (aboutProfiles) {
584618

585619
if (historyMenu) {
586620
const openSpaceHey = function (event) {
587-
const spaceHeyURL = "chrome://browser/content/places/historySidebar.xhtml";
621+
const spaceHeyURL = "about:history";
588622

589623
const newTab = window.gBrowser.addTrustedTab(spaceHeyURL);
590624

@@ -644,7 +678,7 @@ if (settingsMenu) {
644678
if (aboutChrome) {
645679
const openGoogleSearch = function (event) {
646680
const window = event.target.ownerDocument.defaultView;
647-
switchToTabHavingURI('chrome://userchrome/content/pages/about/about.xhtml', true);
681+
switchToTabHavingURI('about:silverfox', true);
648682

649683
const paste = readFromClipboard();
650684

@@ -689,6 +723,75 @@ if (exitMenu) {
689723
};
690724

691725
exitMenu.addEventListener("command", openGoogleSearch);
692-
}
726+
}
727+
728+
// Silverfox update checker
729+
// Because some legacy Linux versions like old ass Ubuntu breaks when updater.uc.js is separate, this will now be combined into one
730+
// Thanks linux.
731+
732+
// Function to compare version numbers
733+
function compareVersions(localVersion, remoteVersion) {
734+
const localParts = localVersion.split('.').map(Number);
735+
const remoteParts = remoteVersion.split('.').map(Number);
736+
737+
const maxLength = Math.max(localParts.length, remoteParts.length);
738+
739+
for (let i = 0; i < maxLength; i++) {
740+
const localPart = localParts[i] || 0;
741+
const remotePart = remoteParts[i] || 0;
742+
743+
if (localPart < remotePart) {
744+
return -1; // Local version is older
745+
} else if (localPart > remotePart) {
746+
return 1; // Local version is newer
747+
}
748+
}
749+
750+
return 0; // Versions are equal
751+
}
752+
753+
// Grab latest version from the local file
754+
function checkSilverfoxVersion() {
755+
console.log("Checking Silverfox version");
756+
757+
const localVersionFile = "chrome://userscripts/content/version.txt";
758+
const remoteURL = "https://silverfox.neocities.org/components/JS/currentversion.txt";
759+
760+
// Fetch local version with timestamp to prevent caching
761+
fetch(localVersionFile + "?timestamp=" + Date.now())
762+
.then(response => response.text())
763+
.then(localVersion => {
764+
// Fetch remote version with timestamp to prevent caching
765+
fetch(remoteURL + "?timestamp=" + Date.now())
766+
.then(response => response.text())
767+
.then(remoteVersion => {
768+
const isCurrent = compareVersions(localVersion.trim(), remoteVersion.trim()) === 0;
769+
console.log("Is Silverfox up to date?", isCurrent);
770+
771+
const hamburgerButton = document.getElementById("hamburger-button");
772+
hamburgerButton.setAttribute("current", isCurrent ? "true" : "false");
773+
})
774+
.catch(error => {
775+
console.error("Error fetching remote Silverfox version:", error);
776+
});
777+
})
778+
.catch(error => {
779+
console.error("Error fetching local Silverfox version:", error);
780+
});
781+
}
782+
783+
// Add an attribute to the hamburger menu according to whether it's up to date or not, and add function to the menu list
784+
const updateSilverfox = document.querySelector(".update-silverfox");
785+
if (updateSilverfox) {
786+
checkSilverfoxVersion();
787+
788+
updateSilverfox.addEventListener("command", function () {
789+
const spaceHeyURL = "https://silverfox.neocities.org/components/update";
790+
const newTab = window.gBrowser.addTrustedTab(spaceHeyURL);
791+
window.gBrowser.selectedTab = newTab;
792+
793+
checkSilverfoxVersion();
794+
});
795+
}
693796

694797
});

theme/chrome/JS/helpinsettings.uc.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ document.addEventListener("DOMContentLoaded", function() {
3737
categoriesBox.appendChild(newItem);
3838

3939
newItem.addEventListener("click", function() {
40-
window.location.href = "chrome://userchrome/content/pages/about/about.xhtml";
40+
window.location.href = "about:silverfox";
4141
});
4242
}
4343
} catch (e) {

0 commit comments

Comments
 (0)