How to use DesktopPicker on Electron

Which Electron version do you use?
@Hristo_Terezov any thoughts?

We support up to electron 6. If you are using electron 7+ this is known issue .

Its done . Thanks
But now another problem occured
Uncaught DOMException: Blocked a frame with origin “file://” from accessing a cross-origin frame.

Could you please provide more details?

Is this jitsi related problem?

Yes, when i try to enable setupScreenSharingForWindow(iframe) , This error is occured :-“Uncaught DOMException: Blocked a frame with origin “file://” from accessing a cross-origin frame”

Hmm. I haven’t seen this.

I’ve just tested with jitsi-meet-electron and it is working great and I don’t see this error. Our use case there is that the main window is loaded with “file://” protocol and the iframe - “https://” protocol.

I’m not sure what is your situation there but this is a CORS error. You may try to play with some of the electron flags on the browser window or some chrome switches. This may help.

This error occurred here

When I encountered this, there was a silent exception thrown in jitsi-meet-electron-utils/screensharing/render.js in ScreenShareeRenderHook with the line this._iframe.contentWindow.JitsiMeetElectron.

This line was throwing the error

SecurityError: Blocked a frame with origin “…” from accessing a cross-origin frame.

Was able to get this working with the following, in the electron main.js:

app.commandLine.appendSwitch('disable-site-isolation-trials');
...
mainWindow = new BrowserWindow({
      webPreferences: {
        ...
        webSecurity: false
        ...
      },
...
})
setupScreenSharingMain(mainWindow, "App_Name", "com.example.electron");
...

And of course, you need the right code in your render file. Something like:

api = new window.JitsiMeetExternalAPI("https://meet....", options);

const { setupScreenSharingRender} = window.jitsiNodeAPI.jitsiMeetElectronUtils;
setupScreenSharingRender(api);

The examples @damencho mention will help. Everything you need to get this working is out there. However, you may have to research to pull all the pieces together.