How do I launch a webpage from a XUL app within XULRunner?

What is the XULRunner equivalent of the following button handler?

function launch_page() {
    var win = Components.classes[';1']
    win.openUILinkIn('', 'window');

This does not do anything in my XUL app that's installed to Program Files using XULRunner --install-app ./foo.xpi.

Is there any way for my XUL app to launch the user's default browser to display a web page on a button click?



This works for now:

// first construct an nsIURI object using the ioservice
var ioservice = Components.classes[";1"]

var uriToOpen = ioservice.newURI("", null, null);

var extps = Components.classes[";1"]

// now, open it!
extps.loadURI(uriToOpen, null);

Anybody got a more standard way?


Recent Questions

Top Questions

Home Tags Terms of Service Privacy Policy DMCA Contact Us

©2020 All rights reserved.