Add env variable to configure permissions

This commit is contained in:
Dima Gerasimov 2019-01-16 21:43:57 +00:00 committed by Dmitrii Gerasimov
parent a5e1d70cad
commit 03ce431546
4 changed files with 22 additions and 12 deletions

View file

@ -1,7 +1,5 @@
* TODO [#B] doesn't look like hotkey working unless you manually rebind.. wtf?
* TODO [#C] update screens and video now that the notification is nicer
* TODO [#C] how to test it? try on different pages?
https://www.blazemeter.com/blog/6-easy-steps-testing-your-chrome-extension-selenium
looks tricky...
@ -12,7 +10,7 @@
* TODO [#D] do not minfy for dev
* TODO [#D] make manifest templated so we don't have to hardcode actions
* TODO [#D]
* TODO [#D] production build?
## Packing
After the development of your extension run the command
@ -42,6 +40,9 @@ Now, the content of `build` folder will be the extension ready to be submitted t
* DONE [#B] docs on using
CLOSED: [2019-01-06 Sun 21:39]
* DONE [#C] update screens and video now that the notification is nicer
CLOSED: [2019-01-13 Sun 15:32]
* DONE [#C] custom capture template?
CLOSED: [2019-01-13 Sun 14:57]
* DONE [#C] make notification configurable or only in case of errors

View file

@ -16,13 +16,6 @@
"default_popup": "popup.html",
"default_title": "Capture page, with extra information"
},
"permissions": [
"storage",
"notifications",
"activeTab",
"http://localhost/capture",
"https://localhost/capture"
],
"commands": {
"capture-simple": {
"description": "Quick capture: url, title and selection",

View file

@ -1,5 +1,6 @@
// tiny wrapper with default env vars
module.exports = {
NODE_ENV: (process.env.NODE_ENV || "development"),
PORT: (process.env.PORT || 3000)
NODE_ENV: (process.env.NODE_ENV || "development"),
PORT: (process.env.PORT || 3000),
ANY_HOST: (process.env.ANY_HOST ? true : false),
};

View file

@ -11,6 +11,20 @@ var webpack = require("webpack"),
const pkg = require('./package.json');
const baseManifest = require('./src/manifest.json');
const permissions = [
"storage",
"notifications",
"activeTab",
"http://localhost/capture",
"https://localhost/capture"
];
if (env.ANY_HOST) {
permissions.push("https://*/capture");
}
// load the secrets
var alias = {};
@ -78,6 +92,7 @@ var options = {
extend: {
version: pkg.version,
description: pkg.description,
permissions: permissions,
}
}
}),