From c51d33799eb56675292b65ef0cc04ef97ba02f6f Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Wed, 18 Jan 2012 22:37:05 +0800 Subject: 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. --- lib/utils.js | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'lib') 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'. -- cgit v1.2.3