diff options
Diffstat (limited to 'lib/utils.js')
| -rw-r--r-- | lib/utils.js | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/lib/utils.js b/lib/utils.js index df325138..8aada3a1 100644 --- a/lib/utils.js +++ b/lib/utils.js @@ -1,4 +1,12 @@ var utils = { + getCurrentVersion: function() { + // Chromium #15242 will make this XHR request to access the manifest unnecessary. + var manifestRequest = new XMLHttpRequest(); + manifestRequest.open("GET", chrome.extension.getURL("manifest.json"), false); + manifestRequest.send(null); + return JSON.parse(manifestRequest.responseText).version; + }, + /* * Takes a dot-notation object string and call the function * that it points to with the correct value for 'this'. |
