Find a file
2019-01-19 00:42:56 +00:00
.circleci fix eslint, add to ci 2019-01-06 21:00:47 +00:00
server Use emacs capture template syntax 2019-01-13 15:39:09 +00:00
src custom name for unrestricted package 2019-01-19 00:42:56 +00:00
utils Add env variable to configure permissions 2019-01-16 22:25:16 +00:00
.babelrc set up webpack etc 2019-01-05 10:18:14 +00:00
.eslintrc.js fix eslint, add to ci 2019-01-06 21:00:47 +00:00
.flowconfig notification, proper message routing, etc 2019-01-05 10:18:14 +00:00
.gitignore Collapse boilerplate in a single commit 2019-01-05 10:17:50 +00:00
LICENSE.md update webpack and version 2019-01-05 13:55:22 +00:00
package.json custom name for unrestricted package 2019-01-19 00:42:56 +00:00
publish fallback to git hash in publish script 2019-01-16 22:25:16 +00:00
README.md add info on unrestricted extension 2019-01-16 22:35:50 +00:00
TODO.org Add env variable to configure permissions 2019-01-16 22:25:16 +00:00
webpack.config.js custom name for unrestricted package 2019-01-19 00:42:56 +00:00

Build status: CircleCI

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

See a short demo.

Requirements

No third party dependencies! Just python 3.6.

Running

  1. Install server counterpart as systemd service (to autostart it): server/setup --path /path/to/your/capture.org [--port <custom port>] [--template <custom org-capture template>].

    Or alternatively, just run it directly if you don't want to autostart it: server/grasp_server.py --path /path/to/your/capture.org [--port <custom_port>] [--template <custom org-capture template>].

  2. Install chrome extension and configure hotkeys

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

Using arbitrary endpoint instead of localhost

If you want to run the server remotely, you need extra permissions. Chrome store requires some extra checks when publishing if you do that, so I figured it's better to have localhost only by default. You can use unrestricted extension instead and connect to the remote host. Ssee grasp-anyhost packages here, or 'Building' section if you'd rather build it yourself. Don't forget to set the endpoint in extension settings!

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/alongside your browser bookmarks, by default you don't have much choice and have to copy everything manually. For an average Org Mode user it's a torture.

For a while, I used the only Chrome extension for that (as for January 2019). However, it relies on setting up MIME handler which is quite flaky for many people. What is more, capturing via org template requires always running emacs daemon, which might be too much for some people. But the worst thing is if capturing fails, you have to way of knowing about it. After losing few days of captured stuff due to MIME handler mysteriously not working, I got fed up and figured it's time to implement something more reliable.

My approach still requires a running server, but it's a simple python script which simply appends a text entry to a text file. The backend always responds back and in case anything fails, you get a notification.

Extra collateral benefit is that you can potentially add anything as a backend, e.g. you might be more of a Markdown or Todo.txt fan (let me know if you are interested in that!).

Potentional improvements

  • due to server counterpart, one could even run it elsewhere, not necessarily on localhost
  • also see todos

Building extension

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

You're gonna need npm for building extension.

npm install
npm run build

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

Unrestricted url

If you do need unresticted url permissions, build the extensions like that: ANY_URL=yes npm run build.

Permissions used

  • storage for settings

  • notifications for showing error notification

  • activeTab for requesting url, title and selected text

  • http://localhost/capture for talking with backend

  • content_security_policy needed for webpack.

Credits