Reputation: 378
I am working on an Electron app and need to enable the following Chromium flag GuestViewCrossProcessFrames
to make scaling work with webview.
I tried calling the following line in my main.js but it doesn't seem to work. Also tried enabling plugins for the BrowserWindow as well as webview.
app.commandLine.appendSwitch('--enable-features=GuestViewCrossProcessFrames');
Can someone help me setting up this flag? Thank you.
Upvotes: 7
Views: 12985
Reputation: 6795
According to the docs, the proper way of calling appendSwitch
is:
app.commandLine.appendSwitch(switch[, value])
As mentioned in OJ Kwon's answer, apparently enable-features
is explicitly disabled by Electron. If that wasn't true, you would be able to set it with the following syntax:
app.commandLine.appendSwitch('enable-features', 'GuestViewCrossProcessFrames');
See Supported Chrome Command Line Switches for more examples.
Upvotes: 1
Reputation: 146
you can set by calling
const { app } = require('electron');
app.commandLine.appendSwitch('enable-features', 'GuestViewCrossProcessFrames');
app.on('ready', () => {
// place your code.
}
note: you need to call it before ready event emitted.
Upvotes: 6
Reputation: 231
In order to use app.commandLine.appendSwitch be sure to not use '--' your call should look like this
app.commandLine.appendSwitch('enable-features=GuestViewCrossProcessFrames');
Upvotes: 0
Reputation: 4641
It is not clear to me why Electron does this though specific flag you specified is explicitly disabled in electron
So you can't enable it dynamically.
Upvotes: 2