diff --git a/templates/electron/haxe/ElectronSetup.hx b/templates/electron/haxe/ElectronSetup.hx index 60ebeeb56..3deb43790 100644 --- a/templates/electron/haxe/ElectronSetup.hx +++ b/templates/electron/haxe/ElectronSetup.hx @@ -46,6 +46,10 @@ class ElectronSetup { if (height == 0) height = 600; var frame:Bool = window.borderless == false; + var commandLine = Reflect.getProperty(electron.main.App, "commandLine"); + var appendSwitch:haxe.Constraints.Function = Reflect.getProperty(commandLine, "appendSwitch"); + appendSwitch('--autoplay-policy','no-user-gesture-required'); + electron.main.App.on( 'ready', function(e) { var config:Dynamic = { fullscreen: window.fullscreen,