mirror of
https://github.com/electron/electron.git
synced 2026-04-10 03:01:51 -04:00
feat: expose the desktopCapturer module in the main process (#23548)
This commit is contained in:
5
lib/browser/api/desktop-capturer.ts
Normal file
5
lib/browser/api/desktop-capturer.ts
Normal file
@@ -0,0 +1,5 @@
|
||||
import { getSourcesImpl } from '@electron/internal/browser/desktop-capturer';
|
||||
|
||||
export async function getSources (options: Electron.SourcesOptions) {
|
||||
return getSourcesImpl(null, options);
|
||||
}
|
||||
@@ -33,6 +33,12 @@ export const browserModuleList: ElectronInternal.ModuleEntry[] = [
|
||||
{ name: 'WebContentsView', loader: () => require('./web-contents-view') }
|
||||
];
|
||||
|
||||
if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
|
||||
browserModuleList.push(
|
||||
{ name: 'desktopCapturer', loader: () => require('./desktop-capturer') }
|
||||
);
|
||||
}
|
||||
|
||||
if (BUILDFLAG(ENABLE_VIEWS_API)) {
|
||||
browserModuleList.push(
|
||||
{ name: 'ImageView', loader: () => require('./views/image-view') }
|
||||
|
||||
@@ -36,6 +36,10 @@ export const browserModuleNames = [
|
||||
'WebContentsView'
|
||||
];
|
||||
|
||||
if (BUILDFLAG(ENABLE_DESKTOP_CAPTURER)) {
|
||||
browserModuleNames.push('desktopCapturer');
|
||||
}
|
||||
|
||||
if (BUILDFLAG(ENABLE_VIEWS_API)) {
|
||||
browserModuleNames.push(
|
||||
'ImageView'
|
||||
|
||||
Reference in New Issue
Block a user