November 25

Try other web apps in Thunderbird tabs

Posted by Bryan Clark
Filed under mozilla | 11 Comments

Colin Dean converted the code from my post on Google Calendar in Thunderbird tabs and created a GMail tab for Thunderbird.

If you’re interested in trying what a web application would look like running inside a Thunderbird tab without modifying an extension use the following code snippet.

Open the Error Console from the Tools Menu

tools-error-console

Copy & Paste this code into the input entry at the top:

Components.classes['@mozilla.org/appshell/window-mediator;1']
          .getService(Components.interfaces.nsIWindowMediator)
          .getMostRecentWindow("mail:3pane")
          .document.getElementById("tabmail")
          .openTab("contentTab",{contentPage:"http://tinyvid.tv/show/2h9led44g152z"})

update: here’s a text input which you can easily copy and paste the above code from.

Change the provided link ( http://tinyvid.tv/show/2h9led44g152z ) at the end to the web application you’d like to try, like http://twitter.com for example.  Click the ( Evaluate ) button.

error-console

It’s Party Time! ( if you didn’t change the link,  http://tinyvid.tv/show/2h9led44g152z )

its-party-time-in-a-thunderbird-tab

You can continue to iterate the tab application by creating a new click handler, however at that point it might be worthwhile to start with the extension code instead of working in the error console.

Jetpack for Thunderbird

In the hopefully not too distant future Thunderbird will gain Jetpack as it’s new extension model and it will be no longer necessary for add-ons like this these be created but instead a simple Jetpack which can do the same things without restarts or complicated installs.

If you’re interested in this take a look at Andrew’s recent Jetpack in Thunderbird post.

Above code snippet courtesy of Magnus in

This entry was posted on Wednesday, November 25th, 2009 at 2:30 pm and is filed under mozilla. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

11 Responses to “Try other web apps in Thunderbird tabs”

  1. John Doe on November 25th, 2009 at 5:08 pm

    I want to use Thunderbird as a browser, is there any way I can close the main email tab?

    Thanks,
    Your John

  2. John Doe on November 25th, 2009 at 5:15 pm

    Seriously, that would be interesting for _only_ opening a raindrop instance, but using TB for sending.

  3. pt on November 25th, 2009 at 5:39 pm

    what is that gnome theme you are using?

  4. kabatology on November 26th, 2009 at 2:46 am

    Nice try, unfortunately for Gmail tab and Google Calendar the Thunderbird extension called Thunderbrowse that does a lot more. It essentially transforms Thunderbird into a web-browser with tabbed browsing – that means with one add-on you can get into your Google account and use Gmail, Google Calender, Wave etc and navigate the web.

  5. Shariq on November 30th, 2009 at 12:51 pm

    I’d love to be able to have the Activity Manager open in a tab instead of a window. What’s the location (something similar to about:config?)?

  6. stylo~ on December 9th, 2009 at 10:28 am

    I get an error. (Also gmail tab wouldn’t even install, but yours did.) XP 3.0 final.

    Error: syntax error
    Source File: javascript:%20Components.classes['@mozilla.org/appshell/window-mediator;1'],%20%20%20%20%20%20%20%20%20%20.getService(Components.interfaces.nsIWindowMediator),%20%20%20%20%20%20%20%20%20%20.getMostRecentWindow(“mail:3pane”),%20%20%20%20%20%20%20%20%20%20.document.getElementById(“tabmail”),%20%20%20%20%20%20%20%20%20%20.openTab(“contentTab”,{contentPage:”http://cnn.com”})
    Line: 1, Column: 73
    Source Code:
    Components.classes['@mozilla.org/appshell/window-mediator;1'], .getService(Components.interfaces.nsIWindowMediator), .getMostRecentWindow(“mail:3pane”), .document.getElementById(“tabmail”), .openTab(“contentTab”,{conte

  7. Shariq on December 9th, 2009 at 10:54 am

    stylo, make sure you remove the commas tb adds in place of carriage returns after you paste the code.

  8. dick on December 11th, 2009 at 10:10 am

    I’ve tried your hint in the error console above, and get the following error:

    Error: syntax error
    Source File: javascript:%20Components.classes['@mozilla.org/appshell/window-mediator;1'],%20%20%20%20%20%20%20%20%20%20.getService(Components.interfaces.nsIWindowMediator),%20%20%20%20%20%20%20%20%20%20.getMostRecentWindow(“mail:3pane”),%20%20%20%20%20%20%20%20%20%20.document.getElementById(“tabmail”),%20%20%20%20%20%20%20%20%20%20.openTab(“contentTab”,{contentPage:”http://www.google.com/calendar/renderOnline”})
    Line: 1, Column: 73
    Source Code:
    Components.classes['@mozilla.org/appshell/window-mediator;1'], .getService(Components.interfaces.nsIWindowMediator), .getMostRecentWindow(“mail:3pane”), .document.getElementById(“tabmail”), .openTab(“contentTab”,{conte

    I really would like to have the google calendar linked to my thunderbird, so i can STOP using Outlook; I’m not a programmer, but the error message showed an arrow pointing to the dot prior to “get” above; is it all the spaces that should not be there…I simply copied/pasted as the instructions indicated – I’m not a programmer. Thanks

  9. Shariq on December 11th, 2009 at 11:31 am

    Dick, when you simply copy and paste, TB adds a bunch of commas after every line. What you need to do is take the above code, copy and paste it into a plain text editor (i.e. notepad) and put everything on one line.

    Components.classes['@mozilla.org/appshell/window-mediator;1'] .getService(Components.interfaces.nsIWindowMediator) .getMostRecentWindow(“mail:3pane”) .document.getElementById(“tabmail”) .openTab(“contentTab”,{contentPage:”http://www.google.com/calendar/renderOnline”})

    Try this! :)

  10. Bryan Clark on December 11th, 2009 at 11:06 pm

    I added an input entry to the post now (just below the code sample) with the code all on a single line so you can just copy and paste that without getting issues of the wrong quotes or added commas that happen. Let me know if it doesn’t work!

  11. Garett on December 15th, 2009 at 8:43 am

    Awesome, just wish we could sign into different google accounts for the calendar tab and gmail tab. And then, multiple calendar and gmail account tabs would be cool too. Not sure if that’s possible – don’t know a thing about coding.

Leave a Reply