emacs-orgmode
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [Orgmode] Encoded slashes in capture protocol URIs (via Chromium)


From: Mattias Jämting
Subject: Re: [Orgmode] Encoded slashes in capture protocol URIs (via Chromium)
Date: Sat, 4 Dec 2010 18:59:41 +0100

I solved it in a different way, but none the less very hacky :)

http://www.mail-archive.com/address@hidden/msg33861.html

/Mattias

On Sat, Dec 4, 2010 at 15:23, Edward Lilley <address@hidden> wrote:
I've just had quite a bit of trouble setting up org capture protocol
handling with the Chromium web browser.

Using the _javascript_ function encodeURIComponent() replaces slashes with
a %2F, as expected; the problem is then that xdg-open fails to open URIs
containing %2F. Eventually I realised that xdg-open *can* accept a %2F,
but *only* if it comes after a "?" in the URI.

So, as an ugly hack, I set the identifying character for the org-capture
template that handles my bookmarks to be a "?"; this way, any occurrence
of %2F will come after a "?", so xdg-open won't complain!

So the bookmarklet (attached to the F4 key in chromium, using the
"yakshave" extension" looks like this:

yak.bindings.add({
   '<f4>': {
       onkeydown: function(event) {
       eval('location.href="" +
       encodeURIComponent(location.href) + "/" +
       encodeURIComponent(document.title) + "/" +
       encodeURIComponent(window.getSelection());');
       }
   }
});

Of course this is basically a horrible hack; but it might help some of
you out very slightly!

--
Edward Lilley <address@hidden>
http://www.ugnus.uk.eu.org/~edward/



_______________________________________________
Emacs-orgmode mailing list
Please use `Reply All' to send replies to the list.
address@hidden
http://lists.gnu.org/mailman/listinfo/emacs-orgmode




--

 Mattias Jämting   www.jwd.se | address@hidden | 070-6760182
  Internet, Coding, Design, Usablility - since 1998 


reply via email to

[Prev in Thread] Current Thread [Next in Thread]