Skip to content

Commit

Permalink
Refactor build script and update manifest files
Browse files Browse the repository at this point in the history
  • Loading branch information
tztsai committed Nov 11, 2024
1 parent 6c77f31 commit 359562f
Show file tree
Hide file tree
Showing 3 changed files with 36 additions and 7 deletions.
11 changes: 6 additions & 5 deletions build/readability/build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,15 @@ cd "$(dirname "$0")"

# before
npm ci 2> /dev/null || npm i
mkdir -p tmp
# mkdir -p tmp

# readability.min.js
cp node_modules/@mozilla/readability/Readability.js tmp/readability.js
npx terser --compress --mangle -- tmp/readability.js > tmp/readability.min.js
# cp node_modules/@mozilla/readability/Readability.js tmp/readability.js
# npx terser --compress --mangle -- tmp/readability.js > tmp/readability.min.js

# copy
cp tmp/readability.min.js ../../vendor/
# cp tmp/readability.min.js ../../vendor/
mv node_modules/@mozilla/readability/Readability.js ../../vendor/readability.min.js

# after
rm -rf node_modules/ tmp/
rm -rf node_modules/
16 changes: 15 additions & 1 deletion manifest.chrome.json
Original file line number Diff line number Diff line change
Expand Up @@ -52,9 +52,23 @@

"permissions": [
"storage",
"scripting"
"scripting",
"contextMenus",
"tabs",
"commands"
],

"commands": {
"convert-to-markdown": {
"suggested_key": {
"default": "Ctrl+M",
"mac": "MacCtrl+M"
},
"description": "Convert Web Page to Interactive Markdown",
"global": true
}
},

"host_permissions": [
"file:///*"
],
Expand Down
16 changes: 15 additions & 1 deletion manifest.firefox.json
Original file line number Diff line number Diff line change
Expand Up @@ -74,9 +74,23 @@

"permissions": [
"storage",
"scripting"
"scripting",
"contextMenus",
"tabs",
"commands"
],

"commands": {
"convert-to-markdown": {
"suggested_key": {
"default": "Ctrl+M",
"mac": "MacCtrl+M"
},
"description": "Convert Web Page to Interactive Markdown",
"global": true
}
},

"host_permissions": [
"file:///*"
],
Expand Down

0 comments on commit 359562f

Please sign in to comment.