1
0
Fork 0
mirror of https://github.com/betaflight/betaflight-configurator.git synced 2025-07-24 16:55:24 +03:00

Open new windows in external browser

When a user clicks a link, this opens the link in a new external browser
and not in a new nw window (without toolbar, download manager, etc.)
This commit is contained in:
Miguel Angel Mulero Martinez 2017-12-20 15:46:20 +01:00
parent bd1545484d
commit 4b7af1c951

16
main.js
View file

@ -1,5 +1,21 @@
'use strict';
// Open new windows in external browser
try {
var gui = require('nw.gui');
//Get the current window
var win = gui.Window.get();
//Listen to the new window event
win.on('new-win-policy', function (frame, url, policy) {
gui.Shell.openExternal(url);
policy.ignore();
});
} catch (ex) {
console.log("require does not exist, maybe inside chrome");
}
$(document).ready(function () {
// translate to user-selected language
localize();