From 059628906a137d9c36190d24ff95def1bb2c94d2 Mon Sep 17 00:00:00 2001 From: Bas Delfos Date: Wed, 21 Mar 2018 13:58:06 +0100 Subject: [PATCH] =?UTF-8?q?Ignore=20=E2=80=98icon=E2=80=99=20property=20on?= =?UTF-8?q?=20older=20Chrome=20versions?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/js/eventPage.js | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/src/js/eventPage.js b/src/js/eventPage.js index 58dc0e3f..4853b835 100755 --- a/src/js/eventPage.js +++ b/src/js/eventPage.js @@ -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; +}