1.3.2.1
This commit is contained in:
parent
c86fef761f
commit
44042f5d5e
35
src/controller/windows.js/browser.js
Normal file
35
src/controller/windows.js/browser.js
Normal file
@ -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;
|
@ -10,11 +10,15 @@ const {
|
|||||||
const fs = require('fs');
|
const fs = require('fs');
|
||||||
const yt_dl = require('./controller/youtube-dl')
|
const yt_dl = require('./controller/youtube-dl')
|
||||||
const dl = require('./controller/download');
|
const dl = require('./controller/download');
|
||||||
|
const browser = require('./controller/windows.js/browser');
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
||||||
fs.writeFileSync(global.dir+'/tmp/inst',"out");
|
fs.writeFileSync(global.dir+'/tmp/inst',"out");
|
||||||
var win;
|
var win;
|
||||||
const createWindow = () =>{
|
const createWindow = () =>{
|
||||||
|
|
||||||
win = new BrowserWindow({
|
win = new BrowserWindow({
|
||||||
width: 320,
|
width: 320,
|
||||||
height: 500,
|
height: 500,
|
||||||
@ -74,6 +78,7 @@ if (!fs.existsSync(global.dir+'/tmp/inst')) {
|
|||||||
icon: __dirname + '/app.ico'
|
icon: __dirname + '/app.ico'
|
||||||
})
|
})
|
||||||
win.close();
|
win.close();
|
||||||
|
var z = new browser('http://www.crunchyroll.com/');
|
||||||
win2.loadURL(`file://${__dirname}/app/view/layout.html`)
|
win2.loadURL(`file://${__dirname}/app/view/layout.html`)
|
||||||
win = win2;
|
win = win2;
|
||||||
});
|
});
|
||||||
|
Loading…
Reference in New Issue
Block a user