diff --git a/js/request-queue.js b/js/request-queue.js index 5cb70eb..c8d4682 100644 --- a/js/request-queue.js +++ b/js/request-queue.js @@ -217,6 +217,21 @@ H5P.RequestQueue = (function ($, EventDispatcher) { */ H5P.OfflineRequestQueue = (function (RequestQueue, Dialog) { + let localStorageSupported; + try { + localStorageSupported = (window.localStorage !== undefined); + } + catch (exception) { + localStorageSupported = false; + } + + if (!localStorageSupported) { + // Return dummy class with the same interface, but which does nothing: + return function () { + this.add = function () {}; + }; + } + /** * Constructor *