# HG changeset patch # User Matti Hamalainen # Date 1530844069 -10800 # Node ID 287892b5eff800ae022b278e7e41f55b4d5ea3a4 # Parent e5c147a7bf98f6cbd0603004aefb436089575237 Add function for checking availability of browser local storage. diff -r e5c147a7bf98 -r 287892b5eff8 multipaint.pde --- a/multipaint.pde Fri Jul 06 05:26:59 2018 +0300 +++ b/multipaint.pde Fri Jul 06 05:27:49 2018 +0300 @@ -207,6 +207,24 @@ } +bool mpHaveLocalStorage() +{ + var test = 'mpLSTest'; + try { + localStorage.setItem(test, test); + if (localStorage.getItem(test) == test) + { + localStorage.removeItem(test); + return true; + } + } + catch (e) { + return false; + } + return false; +} + + function mpLoadFileSelector(fmtname, fmtexts, fcallback) { var mpUI = stGE("mpUI");