logo


Change Adobe Air apps default browser

adobe air browser Change Adobe Air apps default browserI’m currently using Adobe Air just for Twitter clients, Seesmic and [blippr]Tweetdeck[/blippr]. I noticed that the browser used to open links was not the gnome default one (Epiphany in my case) but [blippr]Firefox[/blippr]. After looking for firefox string into the apps folder I tried looking for it on the adobe air installation directory and… yes that was there.

Unfortunately it’s compiled in a .so files and as I couldn’t recompile it I decided using mighty vim to do the dirty trick.

First of all, to avoid segmentation faults errors the file have to remain of the same bytes of the original one => as firefox is composed by 7 chars I had to replace it with a 7 chars executable.  I then created a symlink called browser (7 digits) pointing to my epiphany binary

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

Then I opened the .so file with vim ( in my case adobe air was installed on /opt/air , but this may vary depending on your installation method)

vim /opt/air/runtimes/air/linux/Adobe\ AIR/Versions/1.0/libCore.so

On vim I went to line 15500 doing

:15500

then looked for ‘firefox‘ and replaced it with ‘browser‘.
If you can’t find ‘firefox’ at line 15500 it’s probably due to a different sdk version. Try at line 16104 as suggested in the comments.
Closed and saved with

:wq

I then restarted the app and the links were being opened with epiphany. Using the symlink makes it very easy to switch from one browser to an other one. For example I switched from epiphany to Google [blippr]Chrome[/blippr] just doing

rm /usr/local/bin/browser && ln -s /opt/chrome/google-chrome /usr/local/bin/browser

Update: ubuntu users

In the comments, Victor gave some good advices for Ubuntu users.

Update: more abstraction

In the comments, mjg reported how to improve abstraction using x-www-browser

Update: default browser on Gnome Environments

