Skip to content

Commit a6c0fd2

Browse files
authored
Merge pull request #122 from basdelfos/old-chrome-icon-fix
Ignore icon on older chrome versions
2 parents 83f7d10 + 869be2c commit a6c0fd2

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

background.js

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,9 +7,18 @@ function startApplication() {
77
innerBounds : {
88
'width' : 1340,
99
'height' : 920
10-
},
11-
icon: 'images/bf_icon_128.png'
10+
}
11+
}, function (createdWindow) {
12+
if (getChromeVersion() >= 54) {
13+
createdWindow.icon = 'images/bf_icon_128.png';
14+
}
1215
});
1316
}
1417

18+
function getChromeVersion () {
19+
var raw = navigator.userAgent.match(/Chrom(e|ium)\/([0-9]+)\./);
20+
21+
return raw ? parseInt(raw[2], 10) : false;
22+
}
23+
1524
chrome.app.runtime.onLaunched.addListener(startApplication);

0 commit comments

Comments
 (0)