From 7c2397bbfd31e9597e88e4b00c0337a39004dddd Mon Sep 17 00:00:00 2001 From: Maxim Baz Date: Sat, 16 Mar 2019 01:25:33 +0100 Subject: [PATCH] Add Firefox make goal (#41) --- .gitignore | 3 +- Makefile | 55 ++++++++++++------- src/{manifest.json => manifest-chromium.json} | 3 +- src/manifest-firefox.json | 46 ++++++++++++++++ 4 files changed, 86 insertions(+), 21 deletions(-) rename src/{manifest.json => manifest-chromium.json} (92%) create mode 100644 src/manifest-firefox.json diff --git a/.gitignore b/.gitignore index a70177f..443e877 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,5 @@ -/chrome +/chromium +/firefox /src/node_modules /src/css /src/js diff --git a/Makefile b/Makefile index 9752795..e4faf91 100644 --- a/Makefile +++ b/Makefile @@ -1,31 +1,48 @@ -CLEAN_FILES := chrome +CLEAN_FILES := chromium firefox .PHONY: all -all: extension chrome +all: extension chromium firefox .PHONY: extension extension: $(MAKE) -C src -CHROME_FILES := manifest.json \ - *.css \ - *.png \ - popup/*.html \ - popup/*.svg \ - options/*.html -CHROME_FILES := $(wildcard $(addprefix src/,$(CHROME_FILES))) \ - src/css/popup.dist.css \ - src/css/options.dist.css \ - src/js/background.dist.js \ - src/js/popup.dist.js \ - src/js/options.dist.js \ - src/js/inject.dist.js -CHROME_FILES := $(patsubst src/%,chrome/%,$(CHROME_FILES)) +EXTENSION_FILES := \ + src/*.css \ + src/*.png \ + src/popup/*.html \ + src/popup/*.svg \ + src/options/*.html +EXTENSION_FILES := \ + $(wildcard $(EXTENSION_FILES)) \ + src/css/popup.dist.css \ + src/css/options.dist.css \ + src/js/background.dist.js \ + src/js/popup.dist.js \ + src/js/options.dist.js \ + src/js/inject.dist.js +CHROMIUM_FILES := $(patsubst src/%,chromium/%, $(EXTENSION_FILES)) +FIREFOX_FILES := $(patsubst src/%,firefox/%, $(EXTENSION_FILES)) -.PHONY: chrome -chrome: extension $(CHROME_FILES) +.PHONY: chromium +chromium: extension $(CHROMIUM_FILES) chromium/manifest.json -$(CHROME_FILES) : chrome/% : src/% +$(CHROMIUM_FILES) : chromium/% : src/% + [ -d $(dir $@) ] || mkdir -p $(dir $@) + cp $< $@ + +chromium/manifest.json : src/manifest-chromium.json + [ -d $(dir $@) ] || mkdir -p $(dir $@) + cp $< $@ + +.PHONY: firefox +firefox: extension $(FIREFOX_FILES) firefox/manifest.json + +$(FIREFOX_FILES) : firefox/% : src/% + [ -d $(dir $@) ] || mkdir -p $(dir $@) + cp $< $@ + +firefox/manifest.json : src/manifest-firefox.json [ -d $(dir $@) ] || mkdir -p $(dir $@) cp $< $@ diff --git a/src/manifest.json b/src/manifest-chromium.json similarity index 92% rename from src/manifest.json rename to src/manifest-chromium.json index 1c6f1ad..c5f5de9 100644 --- a/src/manifest.json +++ b/src/manifest-chromium.json @@ -4,7 +4,7 @@ "name": "Browserpass", "description": "Browser extension for zx2c4's pass (password manager)", "version": "3.0.0", - "author": ["Maxim Baz ", "Steve Gilberd "], + "author": "Maxim Baz , Steve Gilberd ", "homepage_url": "https://github.com/browserpass/browserpass-extension", "background": { "persistent": true, @@ -23,6 +23,7 @@ "open_in_tab": false }, "permissions": [ + "clipboardWrite", "activeTab", "nativeMessaging", "notifications", diff --git a/src/manifest-firefox.json b/src/manifest-firefox.json new file mode 100644 index 0000000..7eeccbf --- /dev/null +++ b/src/manifest-firefox.json @@ -0,0 +1,46 @@ +{ + "manifest_version": 2, + "name": "Browserpass", + "description": "Browser extension for zx2c4's pass (password manager)", + "version": "3.0.0", + "author": "Maxim Baz , Steve Gilberd ", + "homepage_url": "https://github.com/browserpass/browserpass-extension", + "background": { + "persistent": true, + "scripts": ["js/background.dist.js"] + }, + "icons": { + "128": "icon-lock.png" + }, + "browser_action": { + "default_icon": "icon-lock.png", + "default_popup": "popup/popup.html" + }, + "options_ui": { + "page": "options/options.html", + "open_in_tab": false + }, + "permissions": [ + "clipboardWrite", + "activeTab", + "nativeMessaging", + "notifications", + "webRequest", + "webRequestBlocking", + "http://*/*", + "https://*/*" + ], + "applications": { + "gecko": { + "id": "browserpass@maximbaz.com", + "strict_min_version": "50.0" + } + }, + "commands": { + "_execute_browser_action": { + "suggested_key": { + "default": "Ctrl+Shift+L" + } + } + } +}