We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
2 parents 266b56f + 7cfcf94 commit f1cf317Copy full SHA for f1cf317
index.js
@@ -1,3 +1,6 @@
1
+
2
+openLinksInExternalBrowserByDefault();
3
4
$(document).ready(function () {
5
// translate to user-selected language
6
localize();
@@ -65,3 +68,21 @@ function getManifestVersion(manifest) {
65
68
66
69
checkForConfiguratorUpdates();
67
70
71
+function openLinksInExternalBrowserByDefault() {
72
+ try {
73
+ var gui = require('nw.gui');
74
75
+ //Get the current window
76
+ var win = gui.Window.get();
77
78
+ //Listen to the new window event
79
+ win.on('new-win-policy', function (frame, url, policy) {
80
+ gui.Shell.openExternal(url);
81
+ policy.ignore();
82
+ });
83
+ } catch (ex) {
84
+ console.log("require does not exist, maybe inside chrome");
85
+ }
86
+}
87
88
0 commit comments