Compare commits

...

2 commits

Author SHA1 Message Date
Thomas Rupprecht 9740fc47a7 improve README 2023-01-05 17:14:32 +01:00
Thomas Rupprecht 86b3b7ef5e add web-ext-config.js and add watch scripts 2023-01-05 16:40:11 +01:00
3 changed files with 34 additions and 12 deletions

View file

@ -10,20 +10,32 @@
## Install
```ssh
$ git clone https://gitea.usrspace.at/XimeX/usrspace-browser-addon.git
$ npm install -g web-ext
$ npm install
$ npm i -g web-ext
$ npm i
```
- Open `about:debugging` or `about:debugging-new` in Firefox
- Click `Load Temporary Add-on...`
- Navigate to Add-on Repository
- Open `manifest.json`
- Use it
## Run / Develop / Debug
```ssh
$ npm run watch:{firefox|firefox-android|chromium}
```
If more options are needed add them after a `--`.
Some useful options:
- `--devtools`
- `--firefox-apk=...`
- `--android-device=...`
Example: `npm run watch:firefox-android -- --firefox-apk=org.mozilla.fenix --firefox-device=XXXXXXXX`.
## Build
```ssh
$ npm run build
```
## Release
```ssh
$ npm version {major|minor|patch|...}
$ web-ext build
```
## Credits

View file

@ -11,11 +11,14 @@
"scripts": {
"copy-browser-polyfill": "cp node_modules/webextension-polyfill/dist/browser-polyfill.js src/browser-polyfill.js",
"copy-version": "sed -i 's/^\t\"version\": \".*\",$/\t\"version\": \"'$(rg '^\t\"version\": \"(.+)\",$' -r '$1' < package.json)'\",/' src/manifest.json",
"lint": "web-ext lint -w -s src/",
"prebuild": "cp LICENSE.txt src/",
"build": "web-ext build -o -s src/ -n \"_usr_space-{version}.zip\"",
"postbuild": "rm src/LICENSE.txt",
"lint": "web-ext lint -w",
"test": "echo \"Error: no test specified\" && exit 0",
"watch:firefox": "web-ext run -t firefox-desktop",
"watch:firefox-android": "web-ext run -t firefox-android",
"watch:chromium": "web-ext run -t chromium",
"prebuild": "cp LICENSE.txt src/",
"build": "web-ext build",
"postbuild": "rm src/LICENSE.txt",
"postinstall": "npm run copy-browser-polyfill",
"preversion": "npm run lint && npm test",
"version": "npm run copy-version && git add -u",

7
web-ext-config.js Normal file
View file

@ -0,0 +1,7 @@
module.exports = {
sourceDir: 'src/',
build: {
overwriteDest: true,
filename: '_usr_space-{version}.zip',
},
};