@ai-ecoverse/slicc-browsers 1.41.0 → 1.43.0

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.
package/catalog.json CHANGED
@@ -705,6 +705,7 @@
705
705
  "protectedOrigins": {
706
706
  "domains": ["sliccy.ai"],
707
707
  "hosts": ["vault.sliccy.ai"],
708
+ "keptOrigins": ["https://lease-pilot.sliccy.ai"],
708
709
  "schemes": ["https", "http"],
709
710
  "innerSchemes": ["blob", "filesystem", "view-source"],
710
711
  "anySchemes": ["devtools"],
package/guard-runner.mjs CHANGED
@@ -3353,6 +3353,7 @@ function finishRow(vector, base, legs, opts) {
3353
3353
  ? { guarded: legs.guarded.calls }
3354
3354
  : {}),
3355
3355
  };
3356
+ const errorLegs = ['control', 'guarded'].filter((side) => legs[side].errors.length);
3356
3357
  const row = {
3357
3358
  ...result(vector, {
3358
3359
  ...base,
@@ -3365,6 +3366,7 @@ function finishRow(vector, base, legs, opts) {
3365
3366
  transportVariant: base.transportVariant,
3366
3367
  observations: { control: legs.control.observed, guarded: legs.guarded.observed },
3367
3368
  errors: [...legs.control.errors, ...legs.guarded.errors],
3369
+ ...(errorLegs.length ? { errorLegs } : {}),
3368
3370
  designDependent: vector.designDependent ?? [],
3369
3371
  ...(Object.keys(calls).length ? { calls } : {}),
3370
3372
  ...probeEvidence(legs),
@@ -3375,10 +3377,8 @@ function finishRow(vector, base, legs, opts) {
3375
3377
  ];
3376
3378
  if (notes.length) row.notes = notes;
3377
3379
  settleIncomplete(row, vector, base, legs);
3378
- if (row.errors.length) {
3379
- row.control = 'fail';
3380
- row.guarded = 'fail';
3381
- }
3380
+ if (legs.control.errors.length) row.control = 'fail';
3381
+ if (row.errors.length) row.guarded = 'fail';
3382
3382
  return row;
3383
3383
  }
3384
3384
 
@@ -3452,7 +3452,7 @@ function settleIncomplete(row, vector, base, legs) {
3452
3452
  );
3453
3453
  if (!incomplete.length) return;
3454
3454
  row.incomplete = incomplete;
3455
- if (row.errors.length) return;
3455
+ if (legs.control.errors.length) return;
3456
3456
  const fill = (side) => {
3457
3457
  const want = side === 'control' ? vector.control.expected : vector.expected;
3458
3458
  return Object.fromEntries(
@@ -3473,6 +3473,7 @@ function settleIncomplete(row, vector, base, legs) {
3473
3473
  });
3474
3474
  for (const side of ['control', 'guarded'])
3475
3475
  if (legs[side].incomplete?.length && filled[side] === 'pass') row[side] = 'incomplete';
3476
+ if (legs.guarded.errors.length) return;
3476
3477
  if (legs.control.incomplete?.length && row.guarded === 'fail' && filled.guarded === 'pass')
3477
3478
  row.guarded = 'incomplete';
3478
3479
  if (legs.guarded.live === 'incomplete' && filled.live === 'pass') row.live = 'incomplete';
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.41.0",
3
+ "setVersion": "1.43.0",
4
4
  "sources": [
5
5
  {
6
6
  "repo": "ai-ecoverse/slicc-cli",
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.41.0",
3
+ "version": "1.43.0",
4
4
  "description": "SLICC's shared browser catalog, JSON schemas and discovery conformance corpus",
5
5
  "type": "module",
6
6
  "license": "Apache-2.0",
@@ -79,7 +79,7 @@
79
79
  "validate": "node scripts/validate.mjs",
80
80
  "lint": "slicc-lint && test -z \"$(gofmt -l .)\" && go mod tidy -diff && go vet ./... && GOOS=darwin go vet ./... && GOOS=windows go vet ./... && golangci-lint run && cargo fmt --check && cargo clippy --all-features --all-targets -- -D warnings && cargo check --target wasm32-wasip1 --no-default-features && cargo check --target wasm32-wasip1 --features serde && cargo check --target wasm32-wasip1 --all-features",
81
81
  "format": "biome check --write . && gofmt -w . && cargo fmt",
82
- "test": "export PATH=\"$HOME/.cargo/bin:$PATH\" && node --test --test-concurrency=1 test/integration/debugger-stage1-packaging.test.mjs test/integration/debugger-raw-control.test.mjs test/integration/debugger-cleanup.test.mjs test/integration/debugger-stage1-install-vectors.test.mjs test/integration/protected-premise.test.mjs test/integration/debugger-stage1-vectors.test.mjs test/integration/self-contained.test.mjs test/integration/seven-corpus.test.mjs test/integration/browser-runner.test.mjs test/integration/fixture-client.test.mjs test/integration/guard-redirect-carrier.test.mjs test/integration/guard-redirect-session-end.test.mjs test/integration/guard-redirect-history.test.mjs test/integration/guard-redirect-iframe.test.mjs test/integration/guard-redirect-through.test.mjs test/integration/guard-incomplete.test.mjs test/integration/guard-unparseable-wipe.test.mjs test/integration/guard-browser-ui.test.mjs test/integration/guard-snapshot-settle.test.mjs test/integration/guard-stall.test.mjs test/integration/guard-forged.test.mjs test/integration/guard-trusted-emulation.test.mjs test/integration/guard-exit-steps.test.mjs test/integration/guard-exit-refusal.test.mjs test/integration/guard-frame-read.test.mjs test/integration/guard-bfcache.test.mjs test/integration/guard-bfcache-marker.test.mjs test/integration/guard-bfcache-history.test.mjs test/integration/guard-bfcache-review.test.mjs test/integration/guard-bfcache-quarantine.test.mjs test/integration/guard-error-page-navigation.test.mjs test/integration/guard-error-page-events.test.mjs test/integration/guard-error-page-reload.test.mjs test/integration/guard-close-protected.test.mjs test/integration/guard-close-protected-shapes.test.mjs test/integration/guard-close-protected-shapes-chrome.test.mjs test/integration/guard-credential-export.test.mjs test/integration/guard-protected-parent-iframes.test.mjs test/integration/guard-protected-parent-iframes-chrome.test.mjs test/integration/guard-error-frame-class.test.mjs test/integration/guard-sign-in-hold.test.mjs test/integration/guard-cookie-plant-chrome.test.mjs test/integration/guard-cookie-plant.test.mjs test/integration/guard-protected-parent-page.test.mjs test/integration/guard-protected-parent-page-chrome.test.mjs test/integration/guard-world-paint.test.mjs test/integration/gates.test.mjs test/integration/validate.test.mjs test/integration/validate-guard-stock-setup.test.mjs test/integration/validate-guard-explicit.test.mjs test/integration/go.test.mjs test/integration/cargo.test.mjs test/integration/workflows.test.mjs test/integration/guard-refusable-nav.test.mjs test/integration/guard-protected-worker.test.mjs test/integration/guard-protected-worker-chrome-narrow.test.mjs test/integration/guard-protected-worker-chrome-hide.test.mjs test/integration/guard-protected-worker-chrome-hide-cut.test.mjs test/integration/guard-protected-worker-chrome-admit.test.mjs test/integration/guard-protected-worker-chrome-late.test.mjs test/integration/guard-protected-worker-chrome-rewrite.test.mjs test/integration/guard-protected-worker-chrome-rewrite-late.test.mjs test/integration/guard-sweep-union.test.mjs test/integration/guard-explicit-attach-chrome.test.mjs && node --test --test-concurrency=2 test/integration/guard-lifecycle.test.mjs test/integration/chromium-launch.test.mjs test/integration/guard-fit.test.mjs test/integration/guard-chain.test.mjs test/integration/guard-validation.test.mjs test/integration/guard-liveness.test.mjs test/integration/guard-observations.test.mjs test/integration/guard-child-latency.test.mjs test/integration/guard-child-latency-stress.test.mjs test/integration/guard-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.test.mjs test/integration/guard-cookie-plant-raw-leg.test.mjs test/integration/guard-cookie-plant-deletion.test.mjs test/integration/guard-cookie-plant-attach.test.mjs test/integration/guard-cookie-plant-attach-retry.test.mjs test/integration/guard-cookie-plant-open-commit.test.mjs test/integration/guard-cookie-plant-legacy-setup.test.mjs test/integration/guard-legs.test.mjs test/integration/guard-fetch-enable.test.mjs test/integration/guard-diagnostics.test.mjs test/integration/guard-chrome.test.mjs test/integration/guard-worlds.test.mjs test/integration/guard-world-discovery.test.mjs test/integration/guard-world-guesses.test.mjs test/integration/guard-unparseable.test.mjs test/integration/guard-redirect-secret.test.mjs test/integration/guard-error-page.test.mjs test/integration/guard-error-page-enable.test.mjs test/integration/guard-discovery.test.mjs test/integration/guard-bfcache-chrome.test.mjs test/integration/guard-bfcache-ownership-probe.test.mjs test/integration/guard-browser-page.test.mjs test/integration/guard-scales.test.mjs test/integration/guard-shared-log.test.mjs test/integration/guard-pre-beacon.test.mjs test/integration/guard-world-pause.test.mjs test/integration/guard-reveal-overlap.test.mjs test/integration/guard-extension-frame-cast.test.mjs test/integration/guard-extension-frame-mouse.test.mjs test/integration/guard-extension-frame-click.test.mjs test/integration/guard-extension-frame-key.test.mjs test/integration/guard-extension-frame-attach.test.mjs test/integration/guard-extension-frames.test.mjs test/integration/guard-stock-setup.test.mjs test/integration/guard-explicit-attach.test.mjs test/integration/guard-explicit-order.test.mjs test/integration/guard-stock-attack.test.mjs test/integration/guard-parallel.test.mjs test/integration/guard-client-exit.test.mjs test/integration/guard-runner-record.test.mjs test/integration/guard-runner.test.mjs test/integration/guard-sweep-ordinary.test.mjs test/integration/guard-sweep-seven.test.mjs test/integration/guard-sweep-vault.test.mjs test/integration/guard-sweep-vault-x.test.mjs test/integration/guard-sweep-apex.test.mjs test/integration/guard-sweep-idp.test.mjs test/integration/guard-sweep-others.test.mjs test/integration/guard-browser-storage.test.mjs test/integration/guard-control-premises.test.mjs test/integration/guard-control-probe-failure.test.mjs",
82
+ "test": "export PATH=\"$HOME/.cargo/bin:$PATH\" && node --test --test-concurrency=1 test/integration/debugger-stage1-packaging.test.mjs test/integration/debugger-raw-control.test.mjs test/integration/debugger-cleanup.test.mjs test/integration/debugger-stage1-install-vectors.test.mjs test/integration/protected-premise.test.mjs test/integration/debugger-stage1-vectors.test.mjs test/integration/self-contained.test.mjs test/integration/seven-corpus.test.mjs test/integration/browser-runner.test.mjs test/integration/fixture-client.test.mjs test/integration/guard-redirect-carrier.test.mjs test/integration/guard-redirect-session-end.test.mjs test/integration/guard-redirect-history.test.mjs test/integration/guard-redirect-iframe.test.mjs test/integration/guard-redirect-through.test.mjs test/integration/guard-incomplete.test.mjs test/integration/guard-unparseable-wipe.test.mjs test/integration/guard-browser-ui.test.mjs test/integration/guard-snapshot-settle.test.mjs test/integration/guard-stall.test.mjs test/integration/guard-forged.test.mjs test/integration/guard-trusted-emulation.test.mjs test/integration/guard-exit-steps.test.mjs test/integration/guard-exit-refusal.test.mjs test/integration/guard-frame-read.test.mjs test/integration/guard-bfcache.test.mjs test/integration/guard-bfcache-marker.test.mjs test/integration/guard-bfcache-history.test.mjs test/integration/guard-bfcache-review.test.mjs test/integration/guard-bfcache-quarantine.test.mjs test/integration/guard-error-page-navigation.test.mjs test/integration/guard-error-page-events.test.mjs test/integration/guard-error-page-reload.test.mjs test/integration/guard-close-protected.test.mjs test/integration/guard-close-protected-shapes.test.mjs test/integration/guard-close-protected-shapes-chrome.test.mjs test/integration/guard-credential-export.test.mjs test/integration/guard-protected-parent-iframes.test.mjs test/integration/guard-protected-parent-iframes-chrome.test.mjs test/integration/guard-error-frame-class.test.mjs test/integration/guard-sign-in-hold.test.mjs test/integration/guard-cookie-plant-chrome.test.mjs test/integration/guard-cookie-plant.test.mjs test/integration/guard-protected-parent-page.test.mjs test/integration/guard-protected-parent-page-chrome.test.mjs test/integration/guard-world-paint.test.mjs test/integration/gates.test.mjs test/integration/validate.test.mjs test/integration/validate-guard-stock-setup.test.mjs test/integration/validate-guard-explicit.test.mjs test/integration/go.test.mjs test/integration/cargo.test.mjs test/integration/workflows.test.mjs test/integration/guard-refusable-nav.test.mjs test/integration/guard-protected-worker.test.mjs test/integration/guard-protected-worker-chrome-narrow.test.mjs test/integration/guard-protected-worker-chrome-hide.test.mjs test/integration/guard-protected-worker-chrome-hide-cut.test.mjs test/integration/guard-protected-worker-chrome-admit.test.mjs test/integration/guard-protected-worker-chrome-late.test.mjs test/integration/guard-protected-worker-chrome-rewrite.test.mjs test/integration/guard-protected-worker-chrome-rewrite-late.test.mjs test/integration/guard-sweep-union.test.mjs test/integration/guard-explicit-attach-chrome.test.mjs && node --test --test-concurrency=2 test/integration/guard-lifecycle.test.mjs test/integration/chromium-launch.test.mjs test/integration/guard-fit.test.mjs test/integration/guard-chain.test.mjs test/integration/guard-validation.test.mjs test/integration/guard-liveness.test.mjs test/integration/guard-observations.test.mjs test/integration/guard-child-latency.test.mjs test/integration/guard-child-latency-stress.test.mjs test/integration/guard-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.test.mjs test/integration/guard-cookie-plant-raw-leg.test.mjs test/integration/guard-cookie-plant-deletion.test.mjs test/integration/guard-cookie-plant-attach.test.mjs test/integration/guard-cookie-plant-attach-retry.test.mjs test/integration/guard-cookie-plant-open-commit.test.mjs test/integration/guard-cookie-plant-legacy-setup.test.mjs test/integration/guard-legs.test.mjs test/integration/guard-fetch-enable.test.mjs test/integration/guard-diagnostics.test.mjs test/integration/guard-chrome.test.mjs test/integration/guard-worlds.test.mjs test/integration/guard-world-discovery.test.mjs test/integration/guard-world-guesses.test.mjs test/integration/guard-unparseable.test.mjs test/integration/guard-redirect-secret.test.mjs test/integration/guard-error-page.test.mjs test/integration/guard-error-page-enable.test.mjs test/integration/guard-discovery.test.mjs test/integration/guard-bfcache-chrome.test.mjs test/integration/guard-bfcache-ownership-probe.test.mjs test/integration/guard-browser-page.test.mjs test/integration/guard-scales.test.mjs test/integration/guard-shared-log.test.mjs test/integration/guard-pre-beacon.test.mjs test/integration/guard-world-pause.test.mjs test/integration/guard-reveal-overlap.test.mjs test/integration/guard-extension-frame-cast.test.mjs test/integration/guard-extension-frame-mouse.test.mjs test/integration/guard-extension-frame-click.test.mjs test/integration/guard-extension-frame-key.test.mjs test/integration/guard-extension-frame-attach.test.mjs test/integration/guard-extension-frames.test.mjs test/integration/guard-stock-setup.test.mjs test/integration/guard-explicit-attach.test.mjs test/integration/guard-explicit-order.test.mjs test/integration/guard-stock-attack.test.mjs test/integration/guard-parallel.test.mjs test/integration/guard-client-exit.test.mjs test/integration/guard-runner-record.test.mjs test/integration/guard-runner.test.mjs test/integration/guard-error-legs.test.mjs test/integration/guard-sweep-ordinary.test.mjs test/integration/guard-sweep-seven.test.mjs test/integration/guard-sweep-vault.test.mjs test/integration/guard-sweep-vault-x.test.mjs test/integration/guard-sweep-apex.test.mjs test/integration/guard-sweep-idp.test.mjs test/integration/guard-sweep-others.test.mjs test/integration/guard-browser-storage.test.mjs test/integration/guard-control-premises.test.mjs test/integration/guard-control-probe-failure.test.mjs test/integration/guard-kept-origins.test.mjs",
83
83
  "test:unit": "mkdir -p coverage/unit && node --experimental-test-coverage --test --test-concurrency=1 --test-reporter=lcov --test-reporter-destination=coverage/unit/lcov.info test/unit/*.test.mjs && go test -race -cover ./...",
84
84
  "build": "go build ./... && cargo build --all-features && cargo build --target wasm32-wasip1 --all-features && npm pack --dry-run",
85
85
  "prepublishOnly": "node scripts/set-crate-version.mjs \"$npm_package_version\"",
@@ -90,7 +90,7 @@
90
90
  "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"
91
91
  },
92
92
  "devDependencies": {
93
- "@ai-ecoverse/slicc-cdp": "2.2.0",
93
+ "@ai-ecoverse/slicc-cdp": "2.2.1",
94
94
  "@ai-ecoverse/slicc-shared-web": "2.18.0",
95
95
  "@biomejs/biome": "2.6.8",
96
96
  "ajv": "8.20.0",
package/protected.json CHANGED
@@ -1393,5 +1393,82 @@
1393
1393
  "key": "",
1394
1394
  "protected": false
1395
1395
  }
1396
+ ],
1397
+ "kept": [
1398
+ { "url": "https://lease-pilot.sliccy.ai/", "kept": true },
1399
+ { "url": "https://lease-pilot.sliccy.ai", "kept": true },
1400
+ { "url": "https://lease-pilot.sliccy.ai/os/x", "kept": true },
1401
+ { "url": "https://lease-pilot.sliccy.ai/auth/callback", "kept": true },
1402
+ { "url": "https://lease-pilot.sliccy.ai/os/x/y/z/deep/path/index.html", "kept": true },
1403
+ { "url": "https://lease-pilot.sliccy.ai/?x=1&y=2", "kept": true },
1404
+ { "url": "https://lease-pilot.sliccy.ai/#x", "kept": true },
1405
+ { "url": "HTTPS://LEASE-PILOT.SLICCY.AI/", "kept": true },
1406
+ { "url": "https://lease-pilot.sliccy.ai./", "kept": true },
1407
+ { "url": "https://user:secret@lease-pilot.sliccy.ai/", "kept": true },
1408
+ { "url": "https://lease-pilot.sliccy.ai:443/", "kept": true },
1409
+ { "url": "https://lease-pilot%2Esliccy.ai/", "kept": true },
1410
+ { "url": "https://lease-pilot.sliccy.ai/", "kept": true },
1411
+ { "url": "https://lease-pilot.sliccy.ai:8443/", "kept": false },
1412
+ { "url": "https://lease-pilot.sliccy.ai:80/", "kept": false },
1413
+ { "url": "http://lease-pilot.sliccy.ai/", "kept": false },
1414
+ { "url": "http://lease-pilot.sliccy.ai:80/", "kept": false },
1415
+ { "url": "https://a.lease-pilot.sliccy.ai/", "kept": false },
1416
+ { "url": "https://a.b.lease-pilot.sliccy.ai/", "kept": false },
1417
+ { "url": "https://lease-pilot.sliccy.ai.example/", "kept": false },
1418
+ { "url": "https://lease-pilot-sliccy.ai/", "kept": false },
1419
+ { "url": "https://notsliccy.ai/", "kept": false },
1420
+ { "url": "https://lease-pilot.sliccy.aix/", "kept": false },
1421
+ { "url": "https://lease-pilot.sliccy.ai@example.com/", "kept": false },
1422
+ { "url": "wss://lease-pilot.sliccy.ai/", "kept": false },
1423
+ { "url": "ftp://lease-pilot.sliccy.ai/", "kept": false },
1424
+ { "url": "https://sliccy.ai/", "kept": false },
1425
+ { "url": "https://seven.sliccy.ai/", "kept": false },
1426
+ { "url": "https://www.sliccy.ai/", "kept": false },
1427
+ { "url": "https://vault.sliccy.ai/", "kept": false },
1428
+ { "url": "blob:https://lease-pilot.sliccy.ai/x", "kept": false },
1429
+ { "url": "view-source:https://lease-pilot.sliccy.ai/", "kept": false },
1430
+ { "url": "https://lease-pilot.sliccy.ai:99999/", "kept": false }
1431
+ ],
1432
+ "keptTargets": [
1433
+ { "url": "about:blank", "contextOrigin": "https://lease-pilot.sliccy.ai", "kept": true },
1434
+ {
1435
+ "url": "about:blank",
1436
+ "contextOrigin": "https://lease-pilot.sliccy.ai",
1437
+ "opener": "protected",
1438
+ "kept": true
1439
+ },
1440
+ {
1441
+ "url": "about:blank",
1442
+ "contextOrigin": "https://lease-pilot.sliccy.ai",
1443
+ "opener": "unprotected",
1444
+ "kept": true
1445
+ },
1446
+ {
1447
+ "url": "about:blank",
1448
+ "contextOrigin": "https://lease-pilot.sliccy.ai",
1449
+ "previous": true,
1450
+ "kept": true
1451
+ },
1452
+ { "url": "about:blank", "contextOrigin": "https://lease-pilot.sliccy.ai:8443", "kept": false },
1453
+ { "url": "about:blank", "contextOrigin": "http://lease-pilot.sliccy.ai", "kept": false },
1454
+ { "url": "about:blank", "contextOrigin": "https://a.lease-pilot.sliccy.ai", "kept": false },
1455
+ { "url": "about:blank", "contextOrigin": "https://seven.sliccy.ai", "kept": false },
1456
+ { "url": "about:blank", "contextOrigin": "https://example.com", "kept": false },
1457
+ { "url": "about:blank", "contextOrigin": "https://lease-pilot.sliccy.ai/", "kept": false },
1458
+ { "url": "about:blank", "contextOrigin": "HTTPS://LEASE-PILOT.SLICCY.AI", "kept": false },
1459
+ { "url": "about:blank", "contextOrigin": "about://", "kept": false },
1460
+ { "url": "about:blank", "contextOrigin": "://", "kept": false },
1461
+ { "url": "about:blank", "kept": false },
1462
+ { "url": "about:blank", "previous": true, "kept": false },
1463
+ { "url": "about:blank", "opener": "protected", "kept": false },
1464
+ { "url": "https://lease-pilot.sliccy.ai/", "kept": true },
1465
+ { "url": "https://lease-pilot.sliccy.ai/os/x", "opener": "unprotected", "kept": true },
1466
+ {
1467
+ "url": "https://seven.sliccy.ai/",
1468
+ "contextOrigin": "https://lease-pilot.sliccy.ai",
1469
+ "kept": false
1470
+ },
1471
+ { "url": "blob:https://lease-pilot.sliccy.ai/x", "kept": false },
1472
+ { "url": "view-source:https://lease-pilot.sliccy.ai/", "kept": false }
1396
1473
  ]
1397
1474
  }
package/protected.mjs CHANGED
@@ -73,6 +73,20 @@ export function protectedOrigins(rules, extraOrigins = []) {
73
73
  origin.toLowerCase().startsWith('about:') &&
74
74
  origin !== 'about://';
75
75
 
76
+ const keptHosts = (rules.keptOrigins ?? [])
77
+ .map((o) => parse(o))
78
+ .filter((u) => u?.host && scheme(u) === 'https' && u.port === '')
79
+ .map(hostOf);
80
+ const keptOrigins = keptHosts.map((h) => `https://${h}`);
81
+
82
+ const kept = (text) => {
83
+ const u = parse(text);
84
+ return u !== null && scheme(u) === 'https' && u.port === '' && keptHosts.includes(hostOf(u));
85
+ };
86
+
87
+ const keptTarget = ({ url: text, contextOrigin }) =>
88
+ inheriting(text) ? keptOrigins.includes(contextOrigin) : kept(text);
89
+
76
90
  const target = ({
77
91
  url: text,
78
92
  previous = false,
@@ -118,7 +132,7 @@ export function protectedOrigins(rules, extraOrigins = []) {
118
132
  return !extra.includes(originOf(u));
119
133
  };
120
134
 
121
- return { url, target, cookieDomain, storageKey, unparseable, extensionFrame };
135
+ return { url, target, kept, keptTarget, cookieDomain, storageKey, unparseable, extensionFrame };
122
136
  }
123
137
 
124
138
  export function credentialOrigins(rules) {
@@ -209,6 +209,12 @@
209
209
  "pattern": "^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?(?:\\.[a-z0-9](?:[a-z0-9-]*[a-z0-9])?)+$"
210
210
  }
211
211
  },
212
+ "keptOrigins": {
213
+ "description": "Exact https origins (scheme and host, no port, path or trailing slash) whose documents are kept. A URL is kept when it parses as https on the default port and its host equals an entry's host, compared case-insensitively with one trailing dot ignored, for any path, query or fragment; userinfo does not change the host, and wrapped URLs (blob:, view-source:) are not kept. An inheriting document (about:blank) is kept when its context origin equals an entry exactly. Every kept origin is also a protected origin. Keeping only narrows and never grants protection: a consumer evaluates protected and kept together, and keeping never changes whether a page is protected. The about:blank case only means something beside the consumer's own context-origin judge. Optional; consumers without a kept notion ignore it.",
214
+ "type": "array",
215
+ "uniqueItems": true,
216
+ "items": { "type": "string", "pattern": "^https://[a-z0-9.-]+$" }
217
+ },
212
218
  "schemes": { "$ref": "#/$defs/schemes", "type": "array", "minItems": 1 },
213
219
  "innerSchemes": { "$ref": "#/$defs/schemes" },
214
220
  "anySchemes": { "$ref": "#/$defs/schemes" },
@@ -85,6 +85,35 @@
85
85
  "protected": { "type": "boolean" }
86
86
  }
87
87
  }
88
+ },
89
+ "kept": {
90
+ "description": "Expected answers of the reference kept judge for a URL. Keeping only narrows and never grants protection: every kept row is also protected, and consumers evaluate protected and kept together.",
91
+ "type": "array",
92
+ "items": {
93
+ "type": "object",
94
+ "additionalProperties": false,
95
+ "required": ["url", "kept"],
96
+ "properties": {
97
+ "url": { "type": "string" },
98
+ "kept": { "type": "boolean" }
99
+ }
100
+ }
101
+ },
102
+ "keptTargets": {
103
+ "description": "Expected answers of the reference kept judge for a target. The about:blank rows only mean something beside the consumer's own context-origin judge; keeping only narrows and never grants protection.",
104
+ "type": "array",
105
+ "items": {
106
+ "type": "object",
107
+ "additionalProperties": false,
108
+ "required": ["url", "kept"],
109
+ "properties": {
110
+ "url": { "type": "string" },
111
+ "contextOrigin": { "type": "string", "minLength": 1 },
112
+ "previous": { "type": "boolean" },
113
+ "opener": { "enum": ["protected", "unprotected", "unknown"] },
114
+ "kept": { "type": "boolean" }
115
+ }
116
+ }
88
117
  }
89
118
  }
90
119
  }