tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

storage-session-storage.js (780B)


      1 /* This Source Code Form is subject to the terms of the Mozilla Public
      2 * License, v. 2.0. If a copy of the MPL was not distributed with this
      3 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
      4 
      5 "use strict";
      6 
      7 const {
      8  TYPES: { SESSION_STORAGE },
      9 } = require("resource://devtools/shared/commands/resource/resource-command.js");
     10 
     11 const { Front, types } = require("resource://devtools/shared/protocol.js");
     12 
     13 module.exports = function ({ resource, watcherFront, targetFront }) {
     14  if (!(resource instanceof Front) && watcherFront) {
     15    // instantiate front for session storage
     16    resource = types.getType("sessionStorage").read(resource, targetFront);
     17    resource.resourceType = SESSION_STORAGE;
     18    resource.resourceKey = "sessionStorage";
     19  }
     20 
     21  return resource;
     22 };