summarylogtreecommitdiffstats
path: root/replugged.patch
blob: 9c6a098a1e89f3920b361c7b68557af24af4b9c9 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
diff --git a/src/browserWindow.js b/src/browserWindow.js
index 82620e56..cafc41a0 100644
--- a/src/browserWindow.js
+++ b/src/browserWindow.js
@@ -28,7 +28,6 @@ class PatchedBrowserWindow extends BrowserWindow {
       if (opts.webPreferences.nativeWindowOpen) {
         // Discord Client
         opts.webPreferences.preload = join(__dirname, './preload.js');
-        opts.webPreferences.contextIsolation = false; // shrug
       } else {
         // Splash Screen on macOS (Host 0.0.262+) & Windows (Host 0.0.293 / 1.0.17+)
         opts.webPreferences.preload = join(__dirname, './preloadSplash.js');
diff --git a/src/fake_node_modules/powercord/constants.js b/src/fake_node_modules/powercord/constants.js
index 452712d5..8be6545a 100644
--- a/src/fake_node_modules/powercord/constants.js
+++ b/src/fake_node_modules/powercord/constants.js
@@ -1,5 +1,9 @@
 const { join } = require('path');
 
+const XDG_CONFIG_HOME = process.env.XDG_CONFIG_HOME || join(process.env.HOME, '.config');
+const XDG_CACHE_HOME  = process.env.XDG_CACHE_HOME  || join(process.env.HOME, '.cache');
+const XDG_DATA_HOME  = process.env.XDG_DATA_HOME    || join(process.env.HOME, '.local', 'share');
+
 module.exports = Object.freeze({
   // Powercord
   WEBSITE: 'https://powercord.dev',
@@ -7,9 +11,9 @@ module.exports = Object.freeze({
   REPO_URL: 'powercord-org/powercord',
 
   // Runtime
-  SETTINGS_FOLDER: join(__dirname, '..', '..', '..', 'settings'),
-  CACHE_FOLDER: join(__dirname, '..', '..', '..', '.cache'),
-  LOGS_FOLDER: join(__dirname, '..', '..', '..', '.logs'),
+  SETTINGS_FOLDER: join(XDG_CONFIG_HOME, 'replugged'),
+  CACHE_FOLDER: join(XDG_CACHE_HOME, 'replugged'),
+  LOGS_FOLDER: join(XDG_DATA_HOME, 'replugged', 'logs'),
 
   // Discord Server
   DISCORD_INVITE: 'gs4ZMbBfCh',
diff --git a/src/patcher.js b/src/patcher.js
index ba487630..e9b988a1 100644
--- a/src/patcher.js
+++ b/src/patcher.js
@@ -4,7 +4,7 @@ const { existsSync, unlinkSync } = require('fs');
 
 // Restore the classic path; The updater relies on it and it makes Discord go corrupt
 const electronPath = require.resolve('electron');
-const discordPath = join(dirname(require.main.filename), '..', 'app.asar');
+const discordPath = join('/', 'usr', 'lib', 'discord-canary', 'app.asar');
 require.main.filename = join(discordPath, 'app_bootstrap/index.js');
 
 const electron = require('electron');