Untitled

mail@pastecode.io avatar
unknown
plain_text
a month ago
387 B
3
Indexable
Never
 function listenLocalStorage(callback) {
            if (typeof (Storage.prototype || {}).setItem === 'function') {
                var originalSetItem = Storage.prototype.setItem;

                Storage.prototype.setItem = function () {
                    callback(arguments[0]);

                    originalSetItem.apply(this, arguments);
                };
            }
        }
Leave a Comment