From 26ef4d7209e1cf6751a734059cbfcf8182c4e6dc Mon Sep 17 00:00:00 2001 From: zombieFox Date: Mon, 17 Jun 2019 00:21:56 +0100 Subject: [PATCH] [bug] improve demo page check when saving data --- js/data.js | 15 ++++++++------- 1 file changed, 8 insertions(+), 7 deletions(-) diff --git a/js/data.js b/js/data.js index b2f5c21f..50fb9e95 100644 --- a/js/data.js +++ b/js/data.js @@ -15,15 +15,16 @@ var data = (function() { }; var save = function() { - var data = { - version: version.get(), - state: state.get(), - bookmarks: bookmarks.get() - }; if ("runtime" in chrome) { - set(saveName, JSON.stringify(data)); + if ("getManifest" in chrome.runtime) { + var data = { + version: version.get(), + state: state.get(), + bookmarks: bookmarks.get() + }; + set(saveName, JSON.stringify(data)); + }; }; - // console.log("data saved"); }; var wipe = function() {