Update Electron ~ fixes blue & light mode devtools
This commit is contained in:
@@ -499,17 +499,5 @@ export async function createWindows() {
|
||||
});
|
||||
});
|
||||
|
||||
// evil hack to fix electron 32 regression that makes devtools always light theme
|
||||
// https://github.com/electron/electron/issues/43367
|
||||
// TODO: remove once fixed
|
||||
mainWin.webContents.on("devtools-opened", () => {
|
||||
if (!nativeTheme.shouldUseDarkColors) return;
|
||||
|
||||
nativeTheme.themeSource = "light";
|
||||
setTimeout(() => {
|
||||
nativeTheme.themeSource = "dark";
|
||||
}, 100);
|
||||
});
|
||||
|
||||
initArRPC();
|
||||
}
|
||||
|
||||
@@ -49,8 +49,8 @@ export function registerScreenShareHandler() {
|
||||
if (isWayland) {
|
||||
const video = data[0];
|
||||
if (video) {
|
||||
const stream = await request.frame
|
||||
.executeJavaScript(
|
||||
const stream = await request
|
||||
.frame!.executeJavaScript(
|
||||
`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify([video])},true)`
|
||||
)
|
||||
.catch(() => null);
|
||||
@@ -61,8 +61,8 @@ export function registerScreenShareHandler() {
|
||||
return;
|
||||
}
|
||||
|
||||
const choice = await request.frame
|
||||
.executeJavaScript(`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`)
|
||||
const choice = await request
|
||||
.frame!.executeJavaScript(`Vesktop.Components.ScreenShare.openScreenSharePicker(${JSON.stringify(data)})`)
|
||||
.then(e => e as StreamPick)
|
||||
.catch(e => {
|
||||
console.error("Error during screenshare picker", e);
|
||||
|
||||
@@ -8,7 +8,9 @@ import { ipcMain, IpcMainEvent, IpcMainInvokeEvent, WebFrameMain } from "electro
|
||||
import { DISCORD_HOSTNAMES } from "main/constants";
|
||||
import { IpcEvents } from "shared/IpcEvents";
|
||||
|
||||
export function validateSender(frame: WebFrameMain) {
|
||||
export function validateSender(frame: WebFrameMain | null) {
|
||||
if (!frame) throw new Error("ipc: No sender frame");
|
||||
|
||||
const { hostname, protocol } = new URL(frame.url);
|
||||
if (protocol === "file:") return;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user