Skip to content

Commit

Permalink
Merge pull request #148 from TheKing-OfTime/master
Browse files Browse the repository at this point in the history
  • Loading branch information
cucumber-sp authored Jan 27, 2025
2 parents 837e8ec + 80df8fb commit e40c300
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -42,16 +42,18 @@ diff --git a/main/lib/createWindow.js b/main/lib/createWindow.js
diff --git a/main/lib/preload.js b/main/lib/preload.js
--- a/main/lib/preload.js
+++ b/main/lib/preload.js
@@ -7,10 +7,12 @@ const deviceInfo_js_1 = require("./deviceInfo.js");
@@ -7,10 +7,14 @@ const deviceInfo_js_1 = require("./deviceInfo.js");
const theme_js_1 = require("../types/theme.js");
const hostnamePatterns_js_1 = require("../constants/hostnamePatterns.js");
const deviceInfo = (0, deviceInfo_js_1.getDeviceInfo)();
+const customTitleBar = process.env.CUSTOM_TITLE_BAR && process.env.CUSTOM_TITLE_BAR > 0;
+const devTools = process.env.DEV_TOOLS && process.env.DEV_TOOLS > 0;
electron_1.contextBridge.exposeInMainWorld('VERSION', String(config_js_1.config.buildInfo.VERSION));
electron_1.contextBridge.exposeInMainWorld('BRANCH', String(config_js_1.config.buildInfo.BRANCH));
electron_1.contextBridge.exposeInMainWorld('PLATFORM', deviceInfo.os);
electron_1.contextBridge.exposeInMainWorld('DEVICE_INFO', deviceInfo);
+electron_1.contextBridge.exposeInMainWorld('CUSTOM_TITLE_BAR', customTitleBar);
+electron_1.contextBridge.exposeInMainWorld('IS_DEVTOOLS_ENABLED', devTools);
electron_1.contextBridge.exposeInMainWorld('desktopEvents', {
send(name, ...args) {
electron_1.ipcRenderer.send(name, ...args);
3 changes: 2 additions & 1 deletion repack.sh
Original file line number Diff line number Diff line change
Expand Up @@ -72,8 +72,9 @@ find "./" -type f \( -name "*.js" -o -name "*.js.map" \) -print0 | while IFS= re
# Use 'sed' to perform the replacement in-place
sed -i 's/l.isLinuxApplication/(window.CUSTOM_TITLE_BAR)/g' "$file"
sed -i 's/o.isLinuxApplication/(window.CUSTOM_TITLE_BAR)/g' "$file"
sed -i 's/panel:!1,allowOverwriteExperiments:!1/panel:window.IS_DEVTOOLS_ENABLED??!1,allowOverwriteExperiments:window.IS_DEVTOOLS_ENABLED??!1/g' "$file"
done
echo "OS spoofed"
echo ".js chunks patched"

# fixing titile
echo "Fixing Title"
Expand Down

0 comments on commit e40c300

Please sign in to comment.