fix: capture IndexedDB object-store record fingerprints (#809)

Signed-off-by: Rudy Celekli <47457359+rudycelekli@users.noreply.github.com>
This commit is contained in:
Rudy Mizrahi Celekli
2026-10-07 10:18:03 +08:00
committed by GitHub
parent 78014e3d14
commit 21a8bd0ccd
4 changed files with 67 additions and 6 deletions
+21 -4
View File
@@ -37,7 +37,7 @@ export const resultFor = (
case "IndexedDB.requestDatabase":
return indexedDbDatabaseResult(command);
case "IndexedDB.requestData":
return indexedDbDataResult();
return indexedDbDataResult(options);
case "CacheStorage.requestCacheNames":
return cacheStorageResult(options);
case "CacheStorage.requestEntries":
@@ -154,17 +154,34 @@ const indexedDbDatabaseResult = (command: FakeCdpCommand) => ({
},
});
const indexedDbDataResult = () => ({
const indexedDbDataResult = (options: FakeOptions) => ({
objectStoreDataEntries: [
{
key: { type: "string", value: "row-1" },
primaryKey: { type: "string", value: "row-1" },
key: indexedDbKey(options),
primaryKey: indexedDbKey(options),
value: { type: "string", value: "indexed-db-secret" },
},
],
hasMore: false,
});
const indexedDbKey = (options: FakeOptions) =>
options.indexedDbDateKeys === true
? {
type: "object",
subtype: "date",
className: "Date",
description: "Thu Jan 01 1970 00:00:00 GMT+0000",
objectId: "owned-date-key",
preview: {
type: "object",
subtype: "date",
overflow: false,
properties: [],
},
}
: { type: "string", value: "row-1" };
const cacheStorageResult = (options: FakeOptions) => ({
caches: [
{ cacheName: "assets-v1", cacheId: "secret-id" },
+1
View File
@@ -44,6 +44,7 @@ export interface FakeOptions {
readonly navigateDuringScreenshotUrl?: string;
readonly screenshotDocumentLoader?: string;
readonly extraCollections?: boolean;
readonly indexedDbDateKeys?: boolean;
readonly foreignSessionEvents?: boolean;
readonly redirectToDisallowedOrigin?: boolean;
readonly unrelatedWorker?: boolean;