Is this wrong or is it a new update


#1

Hi! I have been using
"use strict"
var electron = require(‘electron’).app
var BrowserWindow = require(‘electron’).BrowserWindow
let win
function createWindow () {
win = new BrowserWindow({width: 1000, height: 800, allowRunningInsecureContent: true, webPreferences: {nodeIntegration: false})
win.loadURL(‘http://pretendyoure.xyz’)
win.on(‘closed’, () => {
win = null
})
}
electron.on(‘ready’, createWindow)
electron.on(‘window-all-closed’, () => {
if (process.platform !== ‘darwin’) {
electron.quit()
}
})
electron.on(‘activate’, () => {
if (win === null) {
createWindow()
}
})

To make electron open a window going to pretendyou’re.xyz. I dont know what happened but now i get a error saying

Can anyone help me port this or fix this?


#2

Yes, i know that it is unexpected token. One thing though: This works for my other program running the old electron.


#3

Please wrap your code in tags so that we can read it easily. It’s easy: just select the block of code and use the </> button above the editor.


#4

You are missing a } in the createWindow function.


#5

Thanks! Didn’t see that :smiley: