mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-16 21:05:30 +03:00
Fix opening of external links in browser.
This commit is contained in:
parent
9b531a9e98
commit
c00431cdc8
1 changed files with 6 additions and 15 deletions
|
@ -5,8 +5,6 @@ var nwGui = getNwGui();
|
|||
var googleAnalytics = analytics;
|
||||
var analytics = undefined;
|
||||
|
||||
openNewWindowsInExternalBrowser();
|
||||
|
||||
$(document).ready(function () {
|
||||
$.getJSON('version.json', function(data) {
|
||||
CONFIGURATOR.gitChangesetId = data.gitChangesetId;
|
||||
|
@ -88,6 +86,12 @@ function setupAnalytics(result) {
|
|||
|
||||
this.close(true);
|
||||
});
|
||||
win.on('new-win-policy', function(frame, url, policy) {
|
||||
// do not open the window
|
||||
policy.ignore();
|
||||
// and open it in external browser
|
||||
nwGui.Shell.openExternal(url);
|
||||
});
|
||||
} else {
|
||||
// Looks like we're in Chrome - but the event does not actually get fired
|
||||
chrome.runtime.onSuspend.addListener(sendCloseEvent);
|
||||
|
@ -808,19 +812,6 @@ function getManifestVersion(manifest) {
|
|||
return version;
|
||||
}
|
||||
|
||||
function openNewWindowsInExternalBrowser() {
|
||||
if (nwGui) {
|
||||
//Get the current window
|
||||
var win = nwGui.Window.get();
|
||||
|
||||
//Listen to the new window event
|
||||
win.on('new-win-policy', function (frame, url, policy) {
|
||||
gui.Shell.openExternal(url);
|
||||
policy.ignore();
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
function showErrorDialog(message) {
|
||||
var dialog = $('.dialogError')[0];
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue