diff --git a/Electron/Electron31/original/package.json b/Electron/Electron31/original/package.json index 0c5fe9f..a7ab49e 100644 --- a/Electron/Electron31/original/package.json +++ b/Electron/Electron31/original/package.json @@ -30,9 +30,7 @@ { "name": "@electron-forge/maker-rpm" }, - { - "name": "@electron-forge/maker-dmg" - }, + { "name": "@electron-forge/maker-zip" } @@ -42,6 +40,7 @@ "name": "@electron-forge/plugin-webpack", "config": { "mainConfig": "./webpack.main.config.js", + "devContentSecurityPolicy": "default-src * 'self' blob: data: gap; style-src * 'self' 'unsafe-inline' blob: data: gap; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap; object-src * 'self' blob: data: gap; img-src * 'self' 'unsafe-inline' blob: data: gap; connect-src 'self' * blob: data: gap; frame-src * 'self' blob: data: gap;", "renderer": { "config": "./webpack.renderer.config.js", "entryPoints": [ @@ -58,13 +57,13 @@ } }, "devDependencies": { - "@electron-forge/cli": "~6.0.0-beta.54", - "@electron-forge/maker-deb": "~6.0.0-beta.54", - "@electron-forge/maker-dmg": "~6.0.0-beta.54", - "@electron-forge/maker-rpm": "~6.0.0-beta.54", - "@electron-forge/maker-squirrel": "~6.0.0-beta.54", - "@electron-forge/maker-zip": "~6.0.0-beta.54", - "@electron-forge/plugin-webpack": "6.0.0-beta.54", + "@electron-forge/cli": "~6.0.0", + "@electron-forge/maker-deb": "~6.0.0", + "@electron-forge/maker-dmg": "~6.0.0", + "@electron-forge/maker-rpm": "~6.0.0", + "@electron-forge/maker-squirrel": "~6.0.0", + "@electron-forge/maker-zip": "~6.0.0", + "@electron-forge/plugin-webpack": "6.0.0", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@typescript-eslint/eslint-plugin": "~4.0.1", "@typescript-eslint/parser": "~4.0.1", diff --git a/Electron/Electron31/protected/README.md b/Electron/Electron31/protected/README.md index dc7849a..b90972d 100644 --- a/Electron/Electron31/protected/README.md +++ b/Electron/Electron31/protected/README.md @@ -73,4 +73,9 @@ Info: Protected files rendered successfully. ``` ### **enableInDevelopmentMode** -By setting `enableInDevelopmentMode` option of the plugin to true, the protection is enabled for all modes('development', 'production'). To change this behavior, set this option as false. For more details refer to this [link](https://www.preemptive.com/jsdefender/userguide/en/webpack_plugin.html). \ No newline at end of file +By setting `enableInDevelopmentMode` option of the plugin to true, the protection is enabled for all modes('development', 'production'). To change this behavior, set this option as false. For more details refer to this [link](https://www.preemptive.com/jsdefender/userguide/en/webpack_plugin.html). + +### CSP Error for unsafe-eval +Electron forge using webpack and webpack-ts template faces runtime CSP(Content Security Policy) error while using the 'npm run start' command to run this on the dev mode. However 'npm un make' to build the production will not face this issue. This is the issue of electron forge webpack. +In order to allow this unsafe-eval there is a config in the package.json 'devContentSecurityPolicy'. This config allows the unsafe-eval and thus, allows the application to run in the dev mode along with production as well. +This config fix the issue only for Electron forge, as eval is also not allowed by the JSDefender, this config will not fix the JSDefender issue, as it is related to core JSDefender. \ No newline at end of file diff --git a/Electron/Electron31/protected/package.json b/Electron/Electron31/protected/package.json index 771d90f..8c81376 100644 --- a/Electron/Electron31/protected/package.json +++ b/Electron/Electron31/protected/package.json @@ -30,9 +30,6 @@ { "name": "@electron-forge/maker-rpm" }, - { - "name": "@electron-forge/maker-dmg" - }, { "name": "@electron-forge/maker-zip" } @@ -42,6 +39,7 @@ "name": "@electron-forge/plugin-webpack", "config": { "mainConfig": "./webpack.main.config.js", + "devContentSecurityPolicy": "default-src * 'self' blob: data: gap; style-src * 'self' 'unsafe-inline' blob: data: gap; script-src * 'self' 'unsafe-eval' 'unsafe-inline' blob: data: gap; object-src * 'self' blob: data: gap; img-src * 'self' 'unsafe-inline' blob: data: gap; connect-src 'self' * blob: data: gap; frame-src * 'self' blob: data: gap;", "renderer": { "config": "./webpack.renderer.config.js", "entryPoints": [ @@ -58,13 +56,13 @@ } }, "devDependencies": { - "@electron-forge/cli": "~6.0.0-beta.54", - "@electron-forge/maker-deb": "~6.0.0-beta.54", - "@electron-forge/maker-dmg": "~6.0.0-beta.54", - "@electron-forge/maker-rpm": "~6.0.0-beta.54", - "@electron-forge/maker-squirrel": "~6.0.0-beta.54", - "@electron-forge/maker-zip": "~6.0.0-beta.54", - "@electron-forge/plugin-webpack": "6.0.0-beta.54", + "@electron-forge/cli": "~6.0.0", + "@electron-forge/maker-deb": "~6.0.0", + "@electron-forge/maker-dmg": "~6.0.0", + "@electron-forge/maker-rpm": "~6.0.0", + "@electron-forge/maker-squirrel": "~6.0.0", + "@electron-forge/maker-zip": "~6.0.0", + "@electron-forge/plugin-webpack": "6.0.0", "@marshallofsound/webpack-asset-relocator-loader": "~0.5.0", "@preemptive/jsdefender-core": "file:assets/preemptive-jsdefender-core-{version}.tgz", "@preemptive/jsdefender-webpack-plugin": "file:assets/preemptive-jsdefender-webpack-plugin-{version}.tgz",