karlicoss / grasp

A reliable org-capture browser extension for Chrome/Firefox
https://beepb00p.xyz/grasp.html
MIT License
341 stars 19 forks source link
annotation browser-extension capture chrome-extension firefox-extension org-capture org-mode pkm webext

Grasp is a browser extension for Chrome and Firefox, which adds a button/keybinding to capture current page title and url, possibly selected text, additional comments or tags and adds it into your Org Mode file.

Screenshot, short demo.

Running

In the simplest setup, the server runs locally, and you can use 'localhost' version of the extension. If you have to work on a computer where you can't run python scripts, or your target capture file is just not there, you can selfhost the server part elsewhere. Don't forget to set the endpoint in extension settings!

Setup

That's it! If you're using custom port make sure it's the same as in the extension settings (default is 12212).

Configuration

Here you can find some references for the --template syntax.

If you are looking for more flexible formatting that's not supported by template syntax, see config.py.example. You can modify it to your liking and pass as --config to grasp_backend setup command.

Motivation

Why use org-capture? Well, it's hard to explain, maybe some other time... However, if you do know you want to use it instead of/alongside your browser bookmarks, by default you don't have much choice and have to copy everything manually. For an experienced enough org-mode user it's no less than a torture.

This tool:

Comparison with similar tools:

org-capture-extension

org-protocol-capture-html

Same pros/cons as org-capture-extension as it's relying on org-protocol.

In addition:

Potential improvements

Permissions used

Building & developing

The most up-to-date instructions should be in CI config.

You need npm for building the extension.

npm install
./build --target <browser> # e.g. ./build --target chrome or ./build --target firefox

After that you can find the extension in dist directory and 'Load unpacked** if necessary. There is also Flow and Eslint set up.

testing and linting

Check CI config to figure out all the checks I'm doing.

There are some end2end tests which check both web extension and the browser, but require GUI, so they can't run on github actions. You can run them manually though.

publishing

Credits