Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: Electron build issue fixed #49

Open
wants to merge 5 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 9 additions & 10 deletions Electron/Electron31/original/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,7 @@
{
"name": "@electron-forge/maker-rpm"
},
{
"name": "@electron-forge/maker-dmg"
},

{
"name": "@electron-forge/maker-zip"
}
Expand All @@ -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": [
Expand All @@ -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",
Expand Down
7 changes: 6 additions & 1 deletion Electron/Electron31/protected/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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).
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.
18 changes: 8 additions & 10 deletions Electron/Electron31/protected/package.json
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
{
"name": "@electron-forge/maker-rpm"
},
{
"name": "@electron-forge/maker-dmg"
},
{
"name": "@electron-forge/maker-zip"
}
Expand All @@ -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": [
Expand All @@ -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",
Expand Down