diff --git a/js/data.js b/js/data.js index 8950382a..b2f5c21f 100644 --- a/js/data.js +++ b/js/data.js @@ -38,12 +38,14 @@ var data = (function() { var data = load(); if (data) { if ("runtime" in chrome) { - if (!("version" in data) || data.version != version.get()) { - console.log("data version " + data.version + " found less than current"); - data = update.run(data); - set(saveName, JSON.stringify(data)); - } else { - console.log("data version " + version.get() + " no need to run update"); + if ("getManifest" in chrome.runtime) { + if (!("version" in data) || data.version != version.get()) { + console.log("data version " + data.version + " found less than current"); + data = update.run(data); + set(saveName, JSON.stringify(data)); + } else { + console.log("data version " + version.get() + " no need to run update"); + }; }; }; }; diff --git a/js/init.js b/js/init.js index 5fa31eae..ce2a96a5 100644 --- a/js/init.js +++ b/js/init.js @@ -1,10 +1,19 @@ // log version -if ("runtime" in chrome) { - console.log("nightTab version", version.get()); -} else { +var demoMessage = function() { console.log("nightTab running 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(); state.init(); bookmarks.init();