Skip to content

Commit

Permalink
Added 'checkUpdate' routine.
Browse files Browse the repository at this point in the history
  • Loading branch information
romain.vallet@gmail.com committed Apr 2, 2012
1 parent cba1244 commit 02c4acf
Showing 1 changed file with 14 additions and 3 deletions.
17 changes: 14 additions & 3 deletions js/background.js
Original file line number Diff line number Diff line change
@@ -1,8 +1,7 @@
// Copyright (c) 2012 Romain Vallet <romain.vallet@gmail.com>
// Licensed under the MIT license, read license.txt

var extensionVersion = '3.9',
options, _gaq, viewWindow = null,
var options, _gaq, viewWindow = null,
downloadRequests = {};

// Performs an ajax request
Expand Down Expand Up @@ -78,6 +77,7 @@ function onRequest(request, sender, callback) {
};

function showPageAction(tab) {
if (!tab) { return; }
if (!options.extensionEnabled || isExcludedSite(tab.url)) {
chrome.pageAction.setIcon({tabId: tab.id, path: '../images/icon19d.png'});
} else {
Expand Down Expand Up @@ -135,7 +135,16 @@ function optionsStats() {
// Report miscellaneous stats
// No user data (browser history, etc) is reported
function miscStats() {
_gaq.push(['_trackEvent', 'Misc', 'extensionVersion', extensionVersion]);
_gaq.push(['_trackEvent', 'Misc', 'extensionVersion', chrome.app.getDetails().version]);
}

function checkUpdate() {
var currVersion = chrome.app.getDetails().version,
prevVersion = localStorage.hzVersion;
/*if (currVersion != prevVersion && typeof prevVersion != 'undefined') {
}*/
localStorage.hzVersion = currVersion;
}

function init() {
Expand Down Expand Up @@ -177,6 +186,8 @@ function init() {
return {responseHeaders: details.responseHeaders};
}
}, {urls: ['<all_urls>'], types: ['sub_frame']}, ['blocking', 'responseHeaders']);

checkUpdate();
}

init();

0 comments on commit 02c4acf

Please sign in to comment.