LoginSignup
0

More than 5 years have passed since last update.

NW.jsで、外部リンクを開く際に、外部ブラウザを立ち上げさせる

Posted at

NW.jsで、外部リンクを開く際に、外部ブラウザを立ち上げさせる

var gui = require('nw.gui');
gui.Window.get().on('new-win-policy',function(frame,url,policy){
    policy.ignore();
    gui.Shell.openExternal( url );
});

公式ドキュメント参照:
https://github.com/nwjs/nw.js/wiki/Window#new-win-policy

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0