remove ANY_HOST stuff

This commit is contained in:
Dima Gerasimov 2020-02-08 16:28:37 +00:00
parent 70e60a8276
commit 74a141550f
4 changed files with 7 additions and 14 deletions

View file

@ -75,9 +75,12 @@ No third party dependencies! Just `python3`.
# Permissions used
* `http://localhost/capture` for talking with the backend
If you want to use an external URL as an endpoint, you will be prompted for a permission dynamically.
* `storage` for settings
* `notifications` for showing error notification
* `activeTab` for requesting url, title and selected text
* `notifications` for showing notification
* `activeTab` for requesting page info
# Building & developing
The most up-to-date instructions should be in [CI config](./.circleci/config.yml).
@ -89,9 +92,6 @@ You need `npm` for building the extension.
After that you can find the extension in `dist` directory and 'Load unpacked** if necessary. There is also Flow and Eslint set up.
## building any host version
If you do need unresticted url permissions, build the extensions like that: `ANY_HOST=yes ./build`.
## testing and linting
Check [CI config](./.circleci/config.yml) to figure out all the checks I'm doing.

View file

@ -17,6 +17,5 @@ function rebuild {
}
for browser in "chrome" "firefox"; do
TARGET="$browser" rebuild "grasp-$VERSION-$browser.zip"
TARGET="$browser" ANY_HOST='yes' rebuild "grasp-$VERSION-anyhost-$browser.zip"
TARGET="$browser" rebuild "grasp-$VERSION-$browser.zip"
done

View file

@ -2,6 +2,5 @@
module.exports = {
NODE_ENV: (process.env.NODE_ENV || "development"),
PORT: (process.env.PORT || 3000),
ANY_HOST: (process.env.ANY_HOST ? true : false),
TARGET: (process.env.TARGET || 'chrome'),
};

View file

@ -14,7 +14,7 @@ const baseManifest = require('./src/manifest.json');
const target = env.TARGET;
const dev = env.NODE_ENV === "development";
const pkg_name = (env.ANY_HOST ? "grasp (any host)" : "grasp") + (dev ? ' [dev]' : '');
const pkg_name = "grasp" + (dev ? ' [dev]' : '');
// TODO make permissions literate
const permissions = [
@ -25,11 +25,6 @@ const permissions = [
"https://localhost/capture"
];
if (env.ANY_HOST) {
permissions.push("https://*/capture");
}
// Firefox wouldn't let you rebind its default shortcuts most of which use Shift
// On the other hand, Chrome wouldn't let you use Alt
const modifier = target === 'chrome' ? 'Shift' : 'Alt';