Electron BrowserWindow内容问题

时间:2018-02-21 19:16:58

标签: javascript node.js electron

我遇到电子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);

      `);
    });

enter link for image

0 个答案:

没有答案