first pass implementation
This commit is contained in:
@@ -41,6 +41,21 @@ contextBridge.exposeInMainWorld('electronAutoplay', {
|
||||
},
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld('electronScreen', {
|
||||
getScreenSources: () => ipcRenderer.invoke('screen:get-sources'),
|
||||
startRecordingWindow: () => ipcRenderer.send('screen-record:start'),
|
||||
stopRecordingWindow: () => ipcRenderer.send('screen-record:cancel'),
|
||||
onStopRequested: (callback: () => void) => {
|
||||
const handler = () => callback();
|
||||
ipcRenderer.on('screen-record:stopped', handler);
|
||||
return () => { ipcRenderer.removeListener('screen-record:stopped', handler); };
|
||||
},
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld('electronScreenRecord', {
|
||||
stop: () => ipcRenderer.send('screen-record:stop'),
|
||||
});
|
||||
|
||||
contextBridge.exposeInMainWorld('electronLink', {
|
||||
fetchMetadata: (url: string) => ipcRenderer.invoke('link:fetch-metadata', url),
|
||||
openExternal: (url: string) => ipcRenderer.invoke('link:open-external', url),
|
||||
|
||||
Reference in New Issue
Block a user