9

Opening an URL in an External Browser from a Thunderbird Extension

 3 years ago
source link: http://www.mikechambers.com/blog/2004/12/09/opening-an-url-in-an-external-browser-from-a-thunderbird-extension/
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
neoserver,ios ssh client

Opening an URL in an External Browser from a Thunderbird Extension

Thursday, December 9, 2004

Here is a quick code snippet that shows how to open a URL in an external browser from within a Thunderbird extension:

var url = "http://www.mikechambers.com";
var uri = Components. classes["@mozilla.org/network/io-service;1"]. getService(Components.interfaces.nsIIOService).newURI(url, null, null);

var com = Components.classes["@mozilla.org/uriloader/external-helper-app-service;1"];
var httpHandler = com.createInstance(Components.interfaces.nsIExternalProtocolService);

httpHandler.loadUrl(uri);

This will open the URL in the system’s default web browser.


About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK