我遇到电子BrowserWindow
的问题,当页面加载时,任何内容都没有出现我该怎么办?
var nodeConsole = require('console');
var console = new nodeConsole.Console(process.stdout, process.stderr);
var BrowserWindow = require('electron').remote.BrowserWindow;
var win = new BrowserWindow({ show : true,width: 1920, height: 1080 });
var ipcMain = require("electron").remote.ipcMain;
win.loadURL('https://www.binance.com');
win.webContents.on('dom-ready', function (e) {
win.webContents.executeJavaScript(`
var ipcRenderer = require('electron').ipcRenderer;
var i = document.getElementsByClassName("ng-binding ng-scope")[106].innerText;
function start(){
var value=i;
ipcRenderer.send('query', value);
}
setInterval(start,2500);
`);
});