aboutsummaryrefslogtreecommitdiffstats
path: root/lib
diff options
context:
space:
mode:
Diffstat (limited to 'lib')
-rw-r--r--lib/utils.coffee10
1 files changed, 9 insertions, 1 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee
index 03dab999..d0a82cf7 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -6,14 +6,22 @@ window.forTrusted ?= (handler) -> (event) ->
else
true
+browserInfo = browser?.runtime?.getBrowserInfo?()
+
Utils =
isFirefox: do ->
# NOTE(mrmr1993): This test only works in the background page, this is overwritten by isEnabledForUrl for
# content scripts.
isFirefox = false
- browser?.runtime?.getBrowserInfo?()?.then? (browserInfo) ->
+ browserInfo?.then? (browserInfo) ->
isFirefox = browserInfo?.name == "Firefox"
-> isFirefox
+ firefoxVersion: do ->
+ # NOTE(mrmr1993): This only works in the background page.
+ ffVersion = undefined
+ browserInfo?.then? (browserInfo) ->
+ ffVersion = browserInfo?.version
+ -> ffVersion
getCurrentVersion: ->
chrome.runtime.getManifest().version