From bf9ebab2955b6b7ef5c1d091c87e03db25cd1a39 Mon Sep 17 00:00:00 2001 From: tophf Date: Sat, 30 Sep 2017 02:32:05 +0300 Subject: [PATCH] extract browser version instead of boolean --- js/messaging.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/js/messaging.js b/js/messaging.js index 594beeb0..55809e50 100644 --- a/js/messaging.js +++ b/js/messaging.js @@ -4,8 +4,8 @@ // keep message channel open for sendResponse in chrome.runtime.onMessage listener const KEEP_CHANNEL_OPEN = true; -const FIREFOX = /Firefox/.test(navigator.userAgent); -const OPERA = /OPR/.test(navigator.userAgent); +const FIREFOX = parseFloat(navigator.userAgent.match(/\bFirefox\/(\d+\.\d+)|$/)[1]); +const OPERA = parseFloat(navigator.userAgent.match(/\bOPR\/(\d+\.\d+)|$/)[1]); const URLS = { ownOrigin: chrome.runtime.getURL(''),