Skip to content

Commit

Permalink
Get rid of "Electron Security Warning (Insecure Content-Security-Poli…
Browse files Browse the repository at this point in the history
…cy)"
  • Loading branch information
moshfeu committed Dec 28, 2018
1 parent 33f63f8 commit abf55c5
Show file tree
Hide file tree
Showing 5 changed files with 14 additions and 9 deletions.
1 change: 1 addition & 0 deletions index.html
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
<head>
<meta charset="UTF-8">
<title>y2mp3</title>
<meta http-equiv="Content-Security-Policy" content="script-src 'self'">
<link href="node_modules/semantic-ui-css/semantic.min.css" rel="stylesheet" />
</head>

Expand Down
17 changes: 10 additions & 7 deletions main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -33,20 +33,23 @@ function getIconFile() {

function createWindow() {
// Create the browser window.
const webPreferences: Electron.WebPreferences = {
additionalArguments: [
`--appData=${app.getPath('appData')}`,
`--isDev=${isDev}`
],
nodeIntegration: true
};

win = new BrowserWindow({
width: 480,
height: 600,
webPreferences: {
additionalArguments: [
`--appData=${app.getPath('appData')}`,
`--isDev=${isDev}`
]
},
webPreferences,
icon: join(__dirname, 'resources/icons', getIconFile())
});

// and load the index.html of the app.
win.loadFile('index.html')
win.loadFile('index.html');

// Open the DevTools.
if (isDev) {
Expand Down
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
"dist-windows": "npm run dist -- --win",
"publish-linux": "npm run build && electron-builder --linux --publish onTagOrDraft",
"generate-icons": "./node_modules/.bin/electron-icon-maker --input=app-resources/logo-full-size.png --output=resources",
"build": "tsc && webpack --config webpack.prod.js",
"build": "npm run generate-icons && tsc && webpack --config webpack.prod.js",
"test": "node --trace-warnings ./test/runTests.js",
"test:watch": "jest --watch",
"coveralls": "jest --coverage && cat ./coverage/lcov.info | coveralls"
Expand Down
2 changes: 1 addition & 1 deletion tsconfig.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"compilerOptions": {
"target": "es6",
"target": "es5",
"lib": ["es2015", "dom"],
"sourceMap": false,
"rootDir": "src",
Expand Down
1 change: 1 addition & 0 deletions webpack.config.js
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ module.exports = {
path: __dirname
},
mode: 'development',
devtool : 'cheap-source-map',
target: 'node',
plugins: [
new DefinePlugin({
Expand Down

0 comments on commit abf55c5

Please sign in to comment.