当内容需要依赖于fs或路径时,我正在使用Web视图传递的url动态显示内容。内容不显示在屏幕上。
main.js
webPreferences: {
nodeIntegration: true,
webviewTag: true
},
transparent: true,
icon:image
})
index.html
<webview style="padding:0px; border:0px;margin:0px; height:800px;" id="content-2" nodeintegration></webview>
script.js
const fs = require('electron').remote.require('fs');
const path = require('electron').remote.require('path');
function xyz(){
}
script.html
<html>
<head>
<body onload="xyz()" style="background: white;">
<div id="sProxySettings" style="display: none; margin-top:0px; margin-bottom:25px; margin-left:20px; margin-right:37px;"></div>
</body>
</html>