You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
31 lines
831 B
31 lines
831 B
const { app, BrowserWindow, webContents, session } = require('electron')
|
|
const Path = require('path')
|
|
|
|
function createWindow(options) {
|
|
const win = new BrowserWindow({
|
|
width: options.width,
|
|
height: options.height,
|
|
backgroundColor: "#2F3136",
|
|
webPreferences: {
|
|
preload: Path.join(__dirname, "preload.js")
|
|
}
|
|
})
|
|
let ses = win.webContents.session
|
|
win.removeMenu()
|
|
win.loadURL("https://discord.com/app")
|
|
win.webContents.on('before-input-event', (event, input) => {
|
|
if (input.control && input.shift && input.key.toLowerCase() == 'i') {
|
|
win.webContents.openDevTools()
|
|
}
|
|
})
|
|
ses.webRequest.onHeadersRecieved(({responseHeaders, url}, done) => {
|
|
delete responseHeaders['content-security-policy']; //CSP, die in a pit.
|
|
done({responseHeaders})
|
|
})
|
|
return win
|
|
}
|
|
|
|
module.exports = {
|
|
createWindow: createWindow
|
|
}
|