tor-browser

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

storage-cookie.js (920B)


      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: { COOKIE },
      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    const { innerWindowId } = resource;
     16 
     17    // it's safe to instantiate the front now, so we do it.
     18    resource = types.getType("cookies").read(resource, targetFront);
     19    resource.resourceType = COOKIE;
     20    resource.resourceId = `${COOKIE}-${targetFront.browsingContextID}`;
     21    resource.resourceKey = "cookies";
     22    resource.innerWindowId = innerWindowId;
     23  }
     24 
     25  return resource;
     26 };