我正在开发一个 Electron 应用程序,需要启用以下 Chromium 标志 GuestViewCrossProcessFrames 以使缩放与 webview 一起工作.
I am working on an Electron app and need to enable the following Chromium flag GuestViewCrossProcessFrames to make scaling work with webview.
我尝试在 main.js 中调用以下行,但它似乎不起作用.还尝试为 BrowserWindow 和 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.
可以通过调用设置
const { app } = require('electron');
app.commandLine.appendSwitch('enable-features', 'GuestViewCrossProcessFrames');
app.on('ready', () => {
// place your code.
}
注意:您需要在 ready 事件发出之前调用它.
note: you need to call it before ready event emitted.
这篇关于如何在 Electron 中设置 chromium 命令行标志?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持html5模板网!
在 Electron 渲染器进程中创建子窗口时如何修复How to fix BrowserWindow is not a constructor error when creating child window in Electron renderer process(在 Electron 渲染器进程中创建子窗口
mainWindow.loadURL("https://localhost:3000/") 在 EmainWindow.loadURL(quot;https://localhost:3000/quot;) show white screen on Electron app(mainWindow.loadURL(https://localhost:3000/) 在 Electron 应用程
Electron webContents executeJavaScript:无法在第二个 loaElectron webContents executeJavaScript : Cannot execute script on second on loadURL(Electron webContents executeJavaScript:无法在第二个 loadURL 上
如何在angular-cli的组件内使用电子浏览器窗口?how to use electron browser window inside components in angular-cli?(如何在angular-cli的组件内使用电子浏览器窗口?)
ElectronJS - 在 Windows 之间共享 redux 存储?ElectronJS - sharing redux store between windows?(ElectronJS - 在 Windows 之间共享 redux 存储?)
如何在电子应用程序中访问相机/网络摄像头?How to access camera/webcamera inside electron app?(如何在电子应用程序中访问相机/网络摄像头?)