-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add page action, better project layout
- Loading branch information
Showing
24 changed files
with
7,937 additions
and
115 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,4 +1,5 @@ | ||
node_modules/ | ||
web-ext-artifacts/ | ||
dist/ | ||
browser-polyfill.js | ||
*.pem |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,31 +1,48 @@ | ||
# Upload to Danbooru Web Extension | ||
|
||
Add a context menu option for images to upload to Danbooru. | ||
Add a page action and a context menu option (for images) to upload to ![cardboard box](/danbooru.svg) Danbooru. Replacement for [bookmarklets](https://danbooru.donmai.us/static/bookmarklet). | ||
|
||
## Usage | ||
|
||
![Page action demo](/screenshots/page-action.png) | ||
|
||
![Context menu demo](/screenshots/context-menu.png) | ||
|
||
## Build | ||
|
||
```sh | ||
npm install --global web-ext | ||
npm install webextension-polyfill | ||
cp node_modules/webextension-polyfill/dist/browser-polyfill.js . | ||
web-ext build -n upload_to_danbooru.zip -i README.md | ||
npm i | ||
npm run build | ||
``` | ||
|
||
### Chrome | ||
Extension package will be located in `web-ext-artifacts/` folder. | ||
|
||
## Run Tests | ||
|
||
```sh | ||
npm install --global crx3 | ||
test -f .key.pem || openssl genrsa -out .key.pem 4096 | ||
crx3 -p .key.pem -o web-ext-artifacts/upload_to_danbooru.crx < web-ext-artifacts/upload_to_danbooru.zip | ||
npm test | ||
``` | ||
|
||
## Install | ||
## Install In Developer Mode | ||
|
||
```sh | ||
firefox web-ext-artifacts/upload_to_danbooru.zip | ||
``` | ||
Make sure you have built extension. | ||
|
||
### Firefox | ||
|
||
* Open `about:debugging` | ||
* Click `Load Temporary Add-on` | ||
* Select `dist/manifest.json` file | ||
|
||
### Chrome | ||
|
||
Open `chrome://extensions`, enable `Developer mode`, then drop | ||
`web-ext-artifacts/upload_to_danbooru.crx` onto the page. | ||
* Open Chrome Settings | ||
* Select Extensions | ||
* Enable developer mode | ||
* Click Load Unpacked | ||
* Select `dist/` folder | ||
|
||
### web-ext | ||
|
||
```sh | ||
npx web-ext run | ||
``` |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
#!/bin/sh | ||
|
||
set -e | ||
set -v | ||
|
||
rm -fr dist/ | ||
mkdir dist | ||
cp -t dist/ node_modules/webextension-polyfill/dist/browser-polyfill.js{,.map} | ||
cp -a src/. dist/ | ||
npx web-ext build --overwrite-dest |
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.