Skip to content
This repository was archived by the owner on May 22, 2022. It is now read-only.

Commit 58806b2

Browse files
committed
Url fixed. Adding check to updationg version.
1 parent 1915718 commit 58806b2

1 file changed

Lines changed: 7 additions & 5 deletions

File tree

scripts/background.js

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,13 +1,15 @@
11
// Check whether new version is installed
22
chrome.runtime.onInstalled.addListener(function(details){
3-
var newURL = "http://chessbot-jfkz.c9users.io/installed.html";
4-
// var newURL = "http://re-coders.com/chessbot/installed.html";
5-
var hash = "#thisVersion=" + chrome.runtime.getManifest().version;;
3+
var newURL = "http://re-coders.com/chessbot/installed.html";
4+
var currentVersion = chrome.runtime.getManifest().version;
5+
var hash = "#thisVersion=" + currentVersion;
66
if(details.reason == "install"){
77
hash += "&action=install";
88
chrome.tabs.create({ url: newURL + hash });
99
} else if(details.reason == "update"){
10-
hash += "&action=update&previousVersion=" + details.previousVersion;
11-
chrome.tabs.create({ url: newURL + hash});
10+
if (currentVersion !== details.previousVersion) {
11+
hash += "&action=update&previousVersion=" + details.previousVersion;
12+
chrome.tabs.create({ url: newURL + hash});
13+
}
1214
}
1315
});

0 commit comments

Comments
 (0)