aboutsummaryrefslogtreecommitdiffstats
path: root/lib/utils.js
diff options
context:
space:
mode:
authorJez Ng2012-01-18 22:37:05 +0800
committerJez Ng2012-01-26 02:48:00 -0500
commitc51d33799eb56675292b65ef0cc04ef97ba02f6f (patch)
tree9ee7afd7593842fa91f28d0d1a59bdee4b562368 /lib/utils.js
parent4ad21d921120dba576a75d432b1e2bf4d42f51e3 (diff)
downloadvimium-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.js8
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'.