Skip to content
This repository was archived by the owner on Jun 17, 2023. It is now read-only.

Commit feefe3a

Browse files
Merge pull request #232 from xhayper/patch-1
feat: properly update all dependencies
2 parents aa3ed2c + 73325a9 commit feefe3a

File tree

13 files changed

+7769
-3412
lines changed

13 files changed

+7769
-3412
lines changed

.gitignore

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -111,3 +111,14 @@ typings/
111111
# Options
112112
options.json
113113
.vscode/settings.json
114+
115+
# macOS
116+
.DS_Store
117+
118+
# yarn
119+
.yarn/*
120+
!.yarn/releases
121+
!.yarn/patches
122+
!.yarn/plugins
123+
!.yarn/sdks
124+
!.yarn/versions

.yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs

Lines changed: 541 additions & 0 deletions
Large diffs are not rendered by default.

.yarn/releases/yarn-3.3.0.cjs

Lines changed: 807 additions & 0 deletions
Large diffs are not rendered by default.

.yarnrc.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
plugins:
2+
- path: .yarn/plugins/@yarnpkg/plugin-interactive-tools.cjs
3+
spec: "@yarnpkg/plugin-interactive-tools"
4+
5+
yarnPath: .yarn/releases/yarn-3.3.0.cjs
6+
nodeLinker: node-modules

clientidDetect.js

Lines changed: 130 additions & 101 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,9 @@
1-
const electron = require('electron')
2-
const copy = require('copy-to-clipboard')
3-
var firstFlyout = false
1+
const copy = require("copy-to-clipboard");
2+
let firstFlyout = false;
43

54
document.addEventListener("DOMContentLoaded", () => {
6-
newflyout()
7-
addStyle(`
5+
newflyout();
6+
addStyle(`
87
.wrapper-3aJbIC,
98
[href="/developers/teams"],
109
[href="/developers/servers"],
@@ -28,115 +27,145 @@ document.addEventListener("DOMContentLoaded", () => {
2827
flex: 0 0 250px !important;
2928
}
3029
`);
31-
const targetNode = document.body;
30+
const targetNode = document.body;
3231

33-
// Options for the observer (which mutations to observe)
34-
let config = { characterData: false, attributes: false, childList: true, subtree: true };
32+
// Options for the observer (which mutations to observe)
33+
let config = {
34+
characterData: false,
35+
attributes: false,
36+
childList: true,
37+
subtree: true,
38+
};
3539

36-
// Create an observer instance linked to the callback function
37-
const observer = new MutationObserver(callback);
40+
// Create an observer instance linked to the callback function
41+
const observer = new MutationObserver(callback);
3842

39-
// Start observing the target node for configured mutations
40-
observer.observe(targetNode, config);
41-
42-
})
43+
// Start observing the target node for configured mutations
44+
observer.observe(targetNode, config);
45+
});
4346

4447
document.addEventListener("click", () => {
45-
callback()
46-
})
48+
callback();
49+
});
4750

48-
const callback = function (mutationsList) {
49-
console.log("change")
51+
const callback = () => {
52+
console.log("change");
5053

51-
let prevflyout = document.querySelector("#drpcm-hint-flyout")
52-
if (prevflyout == null && firstFlyout == false) {
53-
try {
54-
setTimeout(newflyout, 2000)
55-
firstFlyout = true
56-
} catch (e) {
57-
//firstFlyout = false
58-
}
59-
}
54+
let prevflyout = document.querySelector("#drpcm-hint-flyout");
55+
if (prevflyout == null && firstFlyout == false) {
6056
try {
61-
/*if (window.location.href == "https://discord.com/developers/applications") {*/
62-
setTimeout(acuallyEndPoorElements, 2000)
63-
setTimeout(modifyText, 2000)
64-
/*} else {*/
65-
//acuallyEndPoorElements()
66-
//modifyText()
67-
/*}*/
68-
69-
} catch (e) { }
70-
setTimeout(() => {
71-
let prevflyout = document.querySelector("#drpcm-hint-flyout")
72-
let clientid = document.querySelector(".code-j7WzRK")
73-
let fly = document.querySelector("#drpcm-success-flyout")
74-
if (clientid !== null && fly == null) {
75-
console.log("detected clientid")
76-
let id = clientid.innerText
77-
if (prevflyout !== null) { prevflyout.remove() }
78-
makeflyout(`
57+
setTimeout(newflyout, 2000);
58+
firstFlyout = true;
59+
} catch (e) {
60+
//firstFlyout = false
61+
}
62+
}
63+
try {
64+
/*if (window.location.href == "https://discord.com/developers/applications") {*/
65+
setTimeout(acuallyEndPoorElements, 2000);
66+
setTimeout(modifyText, 2000);
67+
/*} else {*/
68+
//acuallyEndPoorElements()
69+
//modifyText()
70+
/*}*/
71+
} catch (e) {}
72+
setTimeout(() => {
73+
let prevflyout = document.querySelector("#drpcm-hint-flyout");
74+
let clientid = document.querySelector(".code-j7WzRK");
75+
let fly = document.querySelector("#drpcm-success-flyout");
76+
if (clientid !== null && fly === null) {
77+
console.log("detected clientid");
78+
let id = clientid.innerText;
79+
if (prevflyout !== null) {
80+
prevflyout.remove();
81+
}
82+
makeflyout(
83+
`
7984
Detected Client ID, copied to clipboard!
8085
<code style = "font-family: monospace; background: #313131; padding: 5px; border-radius: 5px;">${id}</code>
81-
`, "drpcm-success-flyout")
82-
copy(id)
83-
setTimeout(() => {document.querySelector("#drpcm-success-flyout").remove()}, "10000")
84-
document.querySelector(".backToLink-UqPo19").addEventListener("click", () => {
85-
console.log("back")
86-
firstFlyout = false
87-
document.querySelector("#drpcm-success-flyout").remove()
88-
})
89-
}
90-
document.querySelector(".alert-2Ffs8r.warning-2eRcFb").innerHTML = `<span style="color: white !important;">Uploading/deleting can sometimes take 1-2 minutes depending on Discord's servers. After uploading an image, you cannot change its name.</span>`
91-
}, 500)
92-
93-
86+
`,
87+
"drpcm-success-flyout"
88+
);
89+
copy(id);
90+
setTimeout(() => {
91+
document.querySelector("#drpcm-success-flyout").remove();
92+
}, "10000");
93+
document
94+
.querySelector(".backToLink-UqPo19")
95+
.addEventListener("click", () => {
96+
console.log("back");
97+
firstFlyout = false;
98+
document.querySelector("#drpcm-success-flyout").remove();
99+
});
100+
}
101+
document.querySelector(
102+
".alert-2Ffs8r.warning-2eRcFb"
103+
).innerHTML = `<span style="color: white !important;">Uploading/deleting can sometimes take 1-2 minutes depending on Discord's servers. After uploading an image, you cannot change its name.</span>`;
104+
}, 500);
94105
};
95106

