Picasa:// links in Google Chrome (Linux)

4

2

When I go to Picasa Web to see another user's album, I can download pictures using Picasa with it. This launched a URL like

picasa://downloadfeed/?url=http%3A...

In Firefox, when I click this, I can choose to open it with /usr/bin/picasa and it works fine.

In Chrome however, it doesn't suggest to choose an application to open it, but sends it to xdg-open instead, which fails. When I try to launch such a URL with xdg-open in a console, I get :

$ xdg-open picasa://foobar
   kio (KRun): ERROR: #### NO SUPPORT FOR READING!

I've found a post on a forum that says that you can configure xdg-open associations in ~/.local/share/applications/defaults.list :

$ cat ~/.local/share/applications/defaults.list
   [Default Applications]
   text/html=google-chrome.desktop

but I have no idea what to use for Picasa links. Furthermore, man xdg-open indicates that

xdg-open supports file, ftp, http and https URLs.

I've also tried editing the file associations in KDE's System Settings to add a "picasa" entry in the "uri" group. I logged out and in again (just in case), but it still won't work.

Does anybody know how I can get Google Chrome to manage these URLs properly?

ℝaphink

Posted 2010-01-05T12:50:20.080

Reputation: 3 531

what version of Picasa are you running? – codeLes – 2010-01-05T20:44:11.620

3.0.5744-02, but it doesn't really matter. I just want to associate the /usr/bin/picasa command with the picasa: URL scheme. The version of Picasa should not matter, but the version of Chrome might. – ℝaphink – 2010-01-05T20:57:26.447

I wasn't sure, but I did see something on the tubes that mentioned versions 2.7 and up... so you should be good /if/ that was an issue. no other clues yet... – codeLes – 2010-01-05T22:19:29.853

1Just to point you in the right direction, on KDE I believe xdg-open calls kfmclient (some functions were moved to kioclient for KDE 4). So you'll probably want to tweak kfmclient rather than xdg-open. Not sure on how to add URI handlers to kfmclient though. – John T – 2010-01-08T10:47:31.680

Answers

4

On KDE4, you can add a protocol handler under $HOME/.kde4/share/kde4/services/. On Earlier versions I believe this directory is $KDEDIR/share/services/. Create a file called picasa.protocol and place this in it:

[Protocol]
exec=/usr/bin/picasa "%u"
protocol=picasa
input=none
output=none
helper=true
listing=false
reading=false
writing=false
makedir=false
deleting=false

You may need to tweak the options a bit, but I think that should work. This is the same method for setting up the spotify handler in chrome, as well as a handler for last.fm.

John T

Posted 2010-01-05T12:50:20.080

Reputation: 149 037

In Kubuntu 9.10 (Karmic Koala), the path I had to use is actually

$HOME/.kde/share/services/picasa.desktop

but the contents do work.

In general, the path to the configuration is given by

kde4-config --path config

or

kde-config --path config
 – ℝaphink  – 2010-01-09T11:42:34.130

You're most welcome. – John T – 2010-01-09T11:53:42.097

2

Solved. Works for Ubuntu 11, all browsers, gnome3 / Unity.

Find the following file and edit by hand. I did not find the correct way to do this with gconf-editor.

File name and path:

~/.local/share/applications/mimeapps.list
  1. Make a copy of the file in case you need to replace it.
  2. Add the following line at the end of [Added Associations]:

    x-scheme-handler/picasa=picasa.desktop
    
  3. Save the file

Go back to your web browser and attempt to download the album to Picasa again. This worked for me.

Sample script:

cd ~/.local/share/applications
cp mimeapps.list mimeapps.list.old
nano mimeapps

Once inside nano, add the line above at step 2; Ctrl + O then Ctrl + X.

Ben Mazzotta

Posted 2010-01-05T12:50:20.080

Reputation: 21

Welcome to SU, @Ben. Just so you know, I've already had a correct answer for this question, so I'm not likely to accept yours, although it does look correct. Just a note: there is no such thing as Ubuntu 11. The current Ubuntu release is 11.04 (as in 2011 April), and the next one will be 11.10 (as in 2011 October). – ℝaphink – 2011-05-30T19:20:24.510

0

Try this, replacing "bitcoin" with "picasa" in this case (source):

How to configure your browser

Firefox (version 3.5 and above)

Visit about:config

  1. Create a new boolean (mouse right click -> new -> boolean)
  2. Enter this name: network.protocol-handler.expose.bitcoin
  3. Select the value: false
  4. Next time you click on a Bitcoin URI, a dialog will ask you to enter the path of your Bitcoin client. Make sure it is executable

Chrome:

To configure Chrome on Ubuntu 10.04 or maybe later versions to handle bitcoin URIs, do this first on the command-line:

  1. $ gconftool-2 -t string -s /desktop/gnome/url-handlers/bitcoin/command "/path/to/electrum.py %s"
  2. $ gconftool-2 -t bool -s /desktop/gnome/url-handlers/bitcoin/needs_terminal false
  3. $ gconftool-2 -t bool -s /desktop/gnome/url-handlers/bitcoin/enabled true

This tells Gnome what to do with bitcoin URLs, and Chrome picks that up from Gnome.

Alan Aversa

Posted 2010-01-05T12:50:20.080

Reputation: 121

0

Can you go into Firefox and under the Applications tab, find the entry for the Picasa link, and then copy it into Chrome? That seems the best way to do it to me...

Joshua Nurczyk

Posted 2010-01-05T12:50:20.080

Reputation: 2 316

You mean looking at the mime type for the picasa:// link type in the Firefox configuration, and adding it as such to the xdg config file? – ℝaphink – 2010-01-05T19:54:22.860

1Unfortunately, the Firefox settings are not very clear. It's all located into an RDF file in ~/.mozilla/firefox/*/mimeTypes.rdf and it doesn't give a generic mime type for it. As for the Chrome side, I didn't find a way to specify helpers directly in the configuration (hence my question). – ℝaphink – 2010-01-05T20:02:31.550

Did you try going to the Tools menu, clicking Options, and click the Application tab and finding what it says for the picasa link? That should be easier than using an RDF file. Unfortunately I don't have Picasa (and can't get it at the moment) to test. – Joshua Nurczyk – 2010-01-05T20:25:50.287

I don't have an "Application" tab in the Options. Using Google Chrome v. 4.0.249.43. – ℝaphink – 2010-01-05T20:39:30.210

I meant in Firefox. I don't think you need to edit the mimeTypes.rdf for Firefox to find the app. On the Edit menu click Preferences, then click the Applications tab to see how Firefox handles it. – Joshua Nurczyk – 2010-01-05T21:27:15.887

Oh yes, I know about that, and I know how Firefox handles it, the problem is that I can't tell Chrome how to handle it. The funniest part is that it's actually two Google programs that are unable to work together, when they work fine with 3rd party software ;-) – ℝaphink – 2010-01-05T22:38:16.710

Guess I misread how you had typed it. Sorry. I'm not familiar enough with adding it to Chrome. If I find anything I'll update. – Joshua Nurczyk – 2010-01-06T13:16:20.187