A method is provided.
http://electron.atom.io/docs/v0.36.8/api/web-view-tag/ #webviewinsertcssssss
In javascript running in an HTML file embedded with WebView, you can retrieve the WebView DOM object and use the above methods.
<html>
<body>
<webview id="webview" src="~~"/>
<script>
var webview= document.getElementById('webview');
webview.insertCSS("~~");
</script>
</body>
</html>
Also, even if you specify BrowserWindow directly with loadURL
, you can do the same with the webContents that BrowserWindow has.
var win=new BrowserWindow (width:800, height:600);
win.loadURL("~~");
win.webContents.insertCSS("~~");
© 2024 OneMinuteCode. All rights reserved.