From 5a1962ced220e93237978e8feb2dcff00f51ddc1 Mon Sep 17 00:00:00 2001 From: Markus Moser Date: Fri, 14 Mar 2025 17:27:40 +0100 Subject: [PATCH] only use electron api if available --- main.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/main.ts b/main.ts index 205679c..a8b7213 100644 --- a/main.ts +++ b/main.ts @@ -173,7 +173,9 @@ export default class PrivateModePlugin extends Plugin { updateGlobalRevealStyle() { this.removeAllClasses(); this.setClassToDocumentBody(); - window.require("electron").remote.getCurrentWindow().setContentProtection(this.currentScreenshareProtection) + if (window.require !== undefined) { + window.require("electron").remote.getCurrentWindow().setContentProtection(this.currentScreenshareProtection) + } } removeAllClasses() {