From 45fb0664dfd9599b57ac6b8488e46f9e71963de3 Mon Sep 17 00:00:00 2001 From: Zack Rauen Date: Sun, 26 Sep 2021 13:05:19 -0400 Subject: [PATCH] Audit and close #1059 --- injector/package-lock.json | 6 +++--- injector/src/preload.js | 26 +++++++++++--------------- package-lock.json | 14 +++++++------- renderer/package-lock.json | 6 +++--- 4 files changed, 24 insertions(+), 28 deletions(-) diff --git a/injector/package-lock.json b/injector/package-lock.json index 1658f8ec..4cc9a9a4 100644 --- a/injector/package-lock.json +++ b/injector/package-lock.json @@ -1443,9 +1443,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-type": { diff --git a/injector/src/preload.js b/injector/src/preload.js index f5cf245d..cb59ae7f 100644 --- a/injector/src/preload.js +++ b/injector/src/preload.js @@ -24,23 +24,19 @@ electron.webFrame.top.context.global = electron.webFrame.top.context; electron.webFrame.top.context.require = require; electron.webFrame.top.context.Buffer = Buffer; -if (process.platform === "darwin" && process.env.DISCORD_RELEASE_CHANNEL !== "canary") { - electron.webFrame.top.context.process = process; -} -else { - electron.webFrame.top.context.process = new class PatchedProcess extends NodeEvents { - get __ORIGINAL_PROCESS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__() {return process;} - constructor() { - super(); +electron.webFrame.top.context.process = new class PatchedProcess extends NodeEvents { + get __ORIGINAL_PROCESS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED__() {return process;} - Object.assign(this, - cloneObject(process, {}, Object.keys(NodeEvents.prototype)), - cloneObject(process, {}) - ); - } - }; -} + constructor() { + super(); + + Object.assign(this, + cloneObject(process, {}, Object.keys(NodeEvents.prototype)), + cloneObject(process, {}) + ); + } +}; // Load Discord's original preload const preload = process.env.DISCORD_PRELOAD; diff --git a/package-lock.json b/package-lock.json index 4f732590..82f5b422 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,6 +1,6 @@ { "name": "betterdiscord", - "version": "1.2.0", + "version": "1.2.1", "lockfileVersion": 1, "requires": true, "dependencies": { @@ -791,9 +791,9 @@ } }, "glob-parent": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.1.tgz", - "integrity": "sha512-FnI+VGOpnlGHWZxthPGR+QhR78fuiK0sNLkHQv+bL9fQi57lNNdquIbna/WrfROrolq8GK5Ek6BiMwqL/voRYQ==", + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", + "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", "dev": true, "requires": { "is-glob": "^4.0.1" @@ -1352,9 +1352,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "picomatch": { diff --git a/renderer/package-lock.json b/renderer/package-lock.json index f51b3ed2..a846dd3d 100644 --- a/renderer/package-lock.json +++ b/renderer/package-lock.json @@ -5800,9 +5800,9 @@ "dev": true }, "path-parse": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", - "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.7.tgz", + "integrity": "sha512-LDJzPVEEEPR+y48z93A0Ed0yXb8pAByGWo/k5YYdYgpY2/2EsOsksJrq7lOHxryrVOn1ejG6oAp8ahvOIQD8sw==", "dev": true }, "path-type": {