Skip to content

Instantly share code, notes, and snippets.

View brainwith's full-sized avatar
💭
I may be slow to respond.

luke brainwith

💭
I may be slow to respond.
  • Free Man
View GitHub Profile
@brainwith
brainwith / electron-display-media-repro-main.js
Created May 9, 2026 11:53
Electron setDisplayMediaRequestHandler useSystemPicker toggle crash repro
const path = require('node:path');
const { app, BrowserWindow, desktopCapturer, ipcMain, session } = require('electron');
let mainWindow;
let selectedSourceId;
let cachedSources = [];
function log(...args) {
const message = args
.map(value => (typeof value === 'string' ? value : JSON.stringify(value)))