Allow unsafe eval in dev mode only
This commit is contained in:
parent
50f08ac3b5
commit
8b6069db43
2
build
2
build
|
@ -33,8 +33,6 @@ def main():
|
||||||
*args,
|
*args,
|
||||||
], **kwargs)
|
], **kwargs)
|
||||||
|
|
||||||
# TODO do I need that back for dev manifest??
|
|
||||||
# "content_security_policy": "script-src 'self' 'unsafe-eval'; object-src 'self'"
|
|
||||||
maybe_release = {'NODE_ENV': 'production'} if args.release else {}
|
maybe_release = {'NODE_ENV': 'production'} if args.release else {}
|
||||||
env = {
|
env = {
|
||||||
'TARGET': target,
|
'TARGET': target,
|
||||||
|
|
|
@ -1,5 +1,4 @@
|
||||||
{
|
{
|
||||||
"short_name": "grasp",
|
|
||||||
"icons": {
|
"icons": {
|
||||||
"128": "unicorn.png"
|
"128": "unicorn.png"
|
||||||
},
|
},
|
||||||
|
|
|
@ -12,7 +12,9 @@ const pkg = require('./package.json');
|
||||||
const baseManifest = require('./src/manifest.json');
|
const baseManifest = require('./src/manifest.json');
|
||||||
|
|
||||||
const target = env.TARGET;
|
const target = env.TARGET;
|
||||||
const pkg_name = env.ANY_HOST ? "grasp (any host)" : "grasp";
|
const dev = env.NODE_ENV === "development";
|
||||||
|
|
||||||
|
const pkg_name = (env.ANY_HOST ? "grasp (any host)" : "grasp") + (dev ? ' [dev]' : '');
|
||||||
|
|
||||||
// TODO make permissions literate
|
// TODO make permissions literate
|
||||||
const permissions = [
|
const permissions = [
|
||||||
|
@ -56,6 +58,10 @@ const manifestExtra = {
|
||||||
commands: commandsExtra,
|
commands: commandsExtra,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if (dev) {
|
||||||
|
manifestExtra.content_security_policy = "script-src 'self' 'unsafe-eval'; object-src 'self'";
|
||||||
|
}
|
||||||
|
|
||||||
if (target === 'chrome') {
|
if (target === 'chrome') {
|
||||||
manifestExtra.options_ui = {chrome_style: true};
|
manifestExtra.options_ui = {chrome_style: true};
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue