@ai-ecoverse/slicc-browsers 1.19.1 → 1.20.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.19.1",
3
+ "version": "1.20.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",
@@ -56,6 +56,8 @@
56
56
  "guard-runner.mjs",
57
57
  "fixture-server.mjs",
58
58
  "extension-world.mjs",
59
+ "extension-frames-rules.mjs",
60
+ "extension-frame.mjs",
59
61
  "unparseable-url.mjs",
60
62
  "protected-error-page.mjs",
61
63
  "redirect-secret.mjs",
@@ -71,7 +73,7 @@
71
73
  "validate": "node scripts/validate.mjs",
72
74
  "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",
73
75
  "format": "biome check --write . && gofmt -w . && cargo fmt",
74
- "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-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-world-paint.test.mjs test/integration/gates.test.mjs test/integration/validate.test.mjs test/integration/go.test.mjs test/integration/cargo.test.mjs test/integration/workflows.test.mjs test/integration/guard-sweep-union.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-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.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-discovery.test.mjs test/integration/guard-bfcache-chrome.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-parallel.test.mjs test/integration/guard-client-exit.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-others.test.mjs",
76
+ "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-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-world-paint.test.mjs test/integration/gates.test.mjs test/integration/validate.test.mjs test/integration/go.test.mjs test/integration/cargo.test.mjs test/integration/workflows.test.mjs test/integration/guard-sweep-union.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-adoption.test.mjs test/integration/guard-scoping.test.mjs test/integration/guard-late-pause.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-discovery.test.mjs test/integration/guard-bfcache-chrome.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-frames.test.mjs test/integration/guard-parallel.test.mjs test/integration/guard-client-exit.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-others.test.mjs",
75
77
  "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 ./...",
76
78
  "build": "go build ./... && cargo build --all-features && cargo build --target wasm32-wasip1 --all-features && npm pack --dry-run",
77
79
  "prepublishOnly": "node scripts/set-crate-version.mjs \"$npm_package_version\"",
@@ -79,10 +81,10 @@
79
81
  "trust:dry": "npx fledgling sync --dry-run -y --skip-publish",
80
82
  "release": "semantic-release",
81
83
  "test:unit:redirect": "mkdir -p coverage/unit && node --experimental-test-coverage --test --test-concurrency=1 --test-coverage-include=redirect-secret.mjs --test-coverage-include=redirect-fragments.mjs --test-reporter=lcov --test-reporter-destination=coverage/unit/redirect.lcov test/unit/guard-redirect-*.test.mjs && slicc-diff-cover coverage/unit/redirect.lcov",
82
- "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=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=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"
84
+ "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=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"
83
85
  },
84
86
  "devDependencies": {
85
- "@ai-ecoverse/slicc-cdp": "1.45.0",
87
+ "@ai-ecoverse/slicc-cdp": "1.45.2",
86
88
  "@ai-ecoverse/slicc-shared-web": "2.13.10",
87
89
  "@biomejs/biome": "2.6.3",
88
90
  "ajv": "8.20.0",
package/protected.mjs CHANGED
@@ -105,5 +105,11 @@ export function protectedOrigins(rules, extraOrigins = []) {
105
105
  );
106
106
  };
107
107
 
108
- return { url, target, cookieDomain, storageKey, unparseable };
108
+ const extensionFrame = (text) => {
109
+ const u = parse(text);
110
+ if (!u || !(rules.extensionFrames?.schemes ?? []).includes(scheme(u))) return false;
111
+ return !extra.includes(originOf(u));
112
+ };
113
+
114
+ return { url, target, cookieDomain, storageKey, unparseable, extensionFrame };
109
115
  }
@@ -187,6 +187,7 @@
187
187
  "inheriting",
188
188
  "unparseable",
189
189
  "unparseableRefusal",
190
+ "extensionFrames",
190
191
  "refusal"
191
192
  ],
192
193
  "properties": {
@@ -241,6 +242,18 @@
241
242
  "unparseableRefusal": {
242
243
  "const": "slicc: refused: slicc can't parse this URL, so it could be a protected page"
243
244
  },
245
+ "extensionFrames": {
246
+ "type": "object",
247
+ "additionalProperties": false,
248
+ "required": ["schemes", "whenShown", "whilePresent", "shownRefusal", "presentRefusal"],
249
+ "properties": {
250
+ "schemes": { "$ref": "#/$defs/schemes", "type": "array", "minItems": 1 },
251
+ "whenShown": { "$ref": "#/$defs/methods" },
252
+ "whilePresent": { "$ref": "#/$defs/methods" },
253
+ "shownRefusal": { "type": "string", "pattern": "^slicc: refused: " },
254
+ "presentRefusal": { "type": "string", "pattern": "^slicc: refused: " }
255
+ }
256
+ },
244
257
  "refusal": { "$ref": "#/$defs/name" }
245
258
  }
246
259
  },
@@ -347,6 +360,12 @@
347
360
  "uniqueItems": true,
348
361
  "items": { "type": "string", "pattern": "^[a-z][a-z0-9+.-]*$" }
349
362
  },
363
+ "methods": {
364
+ "type": "array",
365
+ "minItems": 1,
366
+ "uniqueItems": true,
367
+ "items": { "type": "string", "pattern": "^[A-Z][A-Za-z]*\\.[a-z][A-Za-z]*$" }
368
+ },
350
369
  "id": { "type": "string", "pattern": "^[a-z0-9]+(-[a-z0-9]+)*$" },
351
370
  "segments": {
352
371
  "description": "A relative path, one segment per item.",
@@ -87,6 +87,7 @@
87
87
  "browserContexts",
88
88
  "chromeUrlsAttach",
89
89
  "extensionWorld",
90
+ "extensionFrame",
90
91
  "discovery",
91
92
  "clientExit",
92
93
  "siteIsolationOff",
@@ -106,6 +107,7 @@
106
107
  "minLength": 1
107
108
  },
108
109
  "extensionWorld": { "type": "string", "minLength": 1 },
110
+ "extensionFrame": { "type": "string", "minLength": 1 },
109
111
  "discovery": { "type": "string", "minLength": 1 },
110
112
  "chromeUrlsAttach": {
111
113
  "type": "string",
@@ -143,6 +145,7 @@
143
145
  "browserContexts",
144
146
  "chromeUrlsAttach",
145
147
  "extensionWorld",
148
+ "extensionFrame",
146
149
  "discovery",
147
150
  "clientExit",
148
151
  "siteIsolationOff",
@@ -520,6 +523,32 @@
520
523
  }
521
524
  }
522
525
  },
526
+ {
527
+ "type": "object",
528
+ "additionalProperties": false,
529
+ "required": ["extensionFrame", "as", "requires"],
530
+ "properties": {
531
+ "extensionFrame": {
532
+ "enum": [
533
+ "hidden",
534
+ "concealed",
535
+ "offscreen",
536
+ "shown",
537
+ "transparent",
538
+ "revealed",
539
+ "nested",
540
+ "focused",
541
+ "cast"
542
+ ]
543
+ },
544
+ "as": {
545
+ "$ref": "#/$defs/name"
546
+ },
547
+ "requires": {
548
+ "$ref": "#/$defs/requires"
549
+ }
550
+ }
551
+ },
523
552
  {
524
553
  "type": "object",
525
554
  "additionalProperties": false,