aboutsummaryrefslogtreecommitdiffstats
path: root/background_page.html
diff options
context:
space:
mode:
authorPhil Crosby2010-04-19 09:28:23 -0700
committerPhil Crosby2010-04-19 09:28:23 -0700
commit14676a23c96b86eb7bcfbcc5730cefe15efd5735 (patch)
treea6888fdab0ab50b58f7089f3aed96a71473ad10c /background_page.html
parent6fc9fcc8b2ca384d7803d9d649a1cdbe54c2e2ee (diff)
downloadvimium-14676a23c96b86eb7bcfbcc5730cefe15efd5735.tar.bz2
Pull the version number from the manifest file instead of hard coding it
Diffstat (limited to 'background_page.html')
-rw-r--r--background_page.html11
1 files changed, 7 insertions, 4 deletions
diff --git a/background_page.html b/background_page.html
index 4c328a20..e2252b4d 100644
--- a/background_page.html
+++ b/background_page.html
@@ -2,9 +2,12 @@
<head>
<script type="text/javascript" src="commands.js"/>
<script type="text/javascript" charset="utf-8">
- // Currently we need to remember to change this each time we push. Chromium #15242 will enable us
- // to retrieve this programmatically.
- var currentVersion = "1.16";
+ // Chromium #15242 will make this XHR request 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 tabQueue = {}; // windowId -> Array
var openTabs = {}; // tabId -> object with various tab properties
@@ -316,7 +319,7 @@
openTabs[tab.id].scrollX = scrollX;
openTabs[tab.id].scrollY = scrollY;
}
-
+
chrome.tabs.onUpdated.addListener(function(tabId, changeInfo, tab) {
if (changeInfo.status != "loading") { return; } // only do this once per URL change