在electronjs中访问网站的dom

时间:2018-07-12 14:12:51

标签: javascript dom electron

我在main.js中有以下代码,我在其中加载gmail singup网站。我如何访问dom的元素,例如用我的信息填写表格?

const electron = require('electron');
const path = require('path');
const url = require('url');

// SET ENV
process.env.NODE_ENV = 'development';

const {app, BrowserWindow, Menu} = electron;

let mainWindow;

app.on('ready', function(){
  mainWindow = new BrowserWindow({});
  mainWindow.loadURL("https://accounts.google.com/signup/v2/webcreateaccount?flowName=GlifWebSignIn&flowEntry=SignUp");

  mainWindow.on('closed', function(){
    app.quit();
  });

  const mainMenu = Menu.buildFromTemplate(mainMenuTemplate);
  Menu.setApplicationMenu(mainMenu);
});


   //more code setting up the menu...
}

0 个答案:

没有答案