Firefox extension to highlight and save text from the web.
To install (Firefox), open about:debugging
and choose "Load Temporary Add-on", then select the manifest.json
file. This is temporary (but useful for development); the add-on will be gone next time you run Firefox.
To install it more permanently:
If you're running Firefox Developer Edition, you should be able to:
- Zip up the
extensions
directory - Go to
about:addons
, thenInstall Add-on From File
, and select the zipped extension
Otherwise, the process is more involved:
- Go to
https://addons.mozilla.org/en-US/developers/addon/api/key/
(create a Firefox account if necessary) and generate credentials - Install
web-ext
:npm install -g web-ext
- Navigate to the
extensions
folder and run:web-ext sign --api-key=<JWT issuer> --api-secret=<JWT secret>
- This will create an
.xpi
file inweb-ext-artifacts
. - Go to
about:addons
, thenInstall Add-on From File
, and select the.xpi
file.
To install on mobile, the easiest way is to visit this url from your phone: https://frnsys.com/misc/hili.xpi
.
server.py
launches a simple HTTP server that accepts any data at localhost:<PORT>/
and saves it to a specified file.
Basic usage is: python server.py <SAVE FILE> <UPLOAD DIRECTORY> [-p <PORT>]
For example: python server.py ~/notes/annos.json ~/notes/saved_files -p 8888
Make sure PORT
is set to the same value in extension/hili.js
(8888
by default).
Once the extension is installed:
- Run the server, e.g.
python server.py ~/notes/annos.json ~/notes/saved_files
- Highlight some text on a page, and click the "Highlight" button that appears
I suggest running the server on system startup as a background process. E.g. you could add cd ~/hili; python server.py ~/notes/annos.json ~/notes/saved_files
to your ~/.xinitrc
or equivalent file.
You can also view your highlights by visiting the server address, e.g. localhost:8888
If you want something to happen whenever a new highlight is received, you can do something like:
#!/bin/bash
ANNOS_PATH=~/notes/web/annos.json
tail -n 0 -f $ANNOS_PATH | while read line; do
# do something here, e.g. pass $line to another script
echo $line
done