diff --git a/www/common/sframe-boot2.js b/www/common/sframe-boot2.js index 912677b0e..d5c5e99ad 100644 --- a/www/common/sframe-boot2.js +++ b/www/common/sframe-boot2.js @@ -13,6 +13,13 @@ define([ }; } + var ls = window.localStorage; + window.CryptPad_flushCacheInner = function () { + Object.keys(ls).forEach(function (k) { + if (k.indexOf('CRYPTPAD_CACHE|') !== 0 && k.indexOf('LESS_CACHE') !== 0) { return; } + delete ls[k]; + }); + }; var mkFakeStore = function () { var fakeStorage = { getItem: function (k) { return fakeStorage[k]; }, diff --git a/www/settings/inner.js b/www/settings/inner.js index 44c1e1a51..ec8b55142 100644 --- a/www/settings/inner.js +++ b/www/settings/inner.js @@ -471,6 +471,7 @@ define([ // browsers try to load iframes from cache if they have the same id as was previously seen // this seems to help? window.location.hash = ''; + if (flush && window.CryptPad_flushCacheInner) { window.CryptPad_flushCacheInner(); } sframeChan.query('Q_COLORTHEME_CHANGE', { theme: val, flush: flush