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

Merge pull request #985 from basdelfos/chrome-48-or-older-icon-fix

Ignore ‘icon’ property on older Chrome versions
This commit is contained in:
Michael Keller 2018-03-22 09:34:18 +13:00 committed by GitHub
commit c1ef49d3d4
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

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;
}