mirror of
https://github.com/electron/electron.git
synced 2026-05-02 03:00:22 -04:00
Add "enable_desktop_capturer" build flag (#13133)
* Make it possible to disable a module for a renderer * Put DesktopCapturer API under a build flag The name is "enable_desktop_capturer". Enabled by default.
This commit is contained in:
committed by
Charles Kerr
parent
6ff111a141
commit
dee9aef975
@@ -7,6 +7,14 @@
|
||||
|
||||
namespace {
|
||||
|
||||
bool IsDesktopCapturerEnabled() {
|
||||
#if defined(ENABLE_DESKTOP_CAPTURER)
|
||||
return true;
|
||||
#else
|
||||
return false;
|
||||
#endif
|
||||
}
|
||||
|
||||
bool IsOffscreenRenderingEnabled() {
|
||||
#if defined(ENABLE_OSR)
|
||||
return true;
|
||||
@@ -28,6 +36,7 @@ void Initialize(v8::Local<v8::Object> exports,
|
||||
v8::Local<v8::Context> context,
|
||||
void* priv) {
|
||||
mate::Dictionary dict(context->GetIsolate(), exports);
|
||||
dict.SetMethod("isDesktopCapturerEnabled", &IsDesktopCapturerEnabled);
|
||||
dict.SetMethod("isOffscreenRenderingEnabled", &IsOffscreenRenderingEnabled);
|
||||
dict.SetMethod("isPDFViewerEnabled", &IsPDFViewerEnabled);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user