96-
function newflyout() {
97-
let prevflyout = document.querySelector("#drpcm-hint-flyout")
98-
if (prevflyout !== null) { prevflyout.remove() }
99-
if (window.location.href == "https://discord.com/developers/applications") {
100-
makeflyout("Go to your desired application, and the Client ID will be detected automatically! ", "drpcm-hint-flyout")
101-
}
102-
}
107+
const newflyout = () => {
108+
let prevflyout = document.querySelector("#drpcm-hint-flyout");
109+
if (prevflyout !== null) {
110+
prevflyout.remove();
111+
}
112+
if (window.location.href == "https://discord.com/developers/applications") {
113+
makeflyout(
114+
"Go to your desired application, and the Client ID will be detected automatically! ",
115+
"drpcm-hint-flyout"
116+
);
117+
}
118+
};
103119

104-
function makeflyout(html, id) {
105-
let flyout = document.createElement("div")
106-
flyout.id = id
107-
flyout.innerHTML = html + `<button style = "color: white; cursor: pointer; font-weight: bold;" onclick="this.parentElement.style.display = 'none'">&times;</button>`
108-
flyout.style.position = "absolute"
109-
flyout.style.zIndex = "999"
110-
flyout.style.bottom = "0"
111-
flyout.style.right = "0"
112-
flyout.style.margin = "1rem"
113-
flyout.style.background = "#202225"
114-
flyout.style.borderRadius = "5px"
115-
flyout.style.padding = "1rem"
116-
document.body.appendChild(flyout)
117-
}
120+
const makeflyout = (html, id) => {
121+
let flyout = document.createElement("div");
122+
flyout.id = id;
123+
flyout.innerHTML =
124+
html +
125+
`<button style = "color: white; cursor: pointer; font-weight: bold;" onclick="this.parentElement.style.display = 'none'">&times;</button>`;
126+
flyout.style.position = "absolute";
127+
flyout.style.zIndex = "999";
128+
flyout.style.bottom = "0";
129+
flyout.style.right = "0";
130+
flyout.style.margin = "1rem";
131+
flyout.style.background = "#202225";
132+
flyout.style.borderRadius = "5px";
133+
flyout.style.padding = "1rem";
134+
document.body.appendChild(flyout);
135+
};
118136

