@ai-ecoverse/slicc-browsers 1.8.2 → 1.8.3
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/README.md +8 -4
- package/guard-vectors.json +5 -4
- package/package.json +1 -1
- package/schema/guard-vectors.schema.json +6 -2
package/README.md
CHANGED
|
@@ -145,14 +145,14 @@ Every CDP guard runs the vectors in `guard-vectors.json` (schema `schema/guard-v
|
|
|
145
145
|
- `C5.continue-request` and `C5.continue-response`, added next to `C5.document`;
|
|
146
146
|
- the `C8` rows for privileged pages: `C8.navigate` (a page navigates to `chrome://settings`, `chrome://password-manager`, an extension page or `file:///`; refused), `C8.view-source` (the same through `view-source:`; refused), `C8.create` (`Target.createTarget` straight on those pages; refused), `C8.browser-ui-listed` (`Target.getTargets` lists no `browser_ui` target) and `C8.browser-ui-attach` (`Target.attachToTarget` by a `browser_ui` target's id; refused). All four have an unguarded control, since the guard refuses them only on the privileged target. Two cases aren't rows, because Chrome itself blocks them, so an unguarded client can't tell a guard from none: a page's `window.open('chrome://settings')`, and an `about:` alias such as `about:settings`, which `Page.navigate` and `Target.createTarget` both turn into `about:blank#blocked`. The `about:` aliases are in `protected.json` instead.
|
|
147
147
|
|
|
148
|
-
The `C8.newtab` reachability control attaches through the guard to a settled ordinary new tab, including its internal frames, then navigates that same tab to an ordinary document. Both legs must succeed, including without a guard. It uses the default browser context, since an incognito new tab omits the ordinary new tab's internal frames. It covers `chrome://newtab/` and directly opened `chrome://new-tab-page/`.
|
|
148
|
+
The `C8.newtab` reachability control attaches through the guard to a settled ordinary new tab, including its internal frames, then navigates that same tab to an ordinary document. Both legs must succeed, including without a guard. It requires `chromeUrlsAttach`, so an extension transport reports it as `skip` with `not-supported:chromeUrlsAttach`. The other C8 rows expect a refusal on the guarded leg and run their controls unguarded, so they don't require it and still run on extension transports. It uses the default browser context, since an incognito new tab omits the ordinary new tab's internal frames. It covers `chrome://newtab/` and directly opened `chrome://new-tab-page/`.
|
|
149
149
|
|
|
150
150
|
**Top level.**
|
|
151
151
|
- `schemaVersion` (1): guards pin it.
|
|
152
152
|
- `setVersion`: the package version. The release flow stamps it into the npm package and the crate (`scripts/set-crate-version.mjs`). In git, and so in the Go module, it reads `0.0.0`; Go code gets the version from the module.
|
|
153
153
|
- `targets`: the names a runner maps to a scheme, host and port: `seven`, `vault`, `vault-x` (a vault branch preview), `apex`, `own` (the client page's origin, `{client}`), `ordinary`, `ordinary-same-site`, `chrome-newtab`, `chrome-new-tab-page`, `chrome-settings`, `chrome-passwords`, `chrome-extension-page` and `file-root`. Each has a `description` and, for the protected ones, a default `host`. `chrome-newtab` (`chrome://newtab/`), `chrome-new-tab-page` (`chrome://new-tab-page/`), `chrome-settings` (`chrome://settings/`), `chrome-passwords` (`chrome://password-manager/`), `chrome-extension-page` (a page of Chrome's built-in PDF viewer extension) and `file-root` (`file:///`) carry a `url`, which the runner uses unless `targets` maps the name to something else. No other URL in the file is one a runner must use.
|
|
154
154
|
- `variants`: the detach variants in ms. `prompt` and `lagging` are documented; a runner may add others, such as `lagging-8s`, and reports the name it ran.
|
|
155
|
-
- `capabilities`: what a transport may lack. `autoAttach` covers `Target.setAutoAttach`, `children` steps and child sessions; `browserSession` covers calls on the browser session; `browserContexts` covers `Target.createBrowserContext` and `Target.disposeBrowserContext`.
|
|
155
|
+
- `capabilities`: what a transport may lack. `autoAttach` covers `Target.setAutoAttach`, `children` steps and child sessions; `browserSession` covers calls on the browser session; `browserContexts` covers `Target.createBrowserContext` and `Target.disposeBrowserContext`; `chromeUrlsAttach` means the transport can attach to and drive `chrome://` pages. CDP over a DevTools port can; `chrome.debugger` can't, since Chrome refuses it every `chrome://` page, even with `--extensions-on-chrome-urls`.
|
|
156
156
|
- `placeholders`: every `{name}` used in the vectors, with what it stands for. `{client}` is the client page's origin, which the runner maps.
|
|
157
157
|
|
|
158
158
|
**A vector** has:
|
|
@@ -168,7 +168,7 @@ The `C8.newtab` reachability control attaches through the guard to a settled ord
|
|
|
168
168
|
- `skip?` (`target`, `reason`): `reason` starts with a code, as in `not-applicable: …`.
|
|
169
169
|
|
|
170
170
|
**Steps** are declarative and transport-neutral. Any step can take `on` (`control` or `guarded`), which runs it on that leg only.
|
|
171
|
-
Any `cdp`, `page` or `children` step can take `requires`, the capabilities it needs: `autoAttach` for `Target.setAutoAttach`, `children` and `session: "child"`, `browserSession` for `session: "browser"`,
|
|
171
|
+
Any `cdp`, `page` or `children` step can take `requires`, the capabilities it needs: `autoAttach` for `Target.setAutoAttach`, `children` and `session: "child"`, `browserSession` for `session: "browser"`, `browserContexts` for `Target.createBrowserContext` and `Target.disposeBrowserContext`, and `chromeUrlsAttach` for a step that must attach to a `chrome://` page to pass.
|
|
172
172
|
- `{ "cdp": method, "params"?, "session"?, "as"?, "refusable"?, "refusal"? }`: a CDP call. It runs on the page session by default, on the browser with `browser`, on either with `page-or-browser` (the driver uses the page session), or on the current auto-attached target with `child`. `as` names its outcome. `refusable: true` with `refusal: { "match" }` (a regular expression for the error message or code) marks a call that a guard may refuse at registration.
|
|
173
173
|
- `{ "page": action, … }`:
|
|
174
174
|
- `tab`: a new tab at `url`, in `context`, which becomes the page. `background` defaults to `true`;
|
|
@@ -280,7 +280,10 @@ The optional `close` releases the row's clients; release pooled browsers after
|
|
|
280
280
|
browser-wide settings. Without a factory execution is serial. Cookie and storage
|
|
281
281
|
rows use fresh browser contexts when `capabilities.browserContexts` is true;
|
|
282
282
|
otherwise they run serially. `capabilities` is an object of booleans or an array
|
|
283
|
-
of supported names
|
|
283
|
+
of supported names, and a capability that isn't declared is unsupported: a CDP
|
|
284
|
+
transport over a DevTools port declares `chromeUrlsAttach: true`, and an
|
|
285
|
+
extension on `chrome.debugger` leaves it out, so `C8.newtab` is skipped with
|
|
286
|
+
`not-supported:chromeUrlsAttach`. `capabilities.scope` selects owner-specific rows.
|
|
284
287
|
|
|
285
288
|
Map `ordinary`, `ordinary-same-site`, `seven`, `vault`, `vault-x`, `apex`, `own`
|
|
286
289
|
and `client` to origins. `chrome-newtab`, `chrome-new-tab-page`, `chrome-settings`, `chrome-passwords`, `chrome-extension-page` and `file-root` default to their `url`.
|
|
@@ -411,6 +414,7 @@ const capabilities = {
|
|
|
411
414
|
autoAttach: true,
|
|
412
415
|
browserSession: true,
|
|
413
416
|
browserContexts: true,
|
|
417
|
+
chromeUrlsAttach: true,
|
|
414
418
|
};
|
|
415
419
|
const execution = await run(set, {
|
|
416
420
|
clientFactory: (metadata) => connectGuardAndObserver(metadata),
|
package/guard-vectors.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"schemaVersion": 1,
|
|
3
|
-
"setVersion": "1.8.
|
|
3
|
+
"setVersion": "1.8.3",
|
|
4
4
|
"sources": [
|
|
5
5
|
{
|
|
6
6
|
"repo": "ai-ecoverse/slicc-cli",
|
|
@@ -81,7 +81,8 @@
|
|
|
81
81
|
"capabilities": {
|
|
82
82
|
"autoAttach": "Target.setAutoAttach, the children steps and child sessions",
|
|
83
83
|
"browserSession": "CDP calls on the browser session",
|
|
84
|
-
"browserContexts": "Target.createBrowserContext and Target.disposeBrowserContext"
|
|
84
|
+
"browserContexts": "Target.createBrowserContext and Target.disposeBrowserContext",
|
|
85
|
+
"chromeUrlsAttach": "attaching to and driving chrome:// pages, which CDP over a DevTools port can and chrome.debugger can't"
|
|
85
86
|
},
|
|
86
87
|
"placeholders": {
|
|
87
88
|
"target": "the target's origin; {plain} on the control",
|
|
@@ -12386,7 +12387,7 @@
|
|
|
12386
12387
|
},
|
|
12387
12388
|
"session": "browser",
|
|
12388
12389
|
"as": "attach",
|
|
12389
|
-
"requires": ["browserSession"]
|
|
12390
|
+
"requires": ["browserSession", "chromeUrlsAttach"]
|
|
12390
12391
|
},
|
|
12391
12392
|
{
|
|
12392
12393
|
"page": "navigate",
|
|
@@ -12402,7 +12403,7 @@
|
|
|
12402
12403
|
}
|
|
12403
12404
|
],
|
|
12404
12405
|
"targets": ["chrome-newtab", "chrome-new-tab-page"],
|
|
12405
|
-
"requires": ["browserSession"],
|
|
12406
|
+
"requires": ["browserSession", "chromeUrlsAttach"],
|
|
12406
12407
|
"observe": {
|
|
12407
12408
|
"attached": {
|
|
12408
12409
|
"means": "the guard attached to the settled new tab page",
|
package/package.json
CHANGED
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"capabilities": {
|
|
82
82
|
"type": "object",
|
|
83
83
|
"additionalProperties": false,
|
|
84
|
-
"required": ["autoAttach", "browserSession", "browserContexts"],
|
|
84
|
+
"required": ["autoAttach", "browserSession", "browserContexts", "chromeUrlsAttach"],
|
|
85
85
|
"properties": {
|
|
86
86
|
"autoAttach": {
|
|
87
87
|
"type": "string",
|
|
@@ -94,6 +94,10 @@
|
|
|
94
94
|
"browserContexts": {
|
|
95
95
|
"type": "string",
|
|
96
96
|
"minLength": 1
|
|
97
|
+
},
|
|
98
|
+
"chromeUrlsAttach": {
|
|
99
|
+
"type": "string",
|
|
100
|
+
"minLength": 1
|
|
97
101
|
}
|
|
98
102
|
}
|
|
99
103
|
},
|
|
@@ -117,7 +121,7 @@
|
|
|
117
121
|
},
|
|
118
122
|
"$defs": {
|
|
119
123
|
"capability": {
|
|
120
|
-
"enum": ["autoAttach", "browserSession", "browserContexts"]
|
|
124
|
+
"enum": ["autoAttach", "browserSession", "browserContexts", "chromeUrlsAttach"]
|
|
121
125
|
},
|
|
122
126
|
"requires": {
|
|
123
127
|
"type": "array",
|