Re: [Orgmode] Org-protocol / Chrome on Linux
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 # 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ämting 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. >>> >>> matt...@helium:~$ xdg-open org-protocol://capture://http%3A%2F%2Forgmode.org >>> Error showing URL: Operation not supported >>> matt...@helium:~$ xdg-open org-protocol://capture://http://orgmode.org >>> matt...@helium:~$ (worked) >>> >>> Strange that it worked in FF. Maybe Chrome and FF encodes URIs differently? >> >> >> Ooops! >> >> I just was going to blame Google. >> >> Looking into the ECMA standard, I found this: >> >> 15.1.3 URI Handling Function Properties >> >> ... ... >> >> A URI is composed of a sequence of components separated by >> component separators. The general form >> is: >> Scheme : First / Second ; Third ? Fourth >> >> where the italicised names represent components and the “:”, “/”, >> “;” and “?” are reserved characters used as separators. The >> encodeURI and decodeURI functions are intended to work with >> complete URIs; they assume that any reserved characters in the >> URI are intended to have special meaning and so are not >> encoded. The encodeURIComponent and decodeURIComponent functions >> are intended to work with the individual component parts of a >> URI; they assume that any reserved characters represent text and >> so must be encoded so that they are not interpreted as reserved >> characters when the component is part of a complete URI. >> >> >> That document states "encodeURI" is to be used with complete URIs (as >> the name says...). Funny. Chrome is the only browser that works like >> that :) >> >> I'll go and adjust the docs. >> >> >> Thanks for your Report!! >> > > > > Actually --- errr --- there is nothing to adjust. The docs are exactly > right. > > This is because of some örfflkjsgs in xdg-open. > > No one ever said something about xdg-open. Org-protocol is supposed to > work with emacsclient: > > matt...@helium:~$ emacsclient > org-protocol://capture://http%3A%2F%2Forgmode.org > > > works. > > > Sebastian > > -- Mattias Jämting www.jwd.se | matt...@jwd.se | 070-6760182 Internet, Coding, Design, Usablility - since 1998 ___ 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
Re: [Orgmode] Org-protocol / Chrome on Linux
Sebastian Rose writes: > Mattias Jämting 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. >> >> matt...@helium:~$ xdg-open org-protocol://capture://http%3A%2F%2Forgmode.org >> Error showing URL: Operation not supported >> matt...@helium:~$ xdg-open org-protocol://capture://http://orgmode.org >> matt...@helium:~$ (worked) >> >> Strange that it worked in FF. Maybe Chrome and FF encodes URIs differently? > > > Ooops! > > I just was going to blame Google. > > Looking into the ECMA standard, I found this: > > 15.1.3 URI Handling Function Properties > >... ... > >A URI is composed of a sequence of components separated by >component separators. The general form >is: > Scheme : First / Second ; Third ? Fourth > >where the italicised names represent components and the “:”, “/”, >“;” and “?” are reserved characters used as separators. The >encodeURI and decodeURI functions are intended to work with >complete URIs; they assume that any reserved characters in the >URI are intended to have special meaning and so are not >encoded. The encodeURIComponent and decodeURIComponent functions >are intended to work with the individual component parts of a >URI; they assume that any reserved characters represent text and >so must be encoded so that they are not interpreted as reserved >characters when the component is part of a complete URI. > > > That document states "encodeURI" is to be used with complete URIs (as > the name says...). Funny. Chrome is the only browser that works like > that :) > > I'll go and adjust the docs. > > > Thanks for your Report!! > Actually --- errr --- there is nothing to adjust. The docs are exactly right. This is because of some örfflkjsgs in xdg-open. No one ever said something about xdg-open. Org-protocol is supposed to work with emacsclient: matt...@helium:~$ emacsclient org-protocol://capture://http%3A%2F%2Forgmode.org works. Sebastian ___ 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
Re: [Orgmode] Org-protocol / Chrome on Linux
Mattias Jämting 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. > > matt...@helium:~$ xdg-open org-protocol://capture://http%3A%2F%2Forgmode.org > Error showing URL: Operation not supported > matt...@helium:~$ xdg-open org-protocol://capture://http://orgmode.org > matt...@helium:~$ (worked) > > Strange that it worked in FF. Maybe Chrome and FF encodes URIs differently? Ooops! I just was going to blame Google. Looking into the ECMA standard, I found this: 15.1.3 URI Handling Function Properties ... ... A URI is composed of a sequence of components separated by component separators. The general form is: Scheme : First / Second ; Third ? Fourth where the italicised names represent components and the “:”, “/”, “;” and “?” are reserved characters used as separators. The encodeURI and decodeURI functions are intended to work with complete URIs; they assume that any reserved characters in the URI are intended to have special meaning and so are not encoded. The encodeURIComponent and decodeURIComponent functions are intended to work with the individual component parts of a URI; they assume that any reserved characters represent text and so must be encoded so that they are not interpreted as reserved characters when the component is part of a complete URI. That document states "encodeURI" is to be used with complete URIs (as the name says...). Funny. Chrome is the only browser that works like that :) I'll go and adjust the docs. Thanks for your Report!! Sebastian ___ 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
Re: [Orgmode] Org-protocol / Chrome on Linux
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. matt...@helium:~$ xdg-open org-protocol://capture://http%3A%2F%2Forgmode.org Error showing URL: Operation not supported matt...@helium:~$ xdg-open org-protocol://capture://http://orgmode.org matt...@helium:~$ (worked) Strange that it worked in FF. Maybe Chrome and FF encodes URIs differently? Anyway. Works for me now so i'm pleased... /Mattias On Wed, Sep 1, 2010 at 01:20, Sebastian Rose wrote: > Mattias Jämting writes: >> Hello, >> >> Have someone managed to get org-protocol ( >> http://orgmode.org/worg/org-contrib/org-protocol.php) working in chrome on >> linux (i use ubuntu) ? >> >> (I have tried; it works in firefox, but not in chrome - which is my >> preferred browser nowadays.) >> >> Please let my know if it works for you, or if you have any hints on setting >> it up. > > > Do you have Gnome libs installed? On a current GNU/Linux you could > install protocol handlers for all programs as explained in > > http://orgmode.org/worg/org-contrib/org-protocol.php#sec-3_1 > > > I don't know how to setup protocols with Chrome, but once you have done > that, restarting Chrome and clicking one of the test links should work: > > http://orgmode.org/worg/org-contrib/org-protocol.php#sec-3_4 > > > Please report back if you get it to work. Maybe you could even provide > a little description we could add to the docs. > > > HTH > > Sebastian > > > (I will not use Chrome, since I don't want sites as trusted repos in my > sources list, that uses the uninstall script in the *.deb package, to > put the site into my sources list again.) > > ___ > 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 | matt...@jwd.se | 070-6760182 Internet, Coding, Design, Usablility - since 1998 ___ 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
Re: [Orgmode] Org-protocol / Chrome on Linux
Mattias Jämting writes: > Hello, > > Have someone managed to get org-protocol ( > http://orgmode.org/worg/org-contrib/org-protocol.php) working in chrome on > linux (i use ubuntu) ? > > (I have tried; it works in firefox, but not in chrome - which is my > preferred browser nowadays.) > > Please let my know if it works for you, or if you have any hints on setting > it up. Do you have Gnome libs installed? On a current GNU/Linux you could install protocol handlers for all programs as explained in http://orgmode.org/worg/org-contrib/org-protocol.php#sec-3_1 I don't know how to setup protocols with Chrome, but once you have done that, restarting Chrome and clicking one of the test links should work: http://orgmode.org/worg/org-contrib/org-protocol.php#sec-3_4 Please report back if you get it to work. Maybe you could even provide a little description we could add to the docs. HTH Sebastian (I will not use Chrome, since I don't want sites as trusted repos in my sources list, that uses the uninstall script in the *.deb package, to put the site into my sources list again.) ___ 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
[Orgmode] Org-protocol / Chrome on Linux
Hello, Have someone managed to get org-protocol ( http://orgmode.org/worg/org-contrib/org-protocol.php) working in chrome on linux (i use ubuntu) ? (I have tried; it works in firefox, but not in chrome - which is my preferred browser nowadays.) Please let my know if it works for you, or if you have any hints on setting it up. /Mattias ___ 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