@ai-ecoverse/slicc-browsers 1.50.0 → 1.51.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.
Binary file
@@ -582,7 +582,7 @@
582
582
  "id": "capture.about-lookalike",
583
583
  "op": "capture",
584
584
  "frame": { "url": "about:srcdoc", "securityOrigin": "ABOUT://x" },
585
- "expect": "blank"
585
+ "expect": "allow"
586
586
  },
587
587
  {
588
588
  "id": "capture.extension-hidden",
@@ -1668,10 +1668,10 @@
1668
1668
  "op": "page",
1669
1669
  "page": "about-lookalike",
1670
1670
  "expect": {
1671
- "mixed": true,
1671
+ "mixed": false,
1672
1672
  "frames": {
1673
1673
  "top": { "role": "ordinary", "protected": false, "capture": "allow" },
1674
- "child": { "role": "unparseable", "protected": true, "capture": "blank" }
1674
+ "child": { "role": "ordinary", "protected": false, "capture": "allow" }
1675
1675
  }
1676
1676
  }
1677
1677
  },
@@ -1700,15 +1700,20 @@
1700
1700
  "expect": {
1701
1701
  "result": {
1702
1702
  "frameTree": {
1703
- "frame": { "id": "top", "loaderId": "L1", "url": "https://example.test/page" },
1703
+ "frame": {
1704
+ "id": "top",
1705
+ "loaderId": "L1",
1706
+ "url": "https://example.test/page"
1707
+ },
1704
1708
  "childFrames": [
1705
1709
  {
1706
1710
  "frame": {
1707
1711
  "id": "child",
1708
1712
  "parentId": "top",
1709
1713
  "loaderId": "L2",
1710
- "url": "",
1711
- "securityOrigin": ""
1714
+ "url": "about:blank",
1715
+ "securityOrigin": "://",
1716
+ "name": "withheld"
1712
1717
  }
1713
1718
  }
1714
1719
  ]
@@ -1916,7 +1921,7 @@
1916
1921
  "id": "capture.uppercase-about",
1917
1922
  "op": "capture",
1918
1923
  "frame": { "url": "about:srcdoc", "securityOrigin": "ABOUT://" },
1919
- "expect": "blank"
1924
+ "expect": "allow"
1920
1925
  },
1921
1926
  {
1922
1927
  "id": "capture.ordinary-url-vault-context",
package/engine.mjs CHANGED
@@ -19,6 +19,8 @@ const record = (v) => v !== null && typeof v === 'object' && !Array.isArray(v);
19
19
 
20
20
  function valid(request, result) {
21
21
  switch (request.op) {
22
+ case 'targetClass':
23
+ case 'frameClass':
22
24
  case 'urlClass':
23
25
  return (
24
26
  typeof result?.protected === 'boolean' &&
@@ -89,19 +91,20 @@ function encode(value) {
89
91
  );
90
92
  }
91
93
 
92
- function preserveTargetComparison(request) {
94
+ function preserveFailedURL(request) {
93
95
  if (
94
- request?.op !== 'target' ||
95
- typeof request.url !== 'string' ||
96
- typeof request.unreachableURL !== 'string'
96
+ !['target', 'frame', 'targetClass', 'frameClass'].includes(request?.op) ||
97
+ typeof request.url !== 'string'
97
98
  )
98
99
  return request;
100
+ const failed = request.unreachableURL ?? request.unreachableUrl;
99
101
  if (
100
- request.url !== request.unreachableURL &&
101
- request.url.toWellFormed() === request.unreachableURL.toWellFormed()
102
+ typeof failed !== 'string' ||
103
+ failed === request.url ||
104
+ failed.toWellFormed() !== request.url.toWellFormed()
102
105
  )
103
- return { ...request, unreachableURL: undefined };
104
- return request;
106
+ return request;
107
+ return { ...request, documentURL: undefined };
105
108
  }
106
109
 
107
110
  function binding(module, config) {
@@ -119,8 +122,8 @@ function binding(module, config) {
119
122
  instance ??= create();
120
123
  const wire =
121
124
  request.op === 'batch' && Array.isArray(request.calls)
122
- ? { ...request, calls: request.calls.map(preserveTargetComparison) }
123
- : preserveTargetComparison(request);
125
+ ? { ...request, calls: request.calls.map(preserveFailedURL) }
126
+ : preserveFailedURL(request);
124
127
  const result = exchange(instance, 'engine_call', encode(wire));
125
128
  const ok =
126
129
  request.op === 'batch'
@@ -143,11 +146,15 @@ function binding(module, config) {
143
146
  page: (facts) => call({ ...facts, op: 'page' }),
144
147
  capture: (facts) => call({ ...facts, op: 'capture' }),
145
148
  reply: (facts) => call({ ...facts, op: 'reply' }),
149
+ frame: (facts) => call({ ...facts, op: 'frame' }),
150
+ targetClass: (facts) => call({ ...facts, op: 'targetClass' }),
151
+ frameClass: (facts) => call({ ...facts, op: 'frameClass' }),
146
152
  kept: (url) => call({ op: 'kept', url }),
147
153
  keptTarget: (facts) => call({ ...facts, op: 'keptTarget' }),
148
154
  unparseable: (url) => call({ op: 'unparseable', url }),
149
155
  cookieDomain: (domain) => call({ op: 'cookieDomain', domain }),
150
156
  storageKey: (key) => call({ op: 'storageKey', key }),
157
+ foreignWorld: (origin) => call({ op: 'foreignWorld', origin }),
151
158
  extensionFrame: (url) => call({ op: 'extensionFrame', url }),
152
159
  har: (url) => call({ op: 'har', url }),
153
160
  zoneHost: (host) => call({ op: 'zoneHost', host }),
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.50.0",
3
+ "setVersion": "1.51.0",
4
4
  "sources": [
5
5
  {
6
6
  "repo": "ai-ecoverse/slicc-cli",
@@ -2065,9 +2065,9 @@
2065
2065
  "reload": true,
2066
2066
  "blank": true,
2067
2067
  "restored": true,
2068
- "evaluateRefused": true,
2069
- "attachRefused": true,
2070
- "closeRefused": true,
2068
+ "evaluateRefused": false,
2069
+ "attachRefused": false,
2070
+ "closeRefused": false,
2071
2071
  "closed": true,
2072
2072
  "stickyError": true,
2073
2073
  "attachRedacted": true,
@@ -2279,9 +2279,9 @@
2279
2279
  "reload": true,
2280
2280
  "blank": true,
2281
2281
  "restored": true,
2282
- "evaluateRefused": true,
2283
- "attachRefused": true,
2284
- "closeRefused": true,
2282
+ "evaluateRefused": false,
2283
+ "attachRefused": false,
2284
+ "closeRefused": false,
2285
2285
  "closed": true,
2286
2286
  "stickyError": true,
2287
2287
  "attachRedacted": true,
@@ -2493,9 +2493,9 @@
2493
2493
  "reload": true,
2494
2494
  "blank": true,
2495
2495
  "restored": true,
2496
- "evaluateRefused": true,
2497
- "attachRefused": true,
2498
- "closeRefused": true,
2496
+ "evaluateRefused": false,
2497
+ "attachRefused": false,
2498
+ "closeRefused": false,
2499
2499
  "closed": true,
2500
2500
  "stickyError": true,
2501
2501
  "attachRedacted": true,
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@ai-ecoverse/slicc-browsers",
3
- "version": "1.50.0",
3
+ "version": "1.51.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",
@@ -100,6 +100,16 @@ async function framedEvaluate(reader, sessionId, pageUrl, budget, sessions) {
100
100
  );
101
101
  const iframeSession = attached.result.sessionId;
102
102
  sessions.push(iframeSession);
103
+ await reader.send(
104
+ 'Target.setAutoAttach',
105
+ {
106
+ autoAttach: true,
107
+ waitForDebuggerOnStart: false,
108
+ flatten: true,
109
+ filter: [{ type: 'worker' }, { exclude: true }],
110
+ },
111
+ iframeSession
112
+ );
103
113
  await outcome(reader.send('Runtime.runIfWaitingForDebugger', {}, iframeSession));
104
114
  await outcome(reader.send('Page.enable', {}, iframeSession));
105
115
  await outcome(reader.send('Runtime.enable', {}, iframeSession));