aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'lib/utils.coffee')
-rw-r--r--lib/utils.coffee10
1 files changed, 4 insertions, 6 deletions
diff --git a/lib/utils.coffee b/lib/utils.coffee
index 9e15dcc0..f089f89d 100644
--- a/lib/utils.coffee
+++ b/lib/utils.coffee
@@ -1,10 +1,8 @@
Utils =
getCurrentVersion: ->
- # Chromium #15242 will make this XHR request to access the manifest unnecessary
- manifestRequest = new XMLHttpRequest()
- manifestRequest.open("GET", chrome.extension.getURL("manifest.json"), false)
- manifestRequest.send(null)
- JSON.parse(manifestRequest.responseText).version
+ chrome.management.get(chrome.i18n.getMessage('@@extension_id'), (info) ->
+ info.version
+ )
# Takes a dot-notation object string and call the function
# that it points to with the correct value for 'this'.
@@ -136,7 +134,7 @@ Utils =
# locale-sensitive uppercase detection
hasUpperCase: (s) -> s.toLowerCase() != s
-
+
# This creates a new function out of an existing function, where the new function takes fewer arguments. This
# allows us to pass around functions instead of functions + a partial list of arguments.
Function::curry = ->