In the comments, saidimu pointed out how to preserve your default browser preferences in Ubuntu

  • http://lackoftalent.org/michael/ mjg

    Works like a charm! Though I pointed my browser symlink at /usr/bin/x-www-browser to maximize my levels of abstraction.

    Thanks much.

  • http://blog.andreaolivato.net Andrea Olivato

    Glad it works for you too!
    Thanks for pointing out your improvement, that's probably the best choice instead of changing the link everytime !

  • http://twitter.com/gnimsh gnimsh

    Thank you!

  • http://demoniosypinguinos.wordpress.com/ Alejandro

    THANKS THANKS THANKS!!!!!!

    ^^

    Note: Thanks again!!!!

  • http://blog.andreaolivato.net Andrea Olivato

    :D No problem !

  • http://flickroom.org/ romil

    On newer Linux distributions, value of GNOME_DESKTOP_SESSION_ID is not set to “Default” and that causes all the problems. Just use the following command and it should fix the problem (and you will not need to touch the .so file):
    export GNOME_DESKTOP_SESSION_ID=Default

  • http://awebfactory.com.ar/ Victor Kane

    Thanks Andrea!
    In Jaunty this works but with one or two slight changes. AIR is located in a different directory:

    $ locate libCore.so

    /opt/Adobe AIR/Versions/1.0/libCore.so

    Also, AIR couldn't seem to find “browser” in /usr/local/bin/browser, so this worked:

    $ cd /usr/bin
    $ sudo ln -s /usr/bin/firefox-3.5 browser

    Thanks again so much!

    Victor Kane
    http://awebfactory.com.ar

  • http://blog.andreaolivato.net Andrea Olivato

    Hi Victor,

    thanks for your contribute, I linked your comment on the post to help Ubuntu Users finding your steps.

    Have a nice day…

  • http://blog.torh.net torh

    On my distribution (Linux Mint), it says that GNOME_DESKTOP_SESSION_ID=”this-is-deprecated”

    Guess it shouldn't be used then.

  • http://blog.andreaolivato.net Andrea Olivato

    Same here… and same conclusion too

  • http://flickroom.org/ romil

    Yes, you are right that it should not have been used by AIR. But till we get the next update, this would be the cleanest approach to fix the issue.

  • LeRishel

    I tried this but when I open the .so file on vim it just returns dump chars, this is what I get when I jump to line 15500 ^K^L^M^N^O^P^Q^R^S^T^U^V^W^X^Y^Z^[^^]^^^_ !”#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[]^_`abcdefghijklmnopqrstuvwxyz{|}~^?<80><81><82><83><84><85><86><87><88><89><8a><8b><8c><8d><8e><8f><90><91><92><93><94><95><96><97><98><99><9a><9b><9c><9d><9e><9f> ¡¢£¤¥¦§¨©ª«¬­®¯°±²³´µ¶·¸¹º»¼½¾, and so on. Does anyone know what the problem is?

  • Al.

    Yes. Adobe Air has released a new update and now “firefox” word is in line 16104.

  • LeRishel

    thanks, found it. And it works fine now.

  • http://blog.andreaolivato.net Andrea Olivato

    Thanks a lot I updated the post with the information you provided!

  • WilliamGCash

    Can you do this using Windows XP as well or is this just a Linux correction?

  • http://blog.andreaolivato.net Andrea Olivato

    Hi William,

    I'm sorry but I really don't know…I hope someone else can help you better…

  • BobCFC

    In case they move it again the line looks like @firefox for me it was the last mention, you can ignore the earlier ones such as /usr/lib/firefox

  • http://saidimu.wordpress.com/ saidimu

    To transparently preserve your default browser preferences in Ubuntu (and other Gnome desktops), link to xdg-open instead of firefox. This way if you change your default browser, for example to chrome, you still get your links opened in your browser of choice.

    $ cd /usr/bin
    $ sudo ln -s xdg-open browser

    A great post. Thanks.

  • http://blog.andreaolivato.net Andrea Olivato

    Thanks for your comment, I updated the post linking to your suggestion

  • http://twitter.com/Azrael37 Azrael Arocha

    I've tried everything posted here, and nothing worked :( … i really don't know what else to do.

    I'm runing Linux Mint, Using Firefox 3.5, and i linked the to “browser” perfectly. I can even click on it and it'll open the HomePage in a new window.

    I think i just don't know WHERE to place “browser” so AIR can find it. I even recover de old libcore.so after i attempt everysingle thing here because this is my first time using Linux and i don't want to mess things up.

    Does it have to do with the fact that the way i “installed” FF3.5 was just coping the extract directory from my Desktop to “/”??? or is it because my OS is in Spanish?

    Thanks for listening…

  • http://blog.andreaolivato.net Andrea Olivato

    Hi Azrel,

    are you sure you put the link correctly in the /usr/bin directory ? As you placed your firefox installation in the Desktop the command you gave should be something like sudo ln -s ~/Desktop/Firefox-3.5/firefox /usr/bin/browser

    Also, are you sure that you replace the right 'firefox' word inside the libcore.so file?

  • http://twitter.com/Azrael37 Azrael Arocha

    I did link it properly, but i had to reinstall LMint for another reasons so that problem got solved too… Thanks do. ;)

  • Pedro Olivarez

    This worked for me in Ubuntu 9.10 (Karmic Koala) / TweetDeck v0.31.3, though the entry was at line 16104 as AI mentioned. (I tried the GNOME_DESKTOP_SESSION_ID solution first, but that didn't work for me.)

    I would have thought hard-coding the browser would be very bad practice.

  • Pingback: Google Chrome on Air™ « SKURO!

  • Pingback: Debian GNU/Linux default browser « schwarz-rot-bunt sind unsre farben :)

  • http://soifran.blogspot.com Soifran

    afraid i've put a mes with my bad skills under vim :( nothing works at all any longer

    but, uninstalling AIR 1.0 and installing AIR 2.0.2 made the trick, adobe seem to have repaired the poor integration, default browser now opens :)

  • http://www.air-jordan-13.com air jordan 13

    Mark S. is definitely on the right track. If you want to get a professional looking email address, Id recommend buying your name domain name, like or
    Gucci sweaters
    If its common it might be difficult to get, however, be creative and you can usually find something.

  • http://twitter.com/calleneptuno Carlos Maza

    Thanks for your explanation. I had this problem on Kubuntu 10.10. My default browser is Chromium and tweetdeck was not launching it. I unistalled ReKonq, the original default browser in the distro, an as soon as I did it, Tweetdeck started opening Chromium normally, without any command line action.

  • Pingback: Adobe AIR 2.6 and Debian Sid 64-bit | sadevil.org