From mboxrd@z Thu Jan 1 00:00:00 1970 From: =?UTF-8?Q?Mattias_J=C3=A4mting?= Subject: Re: Org-protocol / Chrome on Linux Date: Thu, 25 Nov 2010 00:23:43 +0100 Message-ID: References: <87aao21i92.fsf@gmx.de> <87hbh7s0da.fsf@gmx.de> <87aamzrzry.fsf@gmx.de> Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable Return-path: Received: from [140.186.70.92] (port=46001 helo=eggs.gnu.org) by lists.gnu.org with esmtp (Exim 4.43) id 1PLOh7-0006eG-5o for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 18:24:10 -0500 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1PLOh5-0004W0-PU for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 18:24:09 -0500 Received: from mail-qy0-f169.google.com ([209.85.216.169]:48959) by eggs.gnu.org with esmtp (Exim 4.71) (envelope-from ) id 1PLOh5-0004VU-Mn for emacs-orgmode@gnu.org; Wed, 24 Nov 2010 18:24:07 -0500 Received: by qyk4 with SMTP id 4so4927286qyk.0 for ; Wed, 24 Nov 2010 15:24:06 -0800 (PST) Received: by qwf7 with SMTP id 7so661028qwf.0 for ; Wed, 24 Nov 2010 15:24:03 -0800 (PST) In-Reply-To: <87aamzrzry.fsf@gmx.de> List-Id: "General discussions about Org-mode." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org Errors-To: emacs-orgmode-bounces+geo-emacs-orgmode=m.gmane.org@gnu.org To: Sebastian Rose Cc: emacs-orgmode Hello again, For reference, this is how i finally got org-protocol to work in chrome on ubuntu 10.10: The problem was that chrome was running xdg-open for handling external protocols. xdg-open, or it's companion gvfs-open, couldn't parse the rather complex URL which the org-capture bookmarklet generated. So i realized that xdg-open is just a shell-script so then i modified the function open-gnome() in it like this: open_gnome() { # Handle org-protocol if (echo "$1" | grep -q '^org-protocol://'); then emacsclient "$1" else=09 # This is the standard way... if gvfs-open --help 2>/dev/null 1>&2; then gvfs-open "$1" else gnome-open "$1" fi fi ... } Suddenly all works. Remember to back-up xdg-open if you want to try this. Mattias 2010/9/30 Sebastian Rose : > Sebastian Rose writes: >> Mattias J=C3=A4mting writes: >>> Yes i'm running a pretty standard Ubuntu 10.04 setup. >>> >>> I managed to get it working on chrome by removing the >>> encodeURIComponent command on location.href. >>> >>> I could simulate it in the terminal like this. >>> >>> mattias@helium:~$ xdg-open org-protocol://capture://http%3A%2F%2Forgmod= e.org >>> Error showing URL: Operation not supported >>> mattias@helium:~$ xdg-open org-protocol://capture://http://orgmode.org >>> mattias@helium:~$ (worked) >>> >>> Strange that it worked in FF. Maybe Chrome and FF encodes URIs differen= tly? >> >> >> Ooops! >> >> I just was going to blame Google. >> >> Looking into the ECMA standard, I found this: >> >> 15.1.3 URI Handling Function Properties >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0... ... >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0A URI is composed of a sequence of components= separated by >> =C2=A0 =C2=A0 =C2=A0 =C2=A0component separators. The general form >> =C2=A0 =C2=A0 =C2=A0 =C2=A0is: >> =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0 =C2=A0Scheme : F= irst / Second ; Third ? Fourth >> >> =C2=A0 =C2=A0 =C2=A0 =C2=A0where the italicised names represent componen= ts and the =E2=80=9C:=E2=80=9D, =E2=80=9C/=E2=80=9D, >> =C2=A0 =C2=A0 =C2=A0 =C2=A0=E2=80=9C;=E2=80=9D and =E2=80=9C?=E2=80=9D a= re reserved characters used as separators. The >> =C2=A0 =C2=A0 =C2=A0 =C2=A0encodeURI and decodeURI functions are intende= d to work with >> =C2=A0 =C2=A0 =C2=A0 =C2=A0complete URIs; they assume that any reserved = characters in the >> =C2=A0 =C2=A0 =C2=A0 =C2=A0URI are intended to have special meaning and = so are not >> =C2=A0 =C2=A0 =C2=A0 =C2=A0encoded. The encodeURIComponent and decodeURI= Component functions >> =C2=A0 =C2=A0 =C2=A0 =C2=A0are intended to work with the individual comp= onent parts of a >> =C2=A0 =C2=A0 =C2=A0 =C2=A0URI; they assume that any reserved characters= represent text and >> =C2=A0 =C2=A0 =C2=A0 =C2=A0so must be encoded so that they are not inter= preted as reserved >> =C2=A0 =C2=A0 =C2=A0 =C2=A0characters when the component is part of a co= mplete URI. >> >> >> That document states "encodeURI" is to be used with complete URIs (as >> the name says...). =C2=A0Funny. =C2=A0Chrome is the only browser that wo= rks like >> that :) >> >> I'll go and adjust the docs. >> >> >> Thanks for your Report!! >> > > > > Actually --- errr --- there is nothing to adjust. =C2=A0The docs are exac= tly > right. > > This is because of some =C3=B6rfflkjsgs in xdg-open. > > No one ever said something about xdg-open. =C2=A0Org-protocol is supposed= to > work with emacsclient: > > mattias@helium:~$ emacsclient org-protocol://capture://http%3A%2F%2Forgmo= de.org > > > works. > > > =C2=A0Sebastian > > --=20 =C2=A0Mattias J=C3=A4mting =C2=A0=C2=A0www.jwd.se=C2=A0|=C2=A0mattias@jwd.s= e=C2=A0| 070-6760182 =C2=A0=C2=A0Internet, Coding, Design, Usablility - since 1998