aboutsummaryrefslogtreecommitdiffstats
path: root/background_page.html
diff options
context:
space:
mode:
authorJez Ng2012-01-18 22:37:05 +0800
committerJez Ng2012-01-26 02:48:00 -0500
commitc51d33799eb56675292b65ef0cc04ef97ba02f6f (patch)
tree9ee7afd7593842fa91f28d0d1a59bdee4b562368 /background_page.html
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 'background_page.html')
-rw-r--r--background_page.html11
1 files changed, 3 insertions, 8 deletions
diff --git a/background_page.html b/background_page.html
index 7f8bb2a6..d72f3fc9 100644
--- a/background_page.html
+++ b/background_page.html
@@ -5,12 +5,7 @@
<script type="text/javascript" src="lib/utils.js"></script>
<script type="text/javascript" src="background/settings.js"></script>
<script type="text/javascript" charset="utf-8">
- // 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);
-
- var currentVersion = JSON.parse(manifestRequest.responseText).version;
+ var currentVersion = utils.getCurrentVersion();
var tabQueue = {}; // windowId -> Array
var openTabs = {}; // tabId -> object with various tab properties
@@ -617,7 +612,7 @@
// installs.
if (!settings.get("previousVersion"))
settings.set("previousVersion", currentVersion);
- return compareVersions(currentVersion, localStorage.previousVersion) == 1;
+ return compareVersions(currentVersion, settings.get("previousVersion")) == 1;
}
function openOptionsPageInNewTab() {
@@ -695,7 +690,7 @@
// In version 1.22, we changed the mapping for "d" and "u" to be scroll page down/up instead of close
// and restore tab. For existing users, we want to preserve existing behavior for them by adding some
// custom key mappings on their behalf.
- if (localStorage.previousVersion == "1.21") {
+ if (settings.get("previousVersion") == "1.21") {
var customKeyMappings = settings.get("keyMappings") || "";
if ((keyToCommandRegistry["d"] || {}).command == "scrollPageDown")
customKeyMappings += "\nmap d removeTab";