B2G/gecko/browser/components/sessionstore/src/SessionStorage.jsm
/**
   * Reads all session storage data from the given docShell.
   * @param aDocShell
   *        A tab's docshell (containing the sessionStorage)
   * @param aFullData
   *        Always return privacy sensitive data (use with care)
   */
Reads all session storage data from the given docShell.
@param aDocShell
A tab's docshell (containing the sessionStorage)
@param aFullData
Always return privacy sensitive data (use with care)
Reads all session storage data from the given docShell . @param aDocShell A tab ' s docshell ( containing the sessionStorage ) @param aFullData Always return privacy sensitive data ( use with care )
function DomStorage_read(aDocShell, aFullData) {
    let data = {};
    let isPinned = aDocShell.isAppTab;
    let shistory = aDocShell.sessionHistory;
    for (let i = 0; i < shistory.count; i++) {
      let principal = History.getPrincipalForEntry(shistory, i, aDocShell);
      if (!principal)
        continue;
      let isHTTPS = principal.URI && principal.URI.schemeIs("https");
      if (aFullData || SessionStore.checkPrivacyLevel(isHTTPS, isPinned)) {
        let origin = principal.extendedOrigin;
        if (!(origin in data)) {
          let originData = this._readEntry(principal, aDocShell);
          if (Object.keys(originData).length) {
            data[origin] = originData;
          }
        }
      }
    }
    return data;
  }
function DomStorage_read ( aDocShell , aFullData ) { let data = { } ; let isPinned = aDocShell . isAppTab ; let shistory = aDocShell . sessionHistory ; for ( let i = 0 ; i < shistory . count ; i ++ ) { let principal = History . getPrincipalForEntry ( shistory , i , aDocShell ) ; if ( ! principal ) continue ; let isHTTPS = principal . URI && principal . URI . schemeIs ( "https" ) ; if ( aFullData || SessionStore . checkPrivacyLevel ( isHTTPS , isPinned ) ) { let origin = principal . extendedOrigin ; if ( ! ( origin in data ) ) { let originData = this . _readEntry ( principal , aDocShell ) ; if ( Object . keys ( originData ) . length ) { data [ origin ] = originData ; } } } } return data ; }
Reads all session storage data from the given docShell.
Reads all session storage data from the given docShell .
// Check if we're allowed to store sessionStorage data. // Don't read a host twice.