Skip to content

Commit ceb0b61

Browse files
committed
fix for firefox & bump to 1.3
1 parent 5da7e15 commit ceb0b61

File tree

5 files changed

+37
-22
lines changed

5 files changed

+37
-22
lines changed

.github/workflows/build.yml

Lines changed: 1 addition & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -36,20 +36,11 @@ jobs:
3636
- name: Build Chrome version
3737
run: ./build.sh -t chrome
3838

39-
- name: Build Edge version
40-
run: ./build.sh -t edge
41-
4239
- name: Upload Chrome artifact
4340
uses: actions/upload-artifact@v4
4441
with:
4542
name: chrome-extension
4643
path: arkpets-chrome-*.zip
47-
48-
- name: Upload Edge artifact
49-
uses: actions/upload-artifact@v4
50-
with:
51-
name: edge-extension
52-
path: arkpets-edge-*.zip
5344

5445
# Create GitHub Release when a tag is pushed
5546
- name: Create Release
@@ -58,6 +49,5 @@ jobs:
5849
with:
5950
files: |
6051
arkpets-chrome-*.zip
61-
arkpets-edge-*.zip
6252
env:
63-
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
53+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

build.sh

Lines changed: 24 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,16 +13,16 @@ while [[ $# -gt 0 ]]; do
1313
;;
1414
*)
1515
echo "Unknown argument: $1"
16-
echo "Usage: $0 [-t|--target chrome|edge]"
16+
echo "Usage: $0 [-t|--target chrome|edge|firefox]"
1717
exit 1
1818
;;
1919
esac
2020
done
2121

2222
# Validate target
23-
if [[ "$TARGET" != "chrome" && "$TARGET" != "edge" ]]; then
23+
if [[ "$TARGET" != "chrome" && "$TARGET" != "edge" && "$TARGET" != "firefox" ]]; then
2424
echo "Invalid target: $TARGET"
25-
echo "Target must be either 'chrome' or 'edge'"
25+
echo "Target must be either 'chrome', 'edge', or 'firefox'"
2626
exit 1
2727
fi
2828

@@ -43,17 +43,36 @@ fi
4343
# Build the ArkPets-Web
4444
echo "Building ArkPets-Web..."
4545
pushd ArkPets-Web
46+
npm install
4647
npm run build
4748
popd
4849

4950
# Build the project
5051
echo "Building version $MANIFEST_VERSION..."
52+
npm install
5153
npm run build
5254

53-
# Modify manifest for Edge if needed
55+
# Function to perform portable sed in-place replacement
56+
sed_in_place() {
57+
local pattern="$1"
58+
local file="$2"
59+
if [[ "$OSTYPE" == "darwin"* ]]; then
60+
# macOS/BSD sed requires an extension argument
61+
sed -i '' "$pattern" "$file"
62+
else
63+
# GNU sed (Linux) works without an extension
64+
sed -i "$pattern" "$file"
65+
fi
66+
}
67+
68+
# Modify manifest for Edge/Firefox if needed
5469
if [ "$TARGET" = "edge" ]; then
5570
echo "Modifying manifest.json for Edge..."
56-
sed -i 's/Chrome/Edge/g' dist/manifest.json
71+
sed_in_place 's/Chrome/Edge/g' dist/manifest.json
72+
elif [ "$TARGET" = "firefox" ]; then
73+
echo "Modifying manifest.json for Firefox..."
74+
# Add-on names cannot contain the Mozilla or Firefox trademarks :D
75+
sed_in_place 's/ Chrome//g' dist/manifest.json
5776
fi
5877

5978
# Create zip file with version number

package-lock.json

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

package.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
{
22
"name": "arkpets-chrome",
3-
"version": "1.2.0",
3+
"version": "1.3.0",
44
"private": true,
55
"scripts": {
66
"watch": "webpack build --watch --mode development",

src/manifest.json

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
"manifest_version": 3,
33
"name": "ArkPets Chrome",
44
"description": "Shows Arknights characters on web pages",
5-
"version": "1.2.0",
5+
"version": "1.3.0",
66
"permissions": [
77
"storage"
88
],
@@ -30,5 +30,11 @@
3030
"*.js.map"
3131
],
3232
"matches": ["<all_urls>"]
33-
}]
34-
}
33+
}],
34+
"browser_specific_settings": {
35+
"gecko": {
36+
"id": "arkpets@ericfu.me",
37+
"strict_min_version": "58.0"
38+
}
39+
}
40+
}

0 commit comments

Comments
 (0)