From 0e5a8e034ceb26a8111bae01a15b3f7da0a395b5 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 18 Jul 2022 13:24:30 +0000
Subject: [PATCH 1/4] Update ws requirement from ^8.8.0 to ^8.8.1
Updates the requirements on [ws](https://github.com/websockets/ws) to permit the latest version.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.8.0...8.8.1)
---
updated-dependencies:
- dependency-name: ws
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 2cf0a0b..92abc28 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
"electron-context-menu": "github:ArmCord/electron-context-menu",
"os-locale": "^6.0.2",
"v8-compile-cache": "^2.3.0",
- "ws": "^8.8.0"
+ "ws": "^8.8.1"
},
"build": {
"appId": "com.smartfridge.armcord",
From 0fb71dfe2b8a723d3879ddc0a8e7918ee652cac0 Mon Sep 17 00:00:00 2001
From: smartfridge <37928912+smartfrigde@users.noreply.github.com>
Date: Mon, 18 Jul 2022 17:13:52 +0200
Subject: [PATCH 2/4] Add Cordwood, better Hummus support and skip splash
---
src/extensions/mods.ts | 2 +-
src/preload/preload.ts | 16 +++++++++++++---
src/preload/titlebar.ts | 39 ++++++++++++++++++++++++++++++++++++++
src/settings/settings.html | 14 ++++++++++++--
src/utils.ts | 2 ++
src/window.ts | 24 ++++++++++++++++++++++-
6 files changed, 90 insertions(+), 7 deletions(-)
diff --git a/src/extensions/mods.ts b/src/extensions/mods.ts
index fb2c5c2..9821a12 100644
--- a/src/extensions/mods.ts
+++ b/src/extensions/mods.ts
@@ -28,7 +28,7 @@ const unstrictCSP = () => {
"https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js",
"https://raw.githubusercontent.com/Cumcord/Cumcord/master/dist/build.js",
"https://raw.githubusercontent.com/FlickerMod/dist/main/build.js",
- "https://localhost:1234/dist.js"
+ "https://raw.githubusercontent.com/Cordwood/builds/master/index.js"
];
electron.session.defaultSession.webRequest.onHeadersReceived(({responseHeaders, url}, done) => {
diff --git a/src/preload/preload.ts b/src/preload/preload.ts
index ac6ccf7..52cf93e 100644
--- a/src/preload/preload.ts
+++ b/src/preload/preload.ts
@@ -3,7 +3,7 @@ import "./capturer";
import "./patch";
import * as fs from "fs";
import * as path from "path";
-import {injectTitlebar} from "./titlebar";
+import {injectHummusTitlebar, injectTitlebar} from "./titlebar";
import {sleep, addStyle, injectJS, addScript} from "../utils";
import {ipcRenderer} from "electron";
import {injectMobileStuff} from "./mobile";
@@ -25,7 +25,8 @@ declare global {
const clientMods = {
goosemod: "https://api.goosemod.com/inject.js",
cumcord: "https://raw.githubusercontent.com/Cumcord/Cumcord/stable/dist/build.js",
- flicker: "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js"
+ flicker: "https://raw.githubusercontent.com/FlickerMod/dist/main/build.js",
+ cordwood: "https://raw.githubusercontent.com/Cordwood/builds/master/index.js"
};
console.log("ArmCord " + version);
@@ -36,7 +37,11 @@ if (window.location.href.indexOf("splash.html") > -1) {
console.log("Skipping titlebar injection and client mod injection.");
} else {
if (ipcRenderer.sendSync("titlebar")) {
- injectTitlebar();
+ if (ipcRenderer.sendSync("channel")) {
+ injectHummusTitlebar();
+ } else {
+ injectTitlebar();
+ }
}
if (ipcRenderer.sendSync("mobileMode")) {
injectMobileStuff();
@@ -61,6 +66,11 @@ if (window.location.href.indexOf("splash.html") > -1) {
console.log("Loading FlickerMod...");
await updateLang();
break;
+ case "cordwood":
+ injectJS(clientMods.cordwood);
+ console.log("Loading Cordwood...");
+ await updateLang();
+ break;
}
});
}
diff --git a/src/preload/titlebar.ts b/src/preload/titlebar.ts
index a3fe1bc..bd54ef6 100644
--- a/src/preload/titlebar.ts
+++ b/src/preload/titlebar.ts
@@ -54,3 +54,42 @@ export function injectTitlebar() {
});
});
}
+export function injectHummusTitlebar() {
+ document.addEventListener("DOMContentLoaded", function (event) {
+ var elem = document.createElement("div");
+ elem.innerHTML = `
+
+ `;
+ elem.classList.add("win-buttons");
+ elem.classList.add("win-buttons-light");
+ document.getElementsByClassName("titlebar")[0].appendChild(elem);
+ document.body.setAttribute("customTitlebar", "");
+ document.body.setAttribute("armcord-platform", os.platform());
+ addStyle(".chat>.title-wrap {width: 87% !important;}");
+ addStyle(".friends-header {width: 91% !important;}");
+ var minimize = document.getElementById("minimize");
+ var maximize = document.getElementById("maximize");
+ var quit = document.getElementById("quit");
+
+ minimize!.addEventListener("click", () => {
+ ipcRenderer.send("win-minimize");
+ });
+
+ maximize!.addEventListener("click", () => {
+ if (ipcRenderer.sendSync("win-isMaximized") == true) {
+ ipcRenderer.send("win-unmaximize");
+ document.body.removeAttribute("isMaximized");
+ } else if (ipcRenderer.sendSync("win-isNormal") == true) {
+ ipcRenderer.send("win-maximize");
+ }
+ });
+
+ quit!.addEventListener("click", () => {
+ if (ipcRenderer.sendSync("minimizeToTray") === true) {
+ ipcRenderer.send("win-hide");
+ } else if (ipcRenderer.sendSync("minimizeToTray") === false) {
+ ipcRenderer.send("win-quit");
+ }
+ });
+ });
+}
diff --git a/src/settings/settings.html b/src/settings/settings.html
index a75a8d2..355e8ff 100644
--- a/src/settings/settings.html
+++ b/src/settings/settings.html
@@ -112,8 +112,9 @@
PTB - public test build. Receives features earlier than stable but is a bit older than
Canary.
- Hummus - unofficial instance of Discord that takes you back to 2016! None of the client mods
- bundled with ArmCord work with it. It's run by community, so you take all the risk by using it.
+ Hummus - unofficial instance of Discord that takes you back to 2016! Only client mod
+ available to run alongside with it is Cordwood. It's run by community, so you take all the risk by
+ using it.
@@ -168,6 +169,13 @@
⚠️Advanced user zone⚠️
+
+
+
+
+
Skips ArmCord splash screen when you start up the app.
+
+
@@ -206,6 +214,7 @@
document.getElementById("tray").checked = await settings.get("minimizeToTray");
document.getElementById("websocket").checked = await settings.get("inviteWebsocket");
document.getElementById("alternativePaste").checked = await settings.get("alternativePaste");
+ document.getElementById("skipSplash").checked = await settings.get("skipSplash");
document.getElementById("mobile").checked = await settings.get("mobileMode");
document.getElementById("patches").value = await settings.get("automaticPatches");
document.getElementById("mod").value = await settings.get("mods");
@@ -222,6 +231,7 @@
armcordCSP: document.getElementById("csp").checked,
minimizeToTray: document.getElementById("tray").checked,
alternativePaste: document.getElementById("alternativePaste").checked,
+ skipSplash: document.getElementById("skipSplash").checked,
automaticPatches: document.getElementById("patches").checked,
mods: document.getElementById("mod").value,
mobileMode: document.getElementById("mobile").checked,
diff --git a/src/utils.ts b/src/utils.ts
index 759c1c9..9e7b619 100644
--- a/src/utils.ts
+++ b/src/utils.ts
@@ -42,6 +42,7 @@ export function setup() {
alternativePaste: false,
mods: "cumcord",
performanceMode: "none",
+ skipSplash: false,
inviteWebsocket: true,
mobileMode: false,
trayIcon: "ac_plug_colored",
@@ -191,6 +192,7 @@ export interface Settings {
alternativePaste: boolean;
mods: string;
mobileMode: boolean,
+ skipSplash: boolean,
performanceMode: string;
inviteWebsocket: boolean;
trayIcon: string;
diff --git a/src/window.ts b/src/window.ts
index 2ca3fdf..0a09cd2 100644
--- a/src/window.ts
+++ b/src/window.ts
@@ -126,7 +126,29 @@ async function doAfterDefiningTheWindow() {
mainWindow.setSize(390, 470);
await mainWindow.loadFile(path.join(__dirname, "/content/setup.html"));
} else {
- await mainWindow.loadFile(path.join(__dirname, "/content/splash.html"));
+ if (await getConfig("skipSplash") == true) {
+ switch (await getConfig("channel")) {
+ case "stable":
+ mainWindow.loadURL("https://discord.com/app");
+ break;
+ case "canary":
+ mainWindow.loadURL("https://canary.discord.com/app");
+ break;
+ case "ptb":
+ mainWindow.loadURL("https://ptb.discord.com/app");
+ break;
+ case "hummus":
+ mainWindow.loadURL("https://hummus.sys42.net/");
+ break;
+ case undefined:
+ mainWindow.loadURL("https://discord.com/app");
+ break;
+ default:
+ mainWindow.loadURL("https://discord.com/app");
+ }
+ } else {
+ await mainWindow.loadFile(path.join(__dirname, "/content/splash.html"));
+ }
}
}
export function createCustomWindow() {
From cb69a35dd63c149d6b55d24547e69c1791cf6f6b Mon Sep 17 00:00:00 2001
From: KayoticCarnige <32397453+kckarnige@users.noreply.github.com>
Date: Mon, 18 Jul 2022 14:53:25 -0400
Subject: [PATCH 3/4] 2 new things (Read desc.) (#159)
- Cleaned up ASAR packaging, ignoring unneeded files for building
- Moved install location for Windows users ("AppData\Local\Programs" -> "AppData\Local"
---
build/installer.nsh | 8 ++++++++
package.json | 11 +++++++++++
2 files changed, 19 insertions(+)
create mode 100644 build/installer.nsh
diff --git a/build/installer.nsh b/build/installer.nsh
new file mode 100644
index 0000000..06b5934
--- /dev/null
+++ b/build/installer.nsh
@@ -0,0 +1,8 @@
+!macro preInit
+ SetRegView 64
+ WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
+ WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
+ SetRegView 32
+ WriteRegExpandStr HKLM "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
+ WriteRegExpandStr HKCU "${INSTALL_REGISTRY_KEY}" InstallLocation "$LocalAppData\ArmCord"
+!macroend
\ No newline at end of file
diff --git a/package.json b/package.json
index 2cf0a0b..9d64bfe 100644
--- a/package.json
+++ b/package.json
@@ -40,6 +40,17 @@
"ws": "^8.8.0"
},
"build": {
+ "nsis": {
+ "include": "build/installer.nsh"
+ },
+ "files": [
+ "!*",
+ "assets",
+ "node_modules",
+ "ts-out",
+ "package.json",
+ "LICENSE"
+ ],
"appId": "com.smartfridge.armcord",
"productName": "ArmCord",
"mac": {
From 1ead7d6638ab06c1f2a39cf5795fd18e6a504205 Mon Sep 17 00:00:00 2001
From: "dependabot[bot]" <49699333+dependabot[bot]@users.noreply.github.com>
Date: Mon, 18 Jul 2022 18:54:47 +0000
Subject: [PATCH 4/4] Update ws requirement from ^8.8.0 to ^8.8.1
Updates the requirements on [ws](https://github.com/websockets/ws) to permit the latest version.
- [Release notes](https://github.com/websockets/ws/releases)
- [Commits](https://github.com/websockets/ws/compare/8.8.0...8.8.1)
---
updated-dependencies:
- dependency-name: ws
dependency-type: direct:production
...
Signed-off-by: dependabot[bot]
---
package.json | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/package.json b/package.json
index 9d64bfe..512a130 100644
--- a/package.json
+++ b/package.json
@@ -37,7 +37,7 @@
"electron-context-menu": "github:ArmCord/electron-context-menu",
"os-locale": "^6.0.2",
"v8-compile-cache": "^2.3.0",
- "ws": "^8.8.0"
+ "ws": "^8.8.1"
},
"build": {
"nsis": {