Skip to content
This repository has been archived by the owner on Jun 22, 2024. It is now read-only.

Commit

Permalink
feat: downgrade to manifest v2 for firefox
Browse files Browse the repository at this point in the history
  • Loading branch information
adriantombu committed Nov 9, 2023
1 parent d9807b6 commit 79d3e43
Show file tree
Hide file tree
Showing 5 changed files with 204 additions and 121 deletions.
5 changes: 4 additions & 1 deletion .github/workflows/publish.yml
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,13 @@ jobs:
run: xvfb-run -a yarn test

- name: Deploy
run: yarn publish:all
env:
CHROME_CLIENT_ID: ${{ secrets.CHROME_CLIENT_ID }}
CHROME_CLIENT_SECRET: ${{ secrets.CHROME_CLIENT_SECRET }}
CHROME_REFRESH_TOKEN: ${{ secrets.CHROME_REFRESH_TOKEN }}
FIREFOX_API_KEY: ${{ secrets.FIREFOX_API_KEY }}
FIREFOX_API_SECRET: ${{ secrets.FIREFOX_API_SECRET }}
run: |
yarn build
yarn manifest:chrome && yarn publish:chrome
yarn manifest:firefox && yarn publish:firefox
49 changes: 49 additions & 0 deletions manifest-v2.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"manifest_version": 2,
"name": "Amazon Alternatives",
"short_name": "amazon_alts",
"description": "Find a book or something else in Amazon, et fetch it elswehere!",
"homepage_url": "https://github.com/amazon-alternatives/extension",
"version": "1.12.8",
"author": "Adrian Tombu <adrian@otso.fr>",
"icons": {
"48": "assets/icon-48.png",
"96": "assets/icon-96.png"
},
"browser_action": {
"default_icon": {
"16": "assets/icon-16.png",
"32": "assets/icon-32.png",
"64": "assets/icon-64.png"
},
"default_title": "Amazon Alternatives",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": [
"*://*.amazon.fr/*",
"*://*.amazon.com/*",
"*://*.amazon.co.uk/*",
"*://*.amazon.com.mx/*",
"*://*.amazon.co.jp/*",
"*://*.amazon.it/*",
"*://*.amazon.in/*",
"*://*.amazon.es/*",
"*://*.amazon.cn/*",
"*://*.amazon.ca/*",
"*://*.amazon.com.br/*",
"*://*.amazon.de/*",
"*://*.amazon.com.au/*"
],
"js": ["app.js"],
"css": ["styles.css"],
"run_at": "document_end"
}
],
"browser_specific_settings": {
"gecko": {
"id": "{69085149-a34e-4f46-b6ef-ff4ea64bce4c}"
}
}
}
49 changes: 49 additions & 0 deletions manifest-v3.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
{
"manifest_version": 3,
"name": "Amazon Alternatives",
"short_name": "amazon_alts",
"description": "Find a book or something else in Amazon, et fetch it elswehere!",
"homepage_url": "https://github.com/amazon-alternatives/extension",
"version": "1.12.8",
"author": "Adrian Tombu <adrian@otso.fr>",
"icons": {
"48": "assets/icon-48.png",
"96": "assets/icon-96.png"
},
"action": {
"default_icon": {
"16": "assets/icon-16.png",
"32": "assets/icon-32.png",
"64": "assets/icon-64.png"
},
"default_title": "Amazon Alternatives",
"default_popup": "popup.html"
},
"content_scripts": [
{
"matches": [
"*://*.amazon.fr/*",
"*://*.amazon.com/*",
"*://*.amazon.co.uk/*",
"*://*.amazon.com.mx/*",
"*://*.amazon.co.jp/*",
"*://*.amazon.it/*",
"*://*.amazon.in/*",
"*://*.amazon.es/*",
"*://*.amazon.cn/*",
"*://*.amazon.ca/*",
"*://*.amazon.com.br/*",
"*://*.amazon.de/*",
"*://*.amazon.com.au/*"
],
"js": ["app.js"],
"css": ["styles.css"],
"run_at": "document_end"
}
],
"browser_specific_settings": {
"gecko": {
"id": "{69085149-a34e-4f46-b6ef-ff4ea64bce4c}"
}
}
}
3 changes: 2 additions & 1 deletion package.json
Original file line number Diff line number Diff line change
Expand Up @@ -11,9 +11,10 @@
"test": "jest",
"test:update": "jest --updateSnapshot",
"build": "webpack --config webpack.config.js --mode production",
"manifest:chrome": "cp manifest-v3.json addon/manifest.json",
"manifest:firefox": "cp manifest-v2.json addon/manifest.json",
"publish:chrome": "chrome-webstore-upload upload --auto-publish --extension-id hcjifkchlbbpcpmdbimipoidnljabnai --source ./addon --client-id $CHROME_CLIENT_ID --client-secret $CHROME_CLIENT_SECRET --refresh-token $CHROME_REFRESH_TOKEN",
"publish:firefox": "cd addon && web-ext sign --api-key $FIREFOX_API_KEY --api-secret $FIREFOX_API_SECRET || exit 0",
"publish:all": "yarn publish:chrome && yarn publish:firefox",
"prepare": "husky install"
},
"dependencies": {
Expand Down
Loading

0 comments on commit 79d3e43

Please sign in to comment.