prevent remote flashbang

This commit is contained in:
Quacksire 2022-04-08 09:19:30 -07:00 committed by GitHub
parent ad7d33f56a
commit 2ab9867116
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -1068,13 +1068,13 @@ export class BrowserWindow {
//QR Code //QR Code
ipcMain.handle('showQR', async (_event, _) => { ipcMain.handle('showQR', async (_event, _) => {
let url = `http://${BrowserWindow.getIP()}:${this.remotePort}`; let url = `http://${BrowserWindow.getIP()}:${this.remotePort}`;
shell.openExternal(`https://cider.sh/pair-remote?url=${Buffer.from(encodeURI(url)).toString('base64')}`).catch(console.error); shell.openExternal(`https://cider.sh/remote/pair?url=${Buffer.from(encodeURI(url)).toString('base64')}`).catch(console.error);
}); });
ipcMain.on('get-remote-pair-url', (_event, _) => { ipcMain.on('get-remote-pair-url', (_event, _) => {
let url = `http://${BrowserWindow.getIP()}:${this.remotePort}`; let url = `http://${BrowserWindow.getIP()}:${this.remotePort}`;
//if (app.isPackaged) { //if (app.isPackaged) {
BrowserWindow.win.webContents.send('send-remote-pair-url', (`https://cider.sh/pair-remote?url=${Buffer.from(encodeURI(url)).toString('base64')}`).toString()); BrowserWindow.win.webContents.send('send-remote-pair-url', (`https://cider.sh/remote/pair?url=${Buffer.from(encodeURI(url)).toString('base64')}`).toString());
//} else { //} else {
// BrowserWindow.win.webContents.send('send-remote-pair-url', (`http://127.0.0.1:5500/pair-remote.html?url=${Buffer.from(encodeURI(url)).toString('base64')}`).toString()); // BrowserWindow.win.webContents.send('send-remote-pair-url', (`http://127.0.0.1:5500/pair-remote.html?url=${Buffer.from(encodeURI(url)).toString('base64')}`).toString());
//} //}