119-
function modifyText() {
120-
if (document.querySelector(".flush-zNaLgf") !== null && document.querySelector(".wordmark-1G98vs").innerText != "Discord RPC Developer Portal") {
121-
document.querySelector(".flush-zNaLgf").innerText = "Click 'New Application' to create a new presence, or select an already created one below"
122-
document.querySelector(".wordmark-1G98vs").innerText = "Discord RPC Developer Portal"
123-
let clientid = document.querySelector(".code-j7WzRK")
124-
document.querySelector(".button-38aScr").addEventListener("click", () => {
125-
let aaa = document.getElementsByClassName('medium-zmzTW- weightNormal-3CX1dN')
126-
aaa[0].innerText = "This is what your presence will be called."
127-
})
137+
const modifyText = () => {
138+
if (
139+
document.querySelector(".flush-zNaLgf") !== null &&
140+
document.querySelector(".wordmark-1G98vs").innerText !=
141+
"Discord RPC Developer Portal"
142+
) {
143+
document.querySelector(".flush-zNaLgf").innerText =
144+
"Click 'New Application' to create a new presence, or select an already created one below";
145+
document.querySelector(".wordmark-1G98vs").innerText =
146+
"Discord RPC Developer Portal";
147+
let clientid = document.querySelector(".code-j7WzRK");
148+
document.querySelector(".button-38aScr").addEventListener("click", () => {
149+
let aaa = document.getElementsByClassName(
150+
"medium-zmzTW- weightNormal-3CX1dN"
151+
);
152+
aaa[0].innerText = "This is what your presence will be called.";
153+
});
154+
}
155+
};
128156

129-
}
130-
}
157+
const acuallyEndPoorElements = () => {
158+
if (
159+
window.location.href.includes("rich-presence/assets") &&
160+
document.querySelectorAll(".marginBottomMedium-3rCQQt").length > 2
161+
) {
162+
document.querySelectorAll(".marginBottomMedium-3rCQQt")[1].remove();
163+
document.querySelectorAll(".marginBottomMedium-3rCQQt")[0].remove();
164+
}
165+
};
131166

132-
function acuallyEndPoorElements() {
133-
if (window.location.href.includes("rich-presence/assets") && document.querySelectorAll(".marginBottomMedium-3rCQQt").length > 2) {
134-
document.querySelectorAll(".marginBottomMedium-3rCQQt")[1].remove()
135-
document.querySelectorAll(".marginBottomMedium-3rCQQt")[0].remove()
136-
}
137-
}
138-
function addStyle(styleString) {
139-
const style = document.createElement('style');
140-
style.textContent = styleString;
141-
document.head.append(style);
142-
}
167+
const addStyle = (styleString) => {
168+
const style = document.createElement("style");
169+
style.textContent = styleString;
170+
document.head.append(style);
171+
};

forge.config.js

Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
1+
module.exports = {
2+
packagerConfig: {
3+
icon: "./assets/icon",
4+
},
5+
],
6+
makers: [
7+
{
8+
name: "@electron-forge/maker-squirrel",
9+
config: {},
10+
},
11+
{
12+
name: "@electron-forge/maker-dmg",
13+
},
14+
{
15+
name: "@electron-forge/maker-deb",
16+
config: {
17+
options: {
18+
icon: "./assets/icon.png",
19+
},
20+
},
21+
},
22+
{
23+
name: "@electron-forge/maker-rpm",
24+
config: {
25+
options: {
26+
icon: "./assets/icon.png",
27+
},
28+
},
29+
},
30+
],
31+
};

index.html

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,8 @@
44
<head>
55
<meta charset="UTF-8">
66
<title>Discord RPC Maker</title>
7+
<link ref="preconnect" href="https://kit.fontawesome.com/" crossorigin>
8+
<link ref="dns-prefetch" href="https://kit.fontawesome.com/" crossorigin>
79
<script src="https://kit.fontawesome.com/f64c2e88c7.js" crossorigin="anonymous"></script>
810
<meta http-equiv="Content-Security-Policy" content="script-src 'self' 'unsafe-inline';" />
911
<link rel="stylesheet" href="style/normalize.css">

0 commit comments

Comments
 (0)