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

Ignore ‘icon’ property on older Chrome versions

This commit is contained in:
Bas Delfos 2018-03-21 13:58:06 +01:00
parent d2c6fa2556
commit 059628906a

View file

@ -14,9 +14,11 @@ function startApplication() {
innerBounds: {
minWidth: 1024,
minHeight: 550
},
icon: 'images/bf_icon_128.png'
}
}, function (createdWindow) {
if (getChromeVersion() >= 54) {
createdWindow.icon = 'images/bf_icon_128.png';
}
createdWindow.onClosed.addListener(function () {
// automatically close the port when application closes
// save connectionId in separate variable before createdWindow.contentWindow is destroyed
@ -122,3 +124,9 @@ function getManifestVersion(manifest) {
return version;
}
function getChromeVersion () {
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
return raw ? parseInt(raw[2], 10) : false;
}