Open new NW.js windows and navigations in system browser

This commit is contained in:
Thomas Weber committed 2021-06-24 21:16:13 -05:00
1 parent 0e8b11a177
commit f04a2c1ec4
1 file changed
+13
+13
View File
@@ -565,6 +565,19 @@ class Packager extends EventTarget {
enabled: ${this.options.compiler.enabled},
warpTimer: ${this.options.compiler.warpTimer}
});
// NW.js hook
if (typeof nw !== 'undefined') {
const win = nw.Window.get();
win.on('new-win-policy', (frame, url, policy) => {
policy.ignore();
nw.Shell.openExternal(url);
});
win.on('navigation', (frame, url, policy) => {
policy.ignore();
nw.Shell.openExternal(url);
});
}
</script>
<script>
${await this.generateGetProjectData()}