storage-indexed-db.js (936B)
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: { INDEXED_DB }, 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("indexedDB").read(resource, targetFront); 19 resource.resourceType = INDEXED_DB; 20 resource.resourceId = `${INDEXED_DB}-${targetFront.browsingContextID}`; 21 resource.resourceKey = "indexedDB"; 22 resource.innerWindowId = innerWindowId; 23 } 24 25 return resource; 26 };