Adobe Air – Open URLs in default browser

For the last few days I’ve been fighting TweetDeck on my laptop trying to get it to open web pages in Opera. A small, but fast browser, from the Norwegian company with the same name.

At first I thought that Opera wasn’t my default browser in Gnome. I’m currently using Linux Mint, a distribution based on Ubuntu. So I checked the “Preferences->Preferred Applications” and made sure Opera was the default application for browsing the web. I also checked with “gconf-editor” just to be safe that Opera was set as default browser.

Having checked all this. I did a few tests and found out that Opera was indeed the default application for surfing the web. So the problem had to be limited to TweetDeck or Adobe AIR.

Now. I checked all the xml-files regarding Adobe AIR and TweetDeck, I even installed SQLite3 to read the database file for TweetDeck in my home directory. No luck.

But the Internet is a collection of tubes amazing and brilliant people. So I searched and found Andrea Olivato, which in turned had found the solution to my (and many others) problem. He discovered that Adobe AIR has hard-coded firefox as default browser in libCore.so, which (usually) can be found in /opt/Adobe AIR/Versions/1.0.

The solution

His solution to the problem was to open libCore.so with vim, or any other editor for that matter, and search for the word “firefox”. Ok, he writes that he jumps directly to line 15500, but this might change. But then again, maybe Adobe will make it work in the future. Anyway. He replaced “firefox” with “browser”, which is the same length. Very important. And created a symlink from his favourite browser to, well, browser.

In my case:

ln -s /usr/bin/opera /usr/local/browser

I noticed that in libCore.so, Adobe has a reference to /desktop/gnome/url-handlers/http/command, which is the registry setting for Gnome when it comes to default browser. Why this isn’t used I don’t understand. Perhaps the hard-coded firefox is a backup solution in case AIR fails to retrieve the information from the registry.

8 thoughts on “Adobe Air – Open URLs in default browser

  1. I found an esier way to do this, I think, one that works for me anyway. NOTE that you need to do this with root privs (sudo).

    When I looked into the /opt directory, I saw that there were three folders there – one for Adobe AIR, one for TweetDeck, and one for firefox. (The firefox directory was not a symlink. This is marginally troubling and might explain why upgrading your system to Ffox3.5 isn’t recognized by TweetDeck, and it still loads Ffox3.)

    TweetDeck seems to be hardwired to load /opt/firefox/firefox when opening a URL. But it doesn’t actually seem to care if it’s really Firefox it loads or not.

    Here’s the shortened version of what I did. About half of it was guesswork and trial-and-error, but it worked.

    1. In /opt, rename the firefox directory to something like ffox.
    2. Create a new directory in /opt called firefox.
    3. Copy the script or symlink to the browser of your choice into the firefox folder you just created.
    4. Rename that script or symlink firefox.

    After that, TweetDeck should use the browser you want.

  2. Easiest way of all. Edit .bashrc in your home directory and add “export GNOME_DESKTOP_SESSION_ID=Default” to it. Exit Gnome, and come back. After that, all Air apps will use your default launcher.

  3. Dan is right; GNOME_DESKTOP_SESSION_ID may be depreciated, but it is the test that Adobe Air uses to see if Gnome is the active desktop (/opt/Adobe AIR/Versions/1.0/Resources/xdg-utils/xdg-open). So, until Adobe gets it’s act together, I’ve made the change in .bashrc, and now I can use TweetDeck.

  4. >> and now I can use TweetDeck.

    Until I reboot. GNOME_DESKTOP_SESSION_ID is set, but TweetDork still uses Firefox.

    Might as well switch to something more stable, like Twitux.

Leave a Reply