@ai-ecoverse/slicc-browsers 1.49.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.
package/README.md CHANGED
@@ -75,7 +75,7 @@ npm install @ai-ecoverse/slicc-browsers
75
75
  | `./guard-runner`, `./guard-driver.mjs` | the guard vector runner and its helpers |
76
76
  | `./fixture`, `./fixture-client` | the test server (Node only) and a client for a remote one |
77
77
 
78
- Everything except `./fixture` runs in browsers and Node. `protected.mjs` bundles the engine and `seven.mjs` is standalone; neither imports anything. MV3 extensions using the engine need `'wasm-unsafe-eval'` in their extension pages CSP.
78
+ Everything except `./fixture` runs in browsers and Node. `protected.mjs` exports `engine()` and async `loadEngine()` without Web APIs or imports; `seven.mjs` is standalone. MV3 extensions using the engine need `'wasm-unsafe-eval'` in their extension pages CSP.
79
79
 
80
80
  ## Engine
81
81
 
@@ -91,11 +91,11 @@ One rules engine classifies protected origins, targets, cookie domains, storage
91
91
  - **Profiles and platforms**: where SLICC keeps its browser profiles, and the config dirs and registry keys per OS.
92
92
  - **Protected origins**: see [below](#protected-origins).
93
93
 
94
- The catalog is `"schema": 1`. Minor releases only add fields; changing or removing one takes schema 2 and a major release. slicc-cli keeps no browser tables of its own: to add or change a browser, change `catalog.json`, release, and bump the dependency.
94
+ The catalog uses schema 1. Minor releases only add fields; removing or changing fields requires schema 2 and a major release. slicc-cli has no browser tables: change `catalog.json`, release and bump the dependency.
95
95
 
96
96
  ## Discovery
97
97
 
98
- A program lists the browsers it can attach to, from four sources: `DevToolsActivePort` files in known user-data dirs and SLICC profiles, `--cdp` URLs, a port probe, and the process list. It ranks the endpoints, adds the installed browsers it could launch, and prints the list in the shape of [`schema/browsers.schema.json`](schema/browsers.schema.json). Seven's tabs are reported by origin only, never with a path, query or title.
98
+ Discovery ranks browsers from known user-data dirs’ `DevToolsActivePort` files, `--cdp` URLs, a port probe and the process list, and lists installed browsers it can launch. Output follows [`schema/browsers.schema.json`](schema/browsers.schema.json). Seven tabs expose only their origin, never a path, query or title.
99
99
 
100
100
  The process scan finds other programs’ `--remote-debugging-port` browsers; see `discovery.process` and the `process-*` corpus cases.
101
101
 
@@ -147,13 +147,15 @@ slicc-cli's `test/integration/corpus_test.go` is a complete harness.
147
147
  ## Protected origins
148
148
 
149
149
  Browser control must never navigate to, open, attach to, or read cookies or storage of:
150
- - **seven and the vault**: `sliccy.ai` hosts one label deep, bar a few listed ones, over HTTP(S), any port; apex-domain cookies too, not apex or deeper pages. Unprotected pages there read and write them via `document.cookie` and `cookieStore` as in any browser; CDP filtering is defence in depth; SLICC's cookies are host-only;
150
+ - **seven and the vault**: `sliccy.ai` hosts one label deep, bar a few listed ones, over HTTP(S) or WS(S), any port; apex-domain cookies too, not apex or deeper pages. Unprotected pages there read and write them via `document.cookie` and `cookieStore` as in any browser; CDP filtering is defence in depth; SLICC's cookies are host-only;
151
151
  - **the browser's own privileged pages**: `chrome://` and other Chromium browsers' equivalents, `devtools://`, `chrome-extension://` (home to password managers and wallets), `file://` and Chrome's UI targets, bar the new tab page;
152
152
  - **a program's extra seven origins**.
153
153
 
154
- All bindings use the same URL parser and apply the rules after unwrapping URL aliases. An unparseable URL is protected wherever the browser might load it. A tab seven opened keeps seven's origin on `about:blank`. A refused call fails with `slicc: refused: target is on seven's origin`.
154
+ Targets and frames use only their own URL and reported security origin (including inherited origins), never their parent, opener or history; unknown origins alone do not protect a target, but an unparseable URL does. Error documents are ordinary unless the failed URL is unparseable, and a protected failed URL is redacted to its origin. A refused call fails with `slicc: refused: target is on seven's origin`.
155
155
 
156
- An extension frame in an ordinary page doesn't protect the tab. The frame can't be attached or read, and its URL never appears in target discovery, page reads, snapshots, accessibility trees or evaluate results. The tab's page can still be read and snapshotted. Screenshots and input are allowed only while every extension frame is hidden (no layout box or `visibility: hidden`) and none holds focus through nested documents or shadow roots; a screenshot taken as one became shown is dropped. Opacity and position don't count as hidden. A race between that check and the CDP reply is accepted. Whole-page captures and new screencasts are refused while any extension frame is in the tab; an active one is stopped or its frames dropped until the frame is gone. These refusals name the extension frame, not seven. The program's own extension frame, like any other protected frame, still protects the whole tab. `protectedOrigins.extensionFrames` lists the schemes, methods and refusals; `protected.mjs` offers `extensionFrame(url)`.
156
+ The engine withholds protected frames, not their ordinary page. Adapters report any mixed state from capture dispatch to release: screenshots and screencasts show Seven but blank other protected boxes; PDFs needing blanking are refused.
157
+
158
+ Foreign extension frames cannot be attached or read. Their URLs are hidden in discovery, snapshots, accessibility trees and evaluate results; the tab remains readable and can be snapshotted. Screenshots and input require every extension frame to be hidden (no layout box or `visibility: hidden`) and unfocused, including through nested documents or shadow roots. Opacity and position don’t count. Drop screenshots if a frame becomes visible; a race between the check and CDP reply is accepted. While a frame is present, refuse whole-page captures and new screencasts; stop active screencasts or drop their frames. Refusals name the extension frame, not seven. `protectedOrigins.extensionFrames` lists the schemes, methods and refusals; `protected.mjs` offers `extensionFrame(url)`.
157
159
 
158
160
  `catalog.json`’s `protectedOrigins` holds the rules. `protected.json` tests them across bindings. `protected.mjs` exposes the engine synchronously:
159
161
 
@@ -164,7 +166,7 @@ import { protectedOrigins } from '@ai-ecoverse/slicc-browsers/protected.mjs';
164
166
  const guard = protectedOrigins(catalog.protectedOrigins, ['http://127.0.0.1:5710']);
165
167
  guard.url('https://seven.sliccy.ai/');
166
168
  guard.cookieDomain('.sliccy.ai');
167
- guard.target({ url: 'about:blank', opener: 'protected' });
169
+ guard.frame({ url: 'about:blank', securityOrigin: 'https://seven.sliccy.ai' });
168
170
  ```
169
171
 
170
172
  It also offers `storageKey(key)` and `unparseable(text)`.
package/catalog.json CHANGED
@@ -751,7 +751,7 @@
751
751
  "unprotectedLabels": ["get", "mcpcat", "echo", "lease-pilot"]
752
752
  }
753
753
  ],
754
- "schemes": ["https", "http"],
754
+ "schemes": ["https", "http", "ws", "wss"],
755
755
  "innerSchemes": ["blob", "filesystem", "view-source"],
756
756
  "anySchemes": ["devtools"],
757
757
  "protectedSchemes": [
@@ -786,11 +786,19 @@
786
786
  "inheriting": ["about:blank", "about:srcdoc"],
787
787
  "errorPage": {
788
788
  "url": "chrome-error://chromewebdata/",
789
- "target": "previous",
789
+ "target": "ownOrigin",
790
790
  "redact": "origin"
791
791
  },
792
792
  "unparseable": "protected",
793
793
  "unparseableRefusal": "slicc: refused: slicc can't parse this URL, so it could be a protected page",
794
+ "extensionWorlds": {
795
+ "schemes": [
796
+ "chrome-extension",
797
+ "moz-extension",
798
+ "safari-web-extension",
799
+ "ms-browser-extension"
800
+ ]
801
+ },
794
802
  "extensionFrames": {
795
803
  "schemes": ["chrome-extension"],
796
804
  "whenShown": [