This repository has been archived by the owner on Jun 18, 2022. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #7 from realzimon/CSP
Make everything ready for deployment
- Loading branch information
Showing
8 changed files
with
153 additions
and
61 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,43 +1,58 @@ | ||
const {app, BrowserWindow, Menu} = require('electron') | ||
|
||
function createWindow () { | ||
// Create the browser window. | ||
let win = new BrowserWindow({ fullscreen: true, titleBarStyle: 'hidden' }) | ||
|
||
// and load the index.html of the app. | ||
win.loadFile('index.html') | ||
|
||
// Open the DevTools. | ||
//win.webContents.openDevTools() | ||
|
||
//let test = new BrowserWindow({width: 800, height: 600, parent: win}) | ||
// Emitted when the window is closed. | ||
win.on('closed', () => { | ||
// Dereference the window object, usually you would store windows | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
win = null | ||
}) | ||
const { app,BrowserWindow,Menu } = require('electron') | ||
|
||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
|
||
app.on('ready', () => { | ||
// session.defaultSession.webRequest.onHeadersReceived((details, callback) => { | ||
// callback({responseHeaders: Object.assign({ | ||
// "Content-Security-Policy": ["default-src 'self'"] | ||
// }, details.responseHeaders)}); | ||
// }); | ||
createWindow(); | ||
|
||
}) | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', () => { | ||
// On macOS it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
if (process.platform !== 'darwin') { | ||
app.quit() | ||
} | ||
}) | ||
|
||
app.on('activate', () => { | ||
// On macOS it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (win === null) { | ||
createWindow() | ||
} | ||
// This method will be called when Electron has finished | ||
// initialization and is ready to create browser windows. | ||
// Some APIs can only be used after this event occurs. | ||
// app.on('ready', () => {createWindow(); loadModules();}) | ||
app.on('ready', (createWindow)) | ||
|
||
// Quit when all windows are closed. | ||
app.on('window-all-closed', () => { | ||
// On macOS it is common for applications and their menu bar | ||
// to stay active until the user quits explicitly with Cmd + Q | ||
if (process.platform !== 'darwin') { | ||
app.quit() | ||
} | ||
}) | ||
|
||
//Electron update service | ||
require('update-electron-app')() | ||
|
||
function createWindow() { | ||
// Create the browser window. | ||
let win = new BrowserWindow({ | ||
fullscreen: true, | ||
titleBarStyle: 'hidden' | ||
}) | ||
|
||
app.on('activate', () => { | ||
// On macOS it's common to re-create a window in the app when the | ||
// dock icon is clicked and there are no other windows open. | ||
if (win === null) { | ||
createWindow() | ||
} | ||
// and load the index.html of the app. | ||
win.loadFile('index.html') | ||
|
||
// Open the DevTools. | ||
//win.webContents.openDevTools() | ||
|
||
//let test = new BrowserWindow({width: 800, height: 600, parent: win}) | ||
// Emitted when the window is closed. | ||
win.on('closed', () => { | ||
// Dereference the window object, usually you would store windows | ||
// in an array if your app supports multi windows, this is the time | ||
// when you should delete the corresponding element. | ||
win = null | ||
}) | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
#!/bin/bash | ||
|
||
npm start |