admin管理员组

文章数量:1201374

Request for Support Background: I am currently upgrading the project from Electron 15 to Electron 29, but the embedded document websites consistently pop up a font download popup window. Problem: When using BrowserView, WebView, or iframe in the project to reference external websites, this popup window will appear when a specific font does not exist on Mac. This font download popup window did not exist in version 15. I want to keep it consistent with version 15. Which feature of Electron or Chrome has led to this phenomenon? How should I set it? Below is a screenshot.

I hope that, just like in Electron 15, this pop - up can be skipped entirely, and the default font can be used directly. This is because such an experience is really bad for users.

//You can copy this code into electron fiddle, as long as you don't have the Chinese Song fonts on your computer

// main.js
const mainWindow = new BrowserWindow({
    width: 800,
    height: 600,
    webPreferences: {
      preload: path.join(__dirname, 'preload.js'),
        webSecurity: false,
        webviewTag: true,
        contextIsolation: false,
        nodeIntegration: true,
        nodeIntegrationInWorker: true,
    }
})

//index.html
<webview
    src=";
    nodeintegrationinsubframes="true"
    webpreferences="contextIsolation=no, sandbox=false"
    allowpopups="true"
/>

本文标签: