mirror of
https://github.com/zombieFox/nightTab.git
synced 2024-12-27 17:19:05 +01:00
[bug] improve demo page check
This commit is contained in:
parent
2ec13473e9
commit
6d2380714f
14
js/data.js
14
js/data.js
@ -38,12 +38,14 @@ var data = (function() {
|
|||||||
var data = load();
|
var data = load();
|
||||||
if (data) {
|
if (data) {
|
||||||
if ("runtime" in chrome) {
|
if ("runtime" in chrome) {
|
||||||
if (!("version" in data) || data.version != version.get()) {
|
if ("getManifest" in chrome.runtime) {
|
||||||
console.log("data version " + data.version + " found less than current");
|
if (!("version" in data) || data.version != version.get()) {
|
||||||
data = update.run(data);
|
console.log("data version " + data.version + " found less than current");
|
||||||
set(saveName, JSON.stringify(data));
|
data = update.run(data);
|
||||||
} else {
|
set(saveName, JSON.stringify(data));
|
||||||
console.log("data version " + version.get() + " no need to run update");
|
} else {
|
||||||
|
console.log("data version " + version.get() + " no need to run update");
|
||||||
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
};
|
};
|
||||||
|
15
js/init.js
15
js/init.js
@ -1,10 +1,19 @@
|
|||||||
// log version
|
// log version
|
||||||
if ("runtime" in chrome) {
|
var demoMessage = function() {
|
||||||
console.log("nightTab version", version.get());
|
|
||||||
} else {
|
|
||||||
console.log("nightTab running in demo mode");
|
console.log("nightTab running in demo mode");
|
||||||
console.log("all bookmarks or preference changes will not persist in demo mode");
|
console.log("all bookmarks or preference changes will not persist in demo mode");
|
||||||
};
|
};
|
||||||
|
|
||||||
|
if ("runtime" in chrome) {
|
||||||
|
if ("getManifest" in chrome.runtime) {
|
||||||
|
console.log("nightTab version", version.get());
|
||||||
|
} else {
|
||||||
|
demoMessage();
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
demoMessage();
|
||||||
|
};
|
||||||
|
|
||||||
data.init();
|
data.init();
|
||||||
state.init();
|
state.init();
|
||||||
bookmarks.init();
|
bookmarks.init();
|
||||||
|
Loading…
Reference in New Issue
Block a user