Fix command injection in link handler
This commit is contained in:
parent
723a9e4df3
commit
38e57d5b3b
1 changed files with 2 additions and 2 deletions
|
@ -173,7 +173,7 @@ export class AppEvents {
|
||||||
console.log("token: ", authURI.split("lastfm?token=")[1]);
|
console.log("token: ", authURI.split("lastfm?token=")[1]);
|
||||||
utils
|
utils
|
||||||
.getWindow()
|
.getWindow()
|
||||||
.webContents.executeJavaScript(`ipcRenderer.send('lastfm:auth', "${authURI.split("lastfm?token=")[1]}")`)
|
.webContents.executeJavaScript(`ipcRenderer.send('lastfm:auth', ${JSON.stringify(authURI.split("lastfm?token=")[1])})`)
|
||||||
.catch(console.error);
|
.catch(console.error);
|
||||||
}
|
}
|
||||||
} else if (arg.includes("playpause")) {
|
} else if (arg.includes("playpause")) {
|
||||||
|
@ -220,7 +220,7 @@ export class AppEvents {
|
||||||
} else if (arg.includes("/beep")) {
|
} else if (arg.includes("/beep")) {
|
||||||
shell.beep();
|
shell.beep();
|
||||||
} else {
|
} else {
|
||||||
utils.getWindow().webContents.executeJavaScript(`app.appRoute('${arg.split("//")[1]}')`);
|
utils.getWindow().webContents.executeJavaScript(`app.appRoute(${JSON.stringify(arg.split("//")[1])})`);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue