5 * Library for storing device specific information. It should be used for storing simple
6 * strings and is not suitable for storing large chunks of data.
13 localStorage: window.localStorage,
16 * Retrieve value from device storage.
18 * @param {string} key Key of item to retrieve
19 * @return {string|boolean} False when localStorage not available, otherwise string
21 get: function ( key ) {
23 return mw.storage.localStorage.getItem( key );
29 * Set a value in device storage.
31 * @param {string} key Key name to store under
32 * @param {string} value Value to be stored
33 * @return {boolean} Whether the save succeeded or not
35 set: function ( key, value ) {
37 mw.storage.localStorage.setItem( key, value );
44 * Remove a value from device storage.
46 * @param {string} key Key of item to remove
47 * @return {boolean} Whether the save succeeded or not
49 remove: function ( key ) {
51 mw.storage.localStorage.removeItem( key );