mirror of
https://github.com/betaflight/betaflight-configurator.git
synced 2025-07-23 00:05:22 +03:00
Ignore ‘icon’ property on older Chrome versions
This commit is contained in:
parent
d2c6fa2556
commit
059628906a
1 changed files with 10 additions and 2 deletions
|
@ -14,9 +14,11 @@ function startApplication() {
|
||||||
innerBounds: {
|
innerBounds: {
|
||||||
minWidth: 1024,
|
minWidth: 1024,
|
||||||
minHeight: 550
|
minHeight: 550
|
||||||
},
|
}
|
||||||
icon: 'images/bf_icon_128.png'
|
|
||||||
}, function (createdWindow) {
|
}, function (createdWindow) {
|
||||||
|
if (getChromeVersion() >= 54) {
|
||||||
|
createdWindow.icon = 'images/bf_icon_128.png';
|
||||||
|
}
|
||||||
createdWindow.onClosed.addListener(function () {
|
createdWindow.onClosed.addListener(function () {
|
||||||
// automatically close the port when application closes
|
// automatically close the port when application closes
|
||||||
// save connectionId in separate variable before createdWindow.contentWindow is destroyed
|
// save connectionId in separate variable before createdWindow.contentWindow is destroyed
|
||||||
|
@ -122,3 +124,9 @@ function getManifestVersion(manifest) {
|
||||||
|
|
||||||
return version;
|
return version;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function getChromeVersion () {
|
||||||
|
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
|
||||||
|
|
||||||
|
return raw ? parseInt(raw[2], 10) : false;
|
||||||
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue