Next: The capture protocol, Up: Protocols for External Access   [Contents][Index]


17.16.1 The store-link protocol ¶

Using the store-link handler, you can copy links, to that they can be inserted using M-x org-insert-link or yanking. More precisely, the command

emacsclient "org-protocol://store-link?url=URL&title=TITLE"

stores the following link:

[[URL][TITLE]]

In addition, URL is pushed on the kill-ring for yanking. You need to encode URL and TITLE if they contain slashes, and probably quote those for the shell.

To use this feature from a browser, add a bookmark with an arbitrary name, e.g., ‘Org: store-link’ and enter this as Location:

javascript:location.href='org-protocol://store-link?' +
      new URLSearchParams({url:location.href, title:document.title});void(0);

Title is an optional parameter. Another expression was recommended earlier:

javascript:location.href='org-protocol://store-link?url='+
      encodeURIComponent(location.href);void(0);

The latter form is compatible with older Org versions from 9.0 to 9.4.