Skip to content

Commit 27d1361

Browse files
Bug fixes
1 parent 17d7e35 commit 27d1361

File tree

3 files changed

+15
-14
lines changed

3 files changed

+15
-14
lines changed

client/pages/main/script.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ ipcRenderer.on("executeScript", (_, { roomId, password, scriptContent } = {}) =>
142142
linux: "linux.sh"
143143
})[process.platform]), (options || {}).title || require(path.join(process.resourcesPath, "app.asar/package.json")).productName, body, (options || {}).defaultText || ((typeof options === "string") ? options : "")]).stdout.on('data', (promptData) => {
144144
if (!promptData.toString().startsWith("RETURN")) return;
145-
resolve(promptData.toString().substring(6));
145+
resolve(promptData.toString().substring(6, promptData.toString().length - 2));
146146
});
147147
});
148148
},

client/pages/scripts/script.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@ const crypto = parent.require("crypto");
66
const parsedEnvironmentVariables = parent.require("dotenv").config({ path: parent.require("path").join(parent.process.resourcesPath, "app.asar/.env") }).parsed;
77
let scriptEditor = ace.edit("scriptEditor");
88
scriptEditor.setTheme("ace/theme/monokai");
9+
scriptEditor.session.setUseWorker(false);
910
scriptEditor.session.setMode(new (ace.require('ace/mode/javascript')).Mode());
1011
scriptEditor.setOption("tabSize", 2);
1112
scriptEditor.on("change", () => {

client/pages/settings/script.js

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -58,7 +58,7 @@ Array.from(document.getElementsByClassName("slider")).forEach((slider) => {
5858
})[parent.process.platform]), "Custom WebRTC URL", "Please specify your resource server URL", parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_PROTOCOL + "//" + parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_HOSTNAME + ((parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_PORT) ? (":" + parsedEnvironmentVariables.DEFAULT_RESOURCE_SERVER_PORT) : "")]).stdout.on('data', (customResourceServerURL) => {
5959
try {
6060
if (!customResourceServerURL.toString().startsWith("RETURN")) return;
61-
if (!["http:", "https:"].includes(new URL(customResourceServerURL.toString().substring(6)).protocol)) throw alert("Invalid resource server URL");
61+
if (!["http:", "https:"].includes(new URL(customResourceServerURL.toString().substring(6, customResourceServerURL.toString().length - 2)).protocol)) throw alert("Invalid resource server URL");
6262
childProcess.spawn(({
6363
win32: "cscript",
6464
darwin: "osascript",
@@ -70,7 +70,7 @@ Array.from(document.getElementsByClassName("slider")).forEach((slider) => {
7070
})[parent.process.platform]), "Custom WebRTC URL", "Please specify your socket server URL", parsedEnvironmentVariables.DEFAULT_SOCKET_SERVER_PROTOCOL + "//" + parsedEnvironmentVariables.DEFAULT_SOCKET_SERVER_HOSTNAME + ((parsedEnvironmentVariables.DEFAULT_SOCKET_SERVER_PORT) ? (":" + parsedEnvironmentVariables.DEFAULT_SOCKET_SERVER_PORT) : "")]).stdout.on('data', (customSocketServerURL) => {
7171
try {
7272
if (!customSocketServerURL.toString().startsWith("RETURN")) return;
73-
if (!["http:", "https:"].includes(new URL(customSocketServerURL.toString().substring(6)).protocol)) throw alert("Invalid socket server URL");
73+
if (!["http:", "https:"].includes(new URL(customSocketServerURL.toString().substring(6, customSocketServerURL.toString().length - 2)).protocol)) throw alert("Invalid socket server URL");
7474
childProcess.spawn(({
7575
win32: "cscript",
7676
darwin: "osascript",
@@ -82,18 +82,18 @@ Array.from(document.getElementsByClassName("slider")).forEach((slider) => {
8282
})[parent.process.platform]), "Custom WebRTC URL", "Please specify your peer server URL", parsedEnvironmentVariables.DEFAULT_PEER_SERVER_PROTOCOL + "//" + parsedEnvironmentVariables.DEFAULT_PEER_SERVER_HOSTNAME + ((parsedEnvironmentVariables.DEFAULT_PEER_SERVER_PORT) ? (":" + parsedEnvironmentVariables.DEFAULT_PEER_SERVER_PORT) : "") + parsedEnvironmentVariables.DEFAULT_PEER_SERVER_PATH]).stdout.on('data', (customPeerServerURL) => {
8383
try {
8484
if (!customPeerServerURL.toString().startsWith("RETURN")) return;
85-
if (!["ws:", "wss:"].includes(new URL(customPeerServerURL.toString().substring(6)).protocol)) throw alert("Invalid peer server URL");
85+
if (!["ws:", "wss:"].includes(new URL(customPeerServerURL.toString().substring(6, customPeerServerURL.toString().length - 2)).protocol)) throw alert("Invalid peer server URL");
8686
fs.writeFileSync(path.join(parent.process.resourcesPath, "customServer.json"), JSON.stringify({
87-
resourceProtocol: new URL(customResourceServerURL.toString().substring(6)).protocol,
88-
resourceHostname: new URL(customResourceServerURL.toString().substring(6)).hostname,
89-
resourcePort: new URL(customResourceServerURL.toString().substring(6)).port,
90-
socketProtocol: new URL(customSocketServerURL.toString().substring(6)).protocol,
91-
socketHostname: new URL(customSocketServerURL.toString().substring(6)).hostname,
92-
socketPort: new URL(customSocketServerURL.toString().substring(6)).port,
93-
peerProtocol: new URL(customPeerServerURL.toString().substring(6)).protocol,
94-
peerHostname: new URL(customPeerServerURL.toString().substring(6)).hostname,
95-
peerPort: new URL(customPeerServerURL.toString().substring(6)).port,
96-
peerPath: new URL(customPeerServerURL.toString().substring(6)).pathname
87+
resourceProtocol: new URL(customResourceServerURL.toString().substring(6, customResourceServerURL.toString().length - 2)).protocol,
88+
resourceHostname: new URL(customResourceServerURL.toString().substring(6, customResourceServerURL.toString().length - 2)).hostname,
89+
resourcePort: new URL(customResourceServerURL.toString().substring(6, customResourceServerURL.toString().length - 2)).port,
90+
socketProtocol: new URL(customSocketServerURL.toString().substring(6, customSocketServerURL.toString().length - 2)).protocol,
91+
socketHostname: new URL(customSocketServerURL.toString().substring(6, customSocketServerURL.toString().length - 2)).hostname,
92+
socketPort: new URL(customSocketServerURL.toString().substring(6, customSocketServerURL.toString().length - 2)).port,
93+
peerProtocol: new URL(customPeerServerURL.toString().substring(6, customPeerServerURL.toString().length - 2)).protocol,
94+
peerHostname: new URL(customPeerServerURL.toString().substring(6, customPeerServerURL.toString().length - 2)).hostname,
95+
peerPort: new URL(customPeerServerURL.toString().substring(6, customPeerServerURL.toString().length - 2)).port,
96+
peerPath: new URL(customPeerServerURL.toString().substring(6, customPeerServerURL.toString().length - 2)).pathname
9797
}), "utf8");
9898
localStorage.setItem("settings", JSON.stringify({
9999
...JSON.parse(localStorage.getItem("settings")) || {},

0 commit comments

Comments
 (0)