My example case:
In my .keysnailrc I have this function:
Running the function sends a bookmark to Emacs org-mode capture.
To call the function from a custom button, I use this code:
Org-protocol can be used to send data from a browser to Emacs. For example, you can use a bookmarklet to send the current URL, title and selection from the browser into Emacs org-mode capture.
On a Windows system I found that this works fine with Emacs UTF-8 settings when using Chrome and IE, but the data sent from Firefox was not UTF-8 (or utf-16-le) encoded. To handle this I used a special capture template for Firefox:
A function which runs after content is captured checks for the "CODING" property, if it is there it recodes the buffer and removes the property:
Now text can be selected in the browser and sent to emacs org-mode capture using this bookmarklet code:
When the capture is finalized, the data will be recoded to utf-8.