src/modules/storage.js
function (callbackId) {
    const sender = this.sender
    if (!supportLocalStorage) {
      return callNotSupportFail(sender, callbackId)
    }
    try {
      const _arr = []
      for (let i = 0; i < localStorage.length; i++) {
        _arr.push(localStorage.key(i))
      }
      sender.performCallback(callbackId, {
        result: SUCCESS,
        data: _arr
      })
    }
    catch (e) {
      // accept any exception thrown during a storage attempt as a quota error
      callFail(sender, callbackId)
    }
  }
function (callbackId) {
    const sender = this.sender
    if (!supportLocalStorage) {
      return callNotSupportFail(sender, callbackId)
    }
    try {
      const _arr = []
      for (let i = 0; i < localStorage.length; i++) {
        _arr.push(localStorage.key(i))
      }
      sender.performCallback(callbackId, {
        result: SUCCESS,
        data: _arr
      })
    }
    catch (e) {
      // accept any exception thrown during a storage attempt as a quota error
      callFail(sender, callbackId)
    }
  }
function ( callbackId ) { const sender = this . sender if ( ! supportLocalStorage ) { return callNotSupportFail ( sender , callbackId ) } try { const _arr = [ ] for ( let i = 0 ; i < localStorage . length ; i ++ ) { _arr . push ( localStorage . key ( i ) ) } sender . performCallback ( callbackId , { result : SUCCESS , data : _arr } ) } catch ( e ) { // accept any exception thrown during a storage attempt as a quota error callFail ( sender , callbackId ) } }
Returns an array that contains all keys stored in Storage object.
@param {function} callbackId
Returns an array that contains all keys stored in Storage object .