@ai-ecoverse/slicc-browsers 1.36.3 → 1.37.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
@@ -161,13 +161,13 @@ slicc-cli's `test/integration/corpus_test.go` is a complete harness.
161
161
  Browser control must never navigate to, open, attach to, or read the cookies or storage of:
162
162
  - **seven and the vault**: every `sliccy.ai` host, on any port and scheme, and `vault.sliccy.ai` by name;
163
163
  - **the browser's own privileged pages**: `chrome://` and the other Chromium browsers' equivalents, `devtools://`, `chrome-extension://` (where password managers and wallets live), `file://`, and Chrome's own UI targets. The new tab page is the one exception;
164
- - **a program's extra seven origins**, such as slicc-cli's `--origin`.
164
+ - **a program's extra seven origins**.
165
165
 
166
166
  URLs are judged the way the browser parses them, so `blob:`, `view-source:` and `about:` aliases, backslashes, encoded dots and full-width letters can't sneak past. A URL the guard can't parse counts as protected wherever the browser might load it. A tab that seven opened keeps seven's origin when it goes to `about:blank`. A refused call fails with `slicc: refused: target is on seven's origin`.
167
167
 
168
- A browser extension's frame inside an ordinary page, such as a password manager's autofill list, doesn't make the tab protected. The frame itself stays out of reach: it 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 own 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 while one became shown is thrown away. Opacity and position don't count as hidden. A race between the visibility or focus check and the CDP reply is accepted. Whole-page captures and starting a screencast are refused while any extension frame is in the tab; an active screencast is stopped or its frames dropped until the frame is gone. These refusals name the extension frame, not seven. A frame from the program's own extension, and any other protected frame, still makes the whole tab protected. `protectedOrigins.extensionFrames` lists the schemes, methods and refusals; `protected.mjs` offers `extensionFrame(url)`.
168
+ A browser extension's frame inside an ordinary page doesn't make the tab protected. The frame itself stays out of reach: it 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 own 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 while one became shown is thrown away. Opacity and position don't count as hidden. A race between the visibility or focus check and the CDP reply is accepted. Whole-page captures and starting a screencast are refused while any extension frame is in the tab; an active screencast is stopped or its frames dropped until the frame is gone. These refusals name the extension frame, not seven. A frame from the program's own extension, and any other protected frame, still makes the whole tab protected. `protectedOrigins.extensionFrames` lists the schemes, methods and refusals; `protected.mjs` offers `extensionFrame(url)`.
169
169
 
170
- `catalog.json`'s `protectedOrigins` holds the rules, and `protected.json` the vectors: URLs, targets, cookie domains and storage keys, each with the expected answer. `protected.mjs` is the reference implementation:
170
+ `catalog.json`'s `protectedOrigins` holds the rules, and `protected.json` the vectors: URLs, targets, cookie domains and storage keys, each with the expected answer. A target may carry `contextOrigin`, its default execution context's origin. `protected.mjs` is the reference implementation:
171
171
 
172
172
  ```js
173
173
  import catalog from '@ai-ecoverse/slicc-browsers' with { type: 'json' };
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "schemaVersion": 1,
3
- "setVersion": "1.36.3",
3
+ "setVersion": "1.37.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.36.3",
3
+ "version": "1.37.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",
package/protected.json CHANGED
@@ -1044,6 +1044,81 @@
1044
1044
  "previous": true,
1045
1045
  "protected": false
1046
1046
  },
1047
+ {
1048
+ "url": "about:blank",
1049
+ "contextOrigin": "://",
1050
+ "protected": false
1051
+ },
1052
+ {
1053
+ "url": "about:blank",
1054
+ "contextOrigin": "about://",
1055
+ "protected": false
1056
+ },
1057
+ {
1058
+ "url": "about:blank",
1059
+ "contextOrigin": "about://",
1060
+ "opener": "protected",
1061
+ "protected": true
1062
+ },
1063
+ {
1064
+ "url": "about:blank",
1065
+ "contextOrigin": "about://",
1066
+ "opener": "unknown",
1067
+ "protected": true
1068
+ },
1069
+ {
1070
+ "url": "about:blank",
1071
+ "contextOrigin": "about://",
1072
+ "previous": true,
1073
+ "protected": true
1074
+ },
1075
+ {
1076
+ "url": "about:settings",
1077
+ "contextOrigin": "about://settings",
1078
+ "protected": true
1079
+ },
1080
+ {
1081
+ "url": "about:srcdoc",
1082
+ "contextOrigin": "about://",
1083
+ "protected": false
1084
+ },
1085
+ {
1086
+ "url": "data:text/html,x",
1087
+ "contextOrigin": "about://",
1088
+ "protected": false
1089
+ },
1090
+ {
1091
+ "url": "about:blank",
1092
+ "contextOrigin": "ABOUT://",
1093
+ "protected": true
1094
+ },
1095
+ {
1096
+ "url": "about:blank",
1097
+ "contextOrigin": "about://x",
1098
+ "protected": true
1099
+ },
1100
+ {
1101
+ "url": "about:blank",
1102
+ "contextOrigin": "about:blank",
1103
+ "protected": true
1104
+ },
1105
+ {
1106
+ "url": "about:blank",
1107
+ "contextOrigin": "https://example.test",
1108
+ "opener": "unprotected",
1109
+ "protected": false
1110
+ },
1111
+ {
1112
+ "url": "about:blank",
1113
+ "contextOrigin": "https://example.test",
1114
+ "opener": "protected",
1115
+ "protected": true
1116
+ },
1117
+ {
1118
+ "url": "about:blank",
1119
+ "contextOrigin": "https://example.test",
1120
+ "protected": false
1121
+ },
1047
1122
  {
1048
1123
  "url": "blob:https://seven.sliccy.ai/0b9e0f6c",
1049
1124
  "protected": true
package/protected.mjs CHANGED
@@ -68,6 +68,11 @@ export function protectedOrigins(rules, extraOrigins = []) {
68
68
  );
69
69
  };
70
70
 
71
+ const lookalike = (origin) =>
72
+ typeof origin === 'string' &&
73
+ origin.toLowerCase().startsWith('about:') &&
74
+ origin !== 'about://';
75
+
71
76
  const target = ({
72
77
  url: text,
73
78
  previous = false,
@@ -76,6 +81,7 @@ export function protectedOrigins(rules, extraOrigins = []) {
76
81
  documentURL,
77
82
  unreachableURL,
78
83
  navigating = false,
84
+ contextOrigin,
79
85
  }) => {
80
86
  if (type && (rules.targetTypes ?? []).includes(type)) return true;
81
87
  if (
@@ -85,7 +91,8 @@ export function protectedOrigins(rules, extraOrigins = []) {
85
91
  !navigating
86
92
  )
87
93
  return previous;
88
- if (inheriting(text)) return previous || opener === 'protected' || opener === 'unknown';
94
+ if (inheriting(text))
95
+ return previous || opener === 'protected' || opener === 'unknown' || lookalike(contextOrigin);
89
96
  return url(text);
90
97
  };
91
98
 
@@ -57,6 +57,7 @@
57
57
  "unreachableURL": { "type": "string" },
58
58
  "navigating": { "type": "boolean" },
59
59
  "opener": { "enum": ["protected", "unprotected", "unknown"] },
60
+ "contextOrigin": { "type": "string" },
60
61
  "protected": { "type": "boolean" }
61
62
  }
62
63
  }