diff options
| author | Jez Ng | 2012-01-18 22:37:05 +0800 |
|---|---|---|
| committer | Jez Ng | 2012-01-26 02:48:00 -0500 |
| commit | c51d33799eb56675292b65ef0cc04ef97ba02f6f (patch) | |
| tree | 9ee7afd7593842fa91f28d0d1a59bdee4b562368 /lib/utils.js | |
| parent | 4ad21d921120dba576a75d432b1e2bf4d42f51e3 (diff) | |
| download | vimium-c51d33799eb56675292b65ef0cc04ef97ba02f6f.tar.bz2 | |
Add migration code for old localStorage values.
Finish up the wrapping of localStorage. All background code should now
modify localStorage via settings.js rather than doing it directly.
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'. |
