Skip to content

Commit

Permalink
Use separate manifest files for mozilla and chrome
Browse files Browse the repository at this point in the history
  • Loading branch information
kForth committed Jan 9, 2023
1 parent d62f5c1 commit edc66fb
Show file tree
Hide file tree
Showing 6 changed files with 55 additions and 24 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
web-ext-artifacts/
build/
dist/

.DS_Store
8 changes: 4 additions & 4 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,15 @@
"version": "2.0.0",
"tasks": [
{
"label": "build extension",
"label": "zip mozilla addon",
"type": "shell",
"command": "web-ext build",
"command": "scripts/package-addon mozilla",
"problemMatcher": []
},
{
"label": "sign extension",
"label": "zip chrome addon",
"type": "shell",
"command": "web-ext sign",
"command": "scripts/package-addon chrome",
"problemMatcher": []
}
]
Expand Down
11 changes: 3 additions & 8 deletions manifest.json → manifest_chrome.json
Original file line number Diff line number Diff line change
@@ -1,21 +1,16 @@
{
"manifest_version": 3,
"name": "Random McMaster Page",
"version": "1.0.1",
"version": "1.0.3",
"description": "Adds a 'Random Page' link to the bottom navbar on mcmaster.com",
"author": "[email protected]",
"icons": {
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"64": "icons/icon64.png",
"96": "icons/icon96.png",
"128": "icons/icon128.png",
"512": "icons/icon512.png"
},
"browser_specific_settings": {
"gecko": {
"id": "{a33c470b-d151-4fc7-ae43-db4ab4d38b3f}"
}
"128": "icons/icon128.png"
},
"content_scripts": [
{
Expand Down
31 changes: 31 additions & 0 deletions manifest_mozilla.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
{
"manifest_version": 2,
"name": "Random McMaster Page",
"version": "1.0.3",
"description": "Adds a 'Random Page' link to the bottom navbar on mcmaster.com",
"author": "[email protected]",
"icons": {
"16": "icons/icon16.png",
"32": "icons/icon32.png",
"48": "icons/icon48.png",
"64": "icons/icon64.png",
"96": "icons/icon96.png",
"128": "icons/icon128.png"
},
"content_scripts": [
{
"matches": [
"*://*.mcmaster.com/*"
],
"js": [
"random_page.js"
]
}
],
"browser_specific_settings": {
"gecko": {
"id": "{a33c470b-d151-4fc7-ae43-db4ab4d38b3f}",
"strict_min_version": "52.0"
}
}
}
15 changes: 15 additions & 0 deletions scripts/package-addon
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
# Create directories
mkdir -p dist
mkdir -p build && cd build

# Copy files to temp directory
cp -r ../icons/ ./
cp -r ../README.md ./
cp -r ../LICENSE ./
cp -r ../random_page.js ./
cp -r ../manifest_$1.json ./manifest.json

# Zip files and cleanup
rm -f ../dist/random_mcmaster_page-$1.zip
zip -r ../dist/random_mcmaster_page-$1.zip *
cd .. && rm -r build
12 changes: 0 additions & 12 deletions web-ext-config.js

This file was deleted.

0 comments on commit edc66fb

Please sign in to comment.