fixed electron dev requests

This commit is contained in:
antelle 2019-01-07 20:38:58 +01:00
parent 9a364d3294
commit bd9144628f
4 changed files with 6 additions and 6 deletions

View File

@ -228,9 +228,6 @@ module.exports = function(grunt) {
},
js: {
keepalive: true,
webpack: {
devtool: 'source-map'
},
port: 8085
}
},

View File

@ -449,7 +449,9 @@ function deleteRecursive(dir) {
function hookRequestHeaders() {
electron.session.defaultSession.webRequest.onBeforeSendHeaders((details, callback) => {
delete details.requestHeaders['Origin'];
if (!details.url.startsWith('ws:')) {
delete details.requestHeaders['Origin'];
}
callback({cancel: false, requestHeaders: details.requestHeaders});
});
}

View File

@ -79,7 +79,7 @@
"test": "grunt test",
"postinstall": "cd desktop && npm install",
"build-beta": "grunt --skip-sign --beta && sed 's/<html manifest=\"manifest.appcache\">//' dist/index.html > ../keeweb-beta/index.html && cd ../keeweb-beta && git add index.html && git commit -a -m 'beta' && git push origin master",
"electron": "electron desktop --htmlpath=http://localhost:8085/tmp/",
"electron": "ELECTRON_DISABLE_SECURITY_WARNINGS=1 electron desktop --htmlpath=http://localhost:8085/tmp/",
"dev": "grunt dev --skip-sign"
},
"author": {

View File

@ -135,7 +135,8 @@ function config(grunt) {
function devServerConfig(grunt) {
const devServerConfig = config(grunt);
Object.assign(devServerConfig, {
mode: 'development'
mode: 'development',
devtool: 'source-map'
});
Object.assign(devServerConfig.resolve.alias, {
backbone: 'backbone/backbone.js',