From e9b8720f09e80124e818560262095980436ef4dc Mon Sep 17 00:00:00 2001 From: Wei Ouyang Date: Tue, 24 Nov 2020 11:30:45 +0100 Subject: [PATCH] Fix localStorage error in incognito window --- static/imjoyAPI.js | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/static/imjoyAPI.js b/static/imjoyAPI.js index 7ccc6e5..e004e84 100644 --- a/static/imjoyAPI.js +++ b/static/imjoyAPI.js @@ -150,7 +150,12 @@ document.addEventListener('DOMContentLoaded', function(){ invert: document.getElementById("invert").checked, keep_size: document.getElementById("keep-size").checked, } - saveConfig(config); + try { + saveConfig(config); + } + catch(e){ + console.error(e); + } resolve(config) api.close(); } @@ -287,4 +292,4 @@ document.addEventListener('DOMContentLoaded', function(){ api.export({setup, run, segment, showConfig, saveConfig}); }) } -}, false); \ No newline at end of file +}, false);