Permalink
Browse files

Fix utils.getCurrentVersion()

The code of this function before patch doesn't work for two reasons:
1) it makes async call, so it actually returns `undefined`
2) you need appropriate permission to call chrome.management.get() in manifest
  • Loading branch information...
sainaen committed May 8, 2013
1 parent 6c87a84 commit 4f86d30f4a0435d05d995e345508dca66c7a68da
Showing with 1 addition and 3 deletions.
  1. +1 −3 lib/utils.coffee
View
@@ -1,8 +1,6 @@
Utils =
getCurrentVersion: ->
- chrome.management.get(chrome.i18n.getMessage('@@extension_id'), (info) ->
- info.version
- )
+ chrome.runtime.getManifest().version
# Takes a dot-notation object string and call the function
# that it points to with the correct value for 'this'.

0 comments on commit 4f86d30

Please sign in to comment.