14

I have a desktop application, packaged using node-webkit. I need to open the default browser of the user on click of a link. I am using

window.open("www.google.com")

but this opens a new node-webkit window rather than opening a browser window. How do I open a browser window instead??

Infant Dev
  • 1,599
  • 6
  • 22
  • 47
  • 1
    Possible duplicate of [How to use nodejs to open default browser and navigate to a specific URL](http://stackoverflow.com/questions/8500326/how-to-use-nodejs-to-open-default-browser-and-navigate-to-a-specific-url) – Tomek Rękawek Oct 03 '13 at 11:14
  • @Tomek: Certainly looks like it, yeah; [this answer](http://stackoverflow.com/a/13419639/157247) seems most relevant. – T.J. Crowder Oct 03 '13 at 11:17
  • @Tomek, the link posted uses another gem. I would be more interested if I can play with it through any javascript method. Can't find a way to do it yet – Infant Dev Oct 04 '13 at 09:10

1 Answers1

20

To open a link in the user's default browser, you could use gui.Shell.openExternal("http://website.com"). Checkout the documentation for gui.Shell.

theabraham
  • 15,010
  • 7
  • 41
  • 41