:808Not able to capturescreenshot getting error - 0/#/:1 Uncaught (in promise) Error: Cannot read properties of undefined (reading 'getSources') #18019
Unanswered
sreeraj-ramesh
asked this question in
CLI - Electron mode
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
/electron-preload.js: code
import { contextBridge, desktopCapturer } from 'electron';
// highlight-next-line
import { dialog } from '@electron/remote';
contextBridge.exposeInMainWorld('electronApi', {
openFileDialog: async (title, folder, filters) => {
const response = await dialog.showOpenDialog({
title,
filters,
properties: ['openFile', 'multiSelections'],
});
return response.filePaths;
},
takeScreenshot: async () => {
console.log('[DEBUG] Is this Electron?', !!process.versions.electron);
},
});
Beta Was this translation helpful? Give feedback.
All reactions