diff --git a/src/controller/windows.js/browser.js b/src/controller/windows.js/browser.js new file mode 100644 index 0000000..2be50c7 --- /dev/null +++ b/src/controller/windows.js/browser.js @@ -0,0 +1,35 @@ + + +const { + BrowserWindow, + session +} = require('electron'); + +class browser { + constructor(url){ + console.log("TEST") + this.window = new BrowserWindow({ + width: 500, + height: 500, + show: true, + frame: true, + icon: global.dir + '/app.ico' + }) + setInterval(function(){ + session.defaultSession.cookies.get({url:'http://crunchyroll.com'}, (error, cookies) => { + console.log(error, cookies) + }) + },3000) + var window = this.window + window.loadURL(url) + window.once('ready-to-show', () => { + + }) + + this.window.on('closed', () => { + window = null; + }); + } +} + +module.exports = browser; diff --git a/src/index.js b/src/index.js index 5ee1289..1361122 100644 --- a/src/index.js +++ b/src/index.js @@ -10,11 +10,15 @@ const { const fs = require('fs'); const yt_dl = require('./controller/youtube-dl') const dl = require('./controller/download'); +const browser = require('./controller/windows.js/browser'); + + if (!fs.existsSync(global.dir+'/tmp/inst')) { fs.writeFileSync(global.dir+'/tmp/inst',"out"); var win; const createWindow = () =>{ + win = new BrowserWindow({ width: 320, height: 500, @@ -74,6 +78,7 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) { icon: __dirname + '/app.ico' }) win.close(); + var z = new browser('http://www.crunchyroll.com/'); win2.loadURL(`file://${__dirname}/app/view/layout.html`) win = win2; });