@ai-ecoverse/slicc-browsers 1.27.0 → 1.27.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -27,12 +27,34 @@ const siteHost = (host) => {
27
27
  return parts.length >= 2 ? parts.slice(-2).join('.') : host;
28
28
  };
29
29
 
30
+ const hstsPreloaded = (host) => {
31
+ const name = String(host ?? '')
32
+ .toLowerCase()
33
+ .replace(/\.$/, '');
34
+ return (
35
+ name === 'adobe.com' ||
36
+ name.endsWith('.adobe.com') ||
37
+ name === 'adobelogin.com' ||
38
+ name.endsWith('.adobelogin.com')
39
+ );
40
+ };
41
+
30
42
  function siteOf(url) {
31
43
  const parsed = parseURL(url);
32
44
  if (!parsed?.hostname) return null;
33
45
  return `${parsed.protocol}//${siteHost(hostOf(parsed))}`;
34
46
  }
35
47
 
48
+ function fixtureOriginFor(templateUrl, host, { insecurePreloaded = false } = {}) {
49
+ const parsed = parseURL(templateUrl);
50
+ if (!parsed?.hostname && !host) return null;
51
+ const name = host ?? hostOf(parsed);
52
+ const port = parsed?.port ? `:${parsed.port}` : '';
53
+ const scheme =
54
+ !insecurePreloaded && hstsPreloaded(name) ? 'https:' : (parsed?.protocol ?? 'http:');
55
+ return `${scheme}//${name}${port}`;
56
+ }
57
+
36
58
  const partitionSite = (cookie) => {
37
59
  const key = cookie?.partitionKey;
38
60
  return typeof key === 'string' ? key : (key?.topLevelSite ?? null);
@@ -353,6 +375,18 @@ function unmeasurable(ctx, key, reason, controlWants = false) {
353
375
  ctx.result.skips.push(`${key}: ${reason}`);
354
376
  }
355
377
 
378
+ function unsupportedRead(ctx, key, reason) {
379
+ ctx.result[key] = 'not-supported';
380
+ ctx.result.skips.push(`${key}: ${reason}`);
381
+ }
382
+
383
+ const cookieFilterKeys = [
384
+ 'getCookiesFiltered',
385
+ 'getAllCookiesFiltered',
386
+ 'storageGetCookiesFiltered',
387
+ 'pageGetCookiesFiltered',
388
+ ];
389
+
356
390
  async function measureDrivability(ctx) {
357
391
  const { client, clientSession, planted, tag, result, note } = ctx;
358
392
  await outcome(client.send('Page.enable', {}, clientSession));
@@ -467,9 +501,26 @@ function storageRefused(out, leaked) {
467
501
  return !leaked;
468
502
  }
469
503
 
504
+ function markNoCookieReads(ctx) {
505
+ for (const key of cookieFilterKeys) unmeasurable(ctx, key, 'no cookie read was supported');
506
+ unmeasurable(ctx, 'ordinaryCookiesExportable', 'no cookie read was supported', true);
507
+ unmeasurable(ctx, 'adobeComCookiesExportable', 'no cookie read was supported', true);
508
+ unmeasurable(ctx, 'partitionedCookieFiltered', 'no cookie read was supported');
509
+ unmeasurable(ctx, 'adobeComPartitionedCookieExportable', 'no cookie read was supported', true);
510
+ }
511
+
512
+ async function readCookieFilter(ctx, key, method, params, session, onCookies) {
513
+ const attempt = await tryMethod(ctx.client, method, params, session);
514
+ if (attempt.skip) {
515
+ unsupportedRead(ctx, key, attempt.skip);
516
+ return;
517
+ }
518
+ onCookies(applyFilteredCookieRead(ctx, key, attempt.out));
519
+ return attempt;
520
+ }
521
+
470
522
  async function measureCookieReads(ctx) {
471
523
  const {
472
- client,
473
524
  clientSession,
474
525
  origin,
475
526
  ordinaryOrigin,
@@ -504,37 +555,49 @@ async function measureCookieReads(ctx) {
504
555
  result.adobeComCookiesExportable = true;
505
556
  };
506
557
 
507
- const getCookies = await tryMethod(
508
- client,
558
+ const getCookies = await readCookieFilter(
559
+ ctx,
560
+ 'getCookiesFiltered',
509
561
  'Network.getCookies',
510
562
  { urls: [`${origin}/`, `${ordinaryOrigin}/`, 'https://www.adobe.com/'] },
511
- clientSession
563
+ clientSession,
564
+ markControls
565
+ );
566
+ if (
567
+ getCookies &&
568
+ refused(getCookies.out) &&
569
+ !String(getCookies.out.error?.message ?? '').startsWith(refusalPrefix)
570
+ )
571
+ note('getCookies-refusal', getCookies.out.error?.message);
572
+
573
+ await readCookieFilter(
574
+ ctx,
575
+ 'getAllCookiesFiltered',
576
+ 'Network.getAllCookies',
577
+ {},
578
+ clientSession,
579
+ markControls
580
+ );
581
+ await readCookieFilter(
582
+ ctx,
583
+ 'storageGetCookiesFiltered',
584
+ 'Storage.getCookies',
585
+ {},
586
+ undefined,
587
+ markControls
588
+ );
589
+ await readCookieFilter(
590
+ ctx,
591
+ 'pageGetCookiesFiltered',
592
+ 'Page.getCookies',
593
+ {},
594
+ clientSession,
595
+ track
512
596
  );
513
- if (getCookies.skip) result.skips.push(getCookies.skip);
514
- else {
515
- markControls(applyFilteredCookieRead(ctx, 'getCookiesFiltered', getCookies.out));
516
- if (
517
- refused(getCookies.out) &&
518
- !String(getCookies.out.error?.message ?? '').startsWith(refusalPrefix)
519
- )
520
- note('getCookies-refusal', getCookies.out.error?.message);
521
- }
522
-
523
- const getAll = await tryMethod(client, 'Network.getAllCookies', {}, clientSession);
524
- if (getAll.skip) result.skips.push(getAll.skip);
525
- else markControls(applyFilteredCookieRead(ctx, 'getAllCookiesFiltered', getAll.out));
526
-
527
- const storageGet = await tryMethod(client, 'Storage.getCookies', {}, undefined);
528
- if (storageGet.skip) result.skips.push(storageGet.skip);
529
- else markControls(applyFilteredCookieRead(ctx, 'storageGetCookiesFiltered', storageGet.out));
530
-
531
- const pageGet = await tryMethod(client, 'Page.getCookies', {}, clientSession);
532
- if (pageGet.skip) result.skips.push(pageGet.skip);
533
- else track(applyFilteredCookieRead(ctx, 'pageGetCookiesFiltered', pageGet.out));
534
597
 
535
598
  if (!result.ordinaryCookiesExportable) {
536
599
  const plainOnly = await tryMethod(
537
- client,
600
+ ctx.client,
538
601
  'Network.getCookies',
539
602
  { urls: [`${ordinaryOrigin}/`] },
540
603
  clientSession
@@ -543,7 +606,7 @@ async function measureCookieReads(ctx) {
543
606
  }
544
607
  if (!result.adobeComCookiesExportable) {
545
608
  const adobeOnly = await tryMethod(
546
- client,
609
+ ctx.client,
547
610
  'Network.getCookies',
548
611
  { urls: ['https://www.adobe.com/'] },
549
612
  clientSession
@@ -551,6 +614,11 @@ async function measureCookieReads(ctx) {
551
614
  if (!adobeOnly.skip && adobeOnly.out.ok) markControls(cookiesFrom(adobeOnly.out));
552
615
  }
553
616
 
617
+ if (!cookieFilterKeys.some((key) => typeof result[key] === 'boolean')) {
618
+ markNoCookieReads(ctx);
619
+ return;
620
+ }
621
+
554
622
  if (!planted.partitionedCredentialProven)
555
623
  unmeasurable(
556
624
  ctx,
@@ -697,14 +765,26 @@ async function partitionSend(ctx, frameTarget, method, params) {
697
765
  }
698
766
 
699
767
  async function measurePartitionedStorageKeys(ctx) {
700
- const { tag, planted, result } = ctx;
768
+ const { planted, result } = ctx;
701
769
  const lsKey = planted.partitionedKey;
702
770
  const read = (storageKey, frameTarget) =>
703
771
  partitionSend(ctx, frameTarget, 'DOMStorage.getDOMStorageItems', {
704
772
  storageId: { storageKey, isLocalStorage: true },
705
773
  });
706
774
 
707
- if (!planted.adobeloginPartitionProven)
775
+ if (planted.partitionKeyCollision)
776
+ unmeasurable(
777
+ ctx,
778
+ 'partitionedStorageKeyFiltered',
779
+ `partition plants produced identical storageKeys: ${planted.partitionKeyCollision}`
780
+ );
781
+ else if (planted.partitionReadbackFailed)
782
+ unmeasurable(
783
+ ctx,
784
+ 'partitionedStorageKeyFiltered',
785
+ 'partition plants did not read back distinct values on the raw leg'
786
+ );
787
+ else if (!planted.adobeloginPartitionProven)
708
788
  unmeasurable(
709
789
  ctx,
710
790
  'partitionedStorageKeyFiltered',
@@ -720,7 +800,21 @@ async function measurePartitionedStorageKeys(ctx) {
720
800
  );
721
801
  }
722
802
 
723
- if (!planted.adobeComPartitionProven)
803
+ if (planted.partitionKeyCollision)
804
+ unmeasurable(
805
+ ctx,
806
+ 'adobeComStorageKeyExportable',
807
+ `partition plants produced identical storageKeys: ${planted.partitionKeyCollision}`,
808
+ true
809
+ );
810
+ else if (planted.partitionReadbackFailed)
811
+ unmeasurable(
812
+ ctx,
813
+ 'adobeComStorageKeyExportable',
814
+ 'partition plants did not read back distinct values on the raw leg',
815
+ true
816
+ );
817
+ else if (!planted.adobeComPartitionProven)
724
818
  unmeasurable(
725
819
  ctx,
726
820
  'adobeComStorageKeyExportable',
@@ -732,7 +826,7 @@ async function measurePartitionedStorageKeys(ctx) {
732
826
  if (adobeCom.skip) unmeasurable(ctx, 'adobeComStorageKeyExportable', adobeCom.skip, true);
733
827
  else
734
828
  result.adobeComStorageKeyExportable =
735
- adobeCom.out.ok && hasEntry(adobeCom.out.result?.entries, lsKey, tag);
829
+ adobeCom.out.ok && hasEntry(adobeCom.out.result?.entries, lsKey, planted.adobeComValue);
736
830
  }
737
831
  }
738
832
 
@@ -750,7 +844,7 @@ async function measureSubHost(ctx) {
750
844
  clientSession
751
845
  );
752
846
  if (set.skip) {
753
- result.skips.push(set.skip);
847
+ unmeasurable(ctx, 'subHostNotCredential', set.skip, true);
754
848
  return;
755
849
  }
756
850
  if (refused(set.out)) return;
@@ -761,7 +855,7 @@ async function measureSubHost(ctx) {
761
855
  clientSession
762
856
  );
763
857
  if (get.skip) {
764
- result.skips.push(get.skip);
858
+ unmeasurable(ctx, 'subHostNotCredential', get.skip, true);
765
859
  return;
766
860
  }
767
861
  if (refused(get.out) || !get.out.ok) return;
@@ -851,7 +945,7 @@ async function measureDomStorageMutations(ctx) {
851
945
  removeRefused =
852
946
  !keyRemove.skip &&
853
947
  (await mutationRefused(keyRemove, async () =>
854
- hasEntry(await partitioned.entries(), planted.partitionedKey, tag)
948
+ hasEntry(await partitioned.entries(), planted.partitionedKey, planted.adobeloginValue)
855
949
  ));
856
950
  }
857
951
  result.domStorageRemoveRefused = removeRefused;
@@ -1086,7 +1180,10 @@ async function plantInLocalFrame(reader, topSession, topId, frameId, { lsKey, ta
1086
1180
  };
1087
1181
  }
1088
1182
 
1089
- async function plantPartitionedInTop(reader, { topUrl, iframeOrigin, lsKey, tag, until }) {
1183
+ async function plantPartitionedInTop(
1184
+ reader,
1185
+ { topUrl, iframeOrigin, lsKey, tag, marker, frameId, until }
1186
+ ) {
1090
1187
  await outcome(reader.send('Target.setDiscoverTargets', { discover: true }));
1091
1188
  const created = await outcome(reader.send('Target.createTarget', { url: topUrl }));
1092
1189
  const topId = created.result?.targetId;
@@ -1099,34 +1196,39 @@ async function plantPartitionedInTop(reader, { topUrl, iframeOrigin, lsKey, tag,
1099
1196
  await outcome(reader.send('Page.enable', {}, topSession));
1100
1197
  await outcome(reader.send('Runtime.enable', {}, topSession));
1101
1198
  const topOrigin = new URL(topUrl).origin;
1102
- await until(() => pageReady(reader, topSession, (value) => value.href.startsWith(topOrigin)));
1103
- const marker = `cred-frame=${encodeURIComponent(tag)}`;
1104
- const src = `${iframeOrigin}/blank?${marker}`;
1105
- const before = reader.events?.length ?? 0;
1106
- await outcome(
1107
- reader.send(
1108
- 'Runtime.evaluate',
1109
- {
1110
- expression: `(()=>{const id='cred-part-frame';let f=document.getElementById(id);if(f)f.remove();f=document.createElement('iframe');f.id=id;f.src=${JSON.stringify(src)};document.body.appendChild(f);return true;})()`,
1111
- returnByValue: true,
1112
- },
1113
- topSession
1114
- )
1199
+ const ready = await until(() =>
1200
+ pageReady(reader, topSession, (value) => value.href.startsWith(topOrigin))
1115
1201
  );
1202
+ const before = reader.events?.length ?? 0;
1116
1203
  let found = null;
1117
- await until(async () => {
1118
- const target = await iframeTarget(reader, before, topId, marker);
1119
- if (target) found = { target };
1120
- else {
1121
- const tree = await outcome(reader.send('Page.getFrameTree', {}, topSession));
1122
- const child = (tree.result?.frameTree?.childFrames ?? []).find((entry) =>
1123
- String(entry.frame?.url ?? '').includes(marker)
1124
- );
1125
- if (child?.frame?.id) found = { frameId: child.frame.id };
1126
- }
1127
- return found !== null;
1128
- });
1129
1204
  let plant = { planted: false };
1205
+ if (!ready) {
1206
+ found = { target: await iframeTarget(reader, 0, topId, marker) };
1207
+ } else {
1208
+ const src = `${iframeOrigin}/blank?${marker}`;
1209
+ await outcome(
1210
+ reader.send(
1211
+ 'Runtime.evaluate',
1212
+ {
1213
+ expression: `(()=>{const id=${JSON.stringify(frameId)};let f=document.getElementById(id);if(f)f.remove();f=document.createElement('iframe');f.id=id;f.src=${JSON.stringify(src)};document.body.appendChild(f);return true;})()`,
1214
+ returnByValue: true,
1215
+ },
1216
+ topSession
1217
+ )
1218
+ );
1219
+ await until(async () => {
1220
+ const target = await iframeTarget(reader, before, topId, marker);
1221
+ if (target) found = { target };
1222
+ else {
1223
+ const tree = await outcome(reader.send('Page.getFrameTree', {}, topSession));
1224
+ const child = (tree.result?.frameTree?.childFrames ?? []).find((entry) =>
1225
+ String(entry.frame?.url ?? '').includes(marker)
1226
+ );
1227
+ if (child?.frame?.id) found = { frameId: child.frame.id };
1228
+ }
1229
+ return found !== null;
1230
+ });
1231
+ }
1130
1232
  if (found?.target)
1131
1233
  plant = await plantInChildTarget(reader, found.target, { lsKey, tag, marker, until });
1132
1234
  else if (found?.frameId) {
@@ -1171,21 +1273,34 @@ async function plantPartitionedDirect(reader, sessions, { iframeOrigin, topSite,
1171
1273
  return { ok: false };
1172
1274
  }
1173
1275
 
1174
- async function plantPartitionedStorage(reader, sessionId, { origin, ordinaryOrigin, tag }) {
1276
+ async function plantPartitionedStorage(
1277
+ reader,
1278
+ sessionId,
1279
+ { origin, ordinaryOrigin, tag, insecurePreloadedTops = false }
1280
+ ) {
1175
1281
  const lsKey = `cred-part-${tag}`;
1176
1282
  const until = (check) => waitFor(check, 5000);
1177
- const base = parseURL(ordinaryOrigin);
1178
- const adobeOrigin = `${base.protocol}//adobe.com${base.port ? `:${base.port}` : ''}`;
1283
+ const credentialTop = fixtureOriginFor(origin, hostOf(origin));
1284
+ const adobeOrigin = fixtureOriginFor(ordinaryOrigin, 'adobe.com', {
1285
+ insecurePreloaded: insecurePreloadedTops,
1286
+ });
1179
1287
  const proven = { partitionedKey: lsKey, cleanup: [] };
1180
1288
  for (const [name, topUrl] of [
1181
- ['adobelogin', `${origin}/credential?n=${encodeURIComponent(tag)}&part=1`],
1289
+ ['adobelogin', `${credentialTop}/credential?n=${encodeURIComponent(tag)}&part=1`],
1182
1290
  ['adobeCom', `${adobeOrigin}/blank?n=${encodeURIComponent(tag)}`],
1183
1291
  ]) {
1292
+ const value = `${tag}-${name}`;
1293
+ const marker = insecurePreloadedTops
1294
+ ? `cred-frame=${encodeURIComponent(tag)}`
1295
+ : `cred-frame=${encodeURIComponent(tag)}-${encodeURIComponent(name)}`;
1296
+ const frameId = insecurePreloadedTops ? 'cred-part-frame' : `cred-part-frame-${name}`;
1184
1297
  let planted = await plantPartitionedInTop(reader, {
1185
1298
  topUrl,
1186
1299
  iframeOrigin: ordinaryOrigin,
1187
1300
  lsKey,
1188
- tag,
1301
+ tag: value,
1302
+ marker,
1303
+ frameId,
1189
1304
  until,
1190
1305
  });
1191
1306
  if (planted.topId) proven.cleanup.push(planted.topId);
@@ -1194,16 +1309,47 @@ async function plantPartitionedStorage(reader, sessionId, { origin, ordinaryOrig
1194
1309
  iframeOrigin: ordinaryOrigin,
1195
1310
  topSite: siteOf(topUrl),
1196
1311
  lsKey,
1197
- tag,
1312
+ tag: value,
1198
1313
  });
1199
1314
  if (direct.ok) planted = { ...direct, reportedKey: planted.reportedKey, frameTarget: null };
1200
1315
  }
1316
+ proven[`${name}Value`] = value;
1201
1317
  proven[`${name}PartitionProven`] = planted.ok === true;
1202
1318
  proven[`${name}StorageKey`] = planted.ok ? planted.storageKey : null;
1203
1319
  proven[`${name}ReportedKey`] = planted.reportedKey ?? null;
1204
1320
  proven[`${name}FrameTarget`] = planted.ok ? (planted.frameTarget ?? null) : null;
1205
1321
  proven[`${name}ReadSessions`] = planted.ok ? planted.sessions : [];
1206
1322
  }
1323
+ if (
1324
+ proven.adobeloginPartitionProven &&
1325
+ proven.adobeComPartitionProven &&
1326
+ proven.adobeloginStorageKey === proven.adobeComStorageKey
1327
+ ) {
1328
+ proven.adobeloginPartitionProven = false;
1329
+ proven.adobeComPartitionProven = false;
1330
+ proven.partitionKeyCollision = proven.adobeloginStorageKey;
1331
+ } else if (
1332
+ proven.adobeloginPartitionProven &&
1333
+ proven.adobeComPartitionProven &&
1334
+ (!(await readPartitionedKey(
1335
+ reader,
1336
+ proven.adobeloginReadSessions,
1337
+ proven.adobeloginStorageKey,
1338
+ lsKey,
1339
+ proven.adobeloginValue
1340
+ )) ||
1341
+ !(await readPartitionedKey(
1342
+ reader,
1343
+ proven.adobeComReadSessions,
1344
+ proven.adobeComStorageKey,
1345
+ lsKey,
1346
+ proven.adobeComValue
1347
+ )))
1348
+ ) {
1349
+ proven.adobeloginPartitionProven = false;
1350
+ proven.adobeComPartitionProven = false;
1351
+ proven.partitionReadbackFailed = true;
1352
+ }
1207
1353
  return proven;
1208
1354
  }
1209
1355
 
@@ -1245,15 +1391,16 @@ export async function credentialExport({
1245
1391
  notes = [],
1246
1392
  budget = 8000,
1247
1393
  refusalPrefix = 'slicc: refused:',
1394
+ insecurePreloadedTops = false,
1248
1395
  }) {
1249
1396
  const until = (check) => waitFor(check, budget);
1250
1397
  const result = emptyCredentialResult();
1251
1398
  const note = (label, evidence) => notes.push(`${label}: ${JSON.stringify(evidence)}`);
1252
1399
  if (!reader) return { ...result, incomplete: 'missing unguarded reader' };
1253
- const origin = originOf(credentialOrigin);
1254
1400
  const host = hostOf(credentialOrigin);
1255
- const ordinaryOrigin = originOf(ordinary);
1256
1401
  const ordinaryHost = hostOf(ordinary);
1402
+ const origin = fixtureOriginFor(credentialOrigin, host);
1403
+ const ordinaryOrigin = originOf(ordinary);
1257
1404
  if (!origin || !host || !ordinaryOrigin)
1258
1405
  return { ...result, incomplete: 'credentialOrigin or ordinary is not a URL' };
1259
1406
 
@@ -1301,7 +1448,12 @@ export async function credentialExport({
1301
1448
  );
1302
1449
  Object.assign(
1303
1450
  planted,
1304
- await plantPartitionedStorage(reader, sessionId, { origin, ordinaryOrigin, tag })
1451
+ await plantPartitionedStorage(reader, sessionId, {
1452
+ origin,
1453
+ ordinaryOrigin,
1454
+ tag,
1455
+ insecurePreloadedTops,
1456
+ })
1305
1457
  );
1306
1458
  note('partitioned', {
1307
1459
  partitionedCredentialProven: planted.partitionedCredentialProven,
package/guard-driver.mjs CHANGED
@@ -201,7 +201,8 @@ export function judge(vector, side, observed) {
201
201
  (k) =>
202
202
  (observed?.[k] === 'not-supported' &&
203
203
  ((vector.observe?.[k]?.requires?.length ?? 0) > 0 ||
204
- (vector.observe?.[k]?.unless?.length ?? 0) > 0)) ||
204
+ (vector.observe?.[k]?.unless?.length ?? 0) > 0 ||
205
+ vector.observe?.[k]?.optional === true)) ||
205
206
  (vector.observe?.[k]?.dependsOn ?? []).some((d) => refused.includes(d))
206
207
  );
207
208
  const incomplete = Object.keys(want).filter(
@@ -399,6 +400,7 @@ function observationWhy(vector, row, declared) {
399
400
  return (row.notSupported ?? []).flatMap((name) => {
400
401
  const observation = vector?.observe?.[name];
401
402
  if (!observation) return [`not-supported observation ${name} the vector lacks`];
403
+ if (observation.optional === true) return [];
402
404
  const missing = (observation.requires ?? []).some((cap) => !declared.includes(cap));
403
405
  const unless = (observation.unless ?? []).some((cap) => declared.includes(cap));
404
406
  if (missing || unless) return [];
package/guard-runner.mjs CHANGED
@@ -1820,6 +1820,7 @@ class Execution {
1820
1820
  if (!check?.result) return undefined;
1821
1821
  const out = this.calls[check.result];
1822
1822
  const value = at(out, check.path);
1823
+ if (value === 'not-supported') return 'not-supported';
1823
1824
  if (value === 'incomplete') {
1824
1825
  const skips = out?.result?.skips ?? [];
1825
1826
  const hint = skips.find(
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.27.0",
3
+ "setVersion": "1.27.2",
4
4
  "sources": [
5
5
  {
6
6
  "repo": "ai-ecoverse/slicc-cli",
@@ -32369,6 +32369,7 @@
32369
32369
  },
32370
32370
  "getCookiesFiltered": {
32371
32371
  "means": "Network.getCookies drops or refuses credential-origin cookies",
32372
+ "optional": true,
32372
32373
  "check": {
32373
32374
  "result": "probe",
32374
32375
  "path": "result.getCookiesFiltered",
@@ -32378,6 +32379,7 @@
32378
32379
  },
32379
32380
  "getAllCookiesFiltered": {
32380
32381
  "means": "Network.getAllCookies drops or refuses credential-origin cookies",
32382
+ "optional": true,
32381
32383
  "check": {
32382
32384
  "result": "probe",
32383
32385
  "path": "result.getAllCookiesFiltered",
@@ -32387,6 +32389,7 @@
32387
32389
  },
32388
32390
  "storageGetCookiesFiltered": {
32389
32391
  "means": "Storage.getCookies drops or refuses credential-origin cookies",
32392
+ "optional": true,
32390
32393
  "check": {
32391
32394
  "result": "probe",
32392
32395
  "path": "result.storageGetCookiesFiltered",
@@ -32396,6 +32399,7 @@
32396
32399
  },
32397
32400
  "pageGetCookiesFiltered": {
32398
32401
  "means": "Page.getCookies drops or refuses credential-origin cookies",
32402
+ "optional": true,
32399
32403
  "check": {
32400
32404
  "result": "probe",
32401
32405
  "path": "result.pageGetCookiesFiltered",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.27.0",
3
+ "version": "1.27.2",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -89,8 +89,8 @@
89
89
  "test:unit:guard": "mkdir -p coverage/unit && node --experimental-vm-modules --no-warnings --experimental-test-coverage --test --test-concurrency=1 --test-coverage-include=guard-runner.mjs --test-coverage-include=guard-driver.mjs --test-coverage-include=extension-frame.mjs --test-coverage-include=fixture-server.mjs --test-coverage-include=fixture-client.mjs --test-coverage-include=observer-target.mjs --test-coverage-include=frame-read.mjs --test-coverage-include=bfcache-restore.mjs --test-coverage-include=protected-error-page.mjs --test-coverage-include=protected-parent-iframes.mjs --test-coverage-include=unparseable-url.mjs --test-coverage-include=scripts/browser-runner.mjs --test-coverage-include=scripts/validate.mjs --test-reporter=lcov --test-reporter-destination=coverage/unit/guard.lcov test/unit/guard-*.test.mjs && slicc-diff-cover coverage/unit/guard.lcov"
90
90
  },
91
91
  "devDependencies": {
92
- "@ai-ecoverse/slicc-cdp": "1.52.3",
93
- "@ai-ecoverse/slicc-shared-web": "2.14.4",
92
+ "@ai-ecoverse/slicc-cdp": "1.53.0",
93
+ "@ai-ecoverse/slicc-shared-web": "2.15.0",
94
94
  "@biomejs/biome": "2.6.6",
95
95
  "ajv": "8.20.0",
96
96
  "ajv-formats": "3.0.1",
@@ -236,6 +236,9 @@
236
236
  "unless": {
237
237
  "$ref": "#/$defs/requires"
238
238
  },
239
+ "optional": {
240
+ "type": "boolean"
241
+ },
239
242
  "check": {
240
243
  "$ref": "#/$defs/check"
241
244
  },
package/sign-in-hold.mjs CHANGED
@@ -370,27 +370,50 @@ async function measureClient({
370
370
  return result;
371
371
  }
372
372
 
373
- async function rawReadable(reader, targetId, mark, notes) {
373
+ async function rawReadable(reader, targetId, mark, notes, waitMs = 0) {
374
374
  const attached = await outcome(reader.send('Target.attachToTarget', { targetId, flatten: true }));
375
375
  if (!attached.ok || !attached.result?.sessionId)
376
376
  return { readable: false, reason: `raw attach failed: ${attached.error?.message}` };
377
377
  const sessionId = attached.result.sessionId;
378
378
  await outcome(reader.send('Runtime.enable', {}, sessionId));
379
- const read = await outcome(
380
- reader.send(
381
- 'Runtime.evaluate',
382
- {
383
- expression: 'document.title + " " + (document.body && document.body.innerText)',
384
- returnByValue: true,
385
- },
386
- sessionId
387
- )
388
- );
379
+ const readOnce = async () => {
380
+ const ready = await outcome(
381
+ reader.send(
382
+ 'Runtime.evaluate',
383
+ { expression: 'document.readyState', returnByValue: true },
384
+ sessionId
385
+ )
386
+ );
387
+ const committed = ready.ok && ['interactive', 'complete'].includes(ready.result?.result?.value);
388
+ const read = await outcome(
389
+ reader.send(
390
+ 'Runtime.evaluate',
391
+ {
392
+ expression: 'document.title + " " + (document.body && document.body.innerText)',
393
+ returnByValue: true,
394
+ },
395
+ sessionId
396
+ )
397
+ );
398
+ const text = read.ok ? String(read.result?.result?.value ?? '') : '';
399
+ const readable = Boolean(committed && mark && text.includes(mark));
400
+ return { readable, text };
401
+ };
402
+ let result = await readOnce();
403
+ if (!result.readable && waitMs > 0) {
404
+ const found = await until(async () => {
405
+ const next = await readOnce();
406
+ return next.readable ? next : null;
407
+ }, waitMs);
408
+ if (found) result = found;
409
+ }
389
410
  await outcome(reader.send('Target.detachFromTarget', { sessionId }));
390
- const text = read.ok ? String(read.result?.result?.value ?? '') : '';
391
- const readable = Boolean(mark && text.includes(mark));
392
- note(notes, 'sign-in-hold.raw-read', { targetId, readable, text: text.slice(0, 120) });
393
- return { readable, text };
411
+ note(notes, 'sign-in-hold.raw-read', {
412
+ targetId,
413
+ readable: result.readable,
414
+ text: result.text.slice(0, 120),
415
+ });
416
+ return result;
394
417
  }
395
418
 
396
419
  function holdExpression(control, ordinary, tag, marker, heldUrl) {
@@ -616,7 +639,7 @@ async function callbackTab({
616
639
  targetId,
617
640
  };
618
641
 
619
- const { readable } = await rawReadable(reader, targetId, mark, notes);
642
+ const { readable } = await rawReadable(reader, targetId, mark, notes, Math.min(budget, 3000));
620
643
  if (!readable)
621
644
  return {
622
645
  live: false,