emacs-orgmode@gnu.org archives
 help / color / mirror / code / Atom feed
* Encoded slashes in capture protocol URIs (via Chromium)
@ 2010-12-04 14:23 Edward Lilley
  2010-12-04 17:59 ` Mattias Jämting
  0 siblings, 1 reply; 2+ messages in thread
From: Edward Lilley @ 2010-12-04 14:23 UTC (permalink / raw)
  To: emacs-orgmode

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="org-protocol:/capture:/?/" +
        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 <ejlilley@gmail.com>
http://www.ugnus.uk.eu.org/~edward/

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: Encoded slashes in capture protocol URIs (via Chromium)
  2010-12-04 14:23 Encoded slashes in capture protocol URIs (via Chromium) Edward Lilley
@ 2010-12-04 17:59 ` Mattias Jämting
  0 siblings, 0 replies; 2+ messages in thread
From: Mattias Jämting @ 2010-12-04 17:59 UTC (permalink / raw)
  Cc: emacs-orgmode


[-- Attachment #1.1: Type: text/plain, Size: 1891 bytes --]

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

http://www.mail-archive.com/emacs-orgmode@gnu.org/msg33861.html

<http://www.mail-archive.com/emacs-orgmode@gnu.org/msg33861.html>/Mattias

On Sat, Dec 4, 2010 at 15:23, Edward Lilley <ejlilley@gmail.com> 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="org-protocol:/capture:/?/" +
>        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 <ejlilley@gmail.com>
> http://www.ugnus.uk.eu.org/~edward/
>
>
>
> _______________________________________________
> Emacs-orgmode mailing list
> Please use `Reply All' to send replies to the list.
> Emacs-orgmode@gnu.org
> http://lists.gnu.org/mailman/listinfo/emacs-orgmode
>
>


-- 

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

[-- Attachment #1.2: Type: text/html, Size: 3589 bytes --]

[-- Attachment #2: Type: text/plain, Size: 201 bytes --]

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

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2010-12-04 18:00 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-12-04 14:23 Encoded slashes in capture protocol URIs (via Chromium) Edward Lilley
2010-12-04 17:59 ` Mattias Jämting

Code repositories for project(s) associated with this public inbox

	https://git.savannah.gnu.org/cgit/emacs/org-mode.git

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).