@ai-ecoverse/sliccy-browser 0.1.49 → 0.1.50
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 +1 -1
- package/src/protected-origins.js +1 -0
- package/src/protected.js +15 -1
- package/src/version.js +1 -1
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@ai-ecoverse/sliccy-browser",
|
|
3
|
-
"version": "0.1.
|
|
3
|
+
"version": "0.1.50",
|
|
4
4
|
"description": "sliccy:browser for jsh, over CDP. Discovers Chrome via SLICC_CDP_URL, slicc browsers --json, DevToolsActivePort under slicc profiles (live /json/version must match the file's websocket path), then 127.0.0.1:9222. Discovered endpoints refuse seven/vault/extension/error pages; pre-attach websocket frames are dropped with a one-time warning. Holds a dialog session on each tab it attaches to, so a page's alert, confirm or prompt is answered instead of freezing the tab.",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"license": "Apache-2.0",
|
package/src/protected-origins.js
CHANGED
package/src/protected.js
CHANGED
|
@@ -73,6 +73,20 @@ export function protectedOrigins(rules, extraOrigins = []) {
|
|
|
73
73
|
origin.toLowerCase().startsWith('about:') &&
|
|
74
74
|
origin !== 'about://';
|
|
75
75
|
|
|
76
|
+
const keptHosts = (rules.keptOrigins ?? [])
|
|
77
|
+
.map((o) => parse(o))
|
|
78
|
+
.filter((u) => u?.host && scheme(u) === 'https' && u.port === '')
|
|
79
|
+
.map(hostOf);
|
|
80
|
+
const keptOrigins = keptHosts.map((h) => `https://${h}`);
|
|
81
|
+
|
|
82
|
+
const kept = (text) => {
|
|
83
|
+
const u = parse(text);
|
|
84
|
+
return u !== null && scheme(u) === 'https' && u.port === '' && keptHosts.includes(hostOf(u));
|
|
85
|
+
};
|
|
86
|
+
|
|
87
|
+
const keptTarget = ({ url: text, contextOrigin }) =>
|
|
88
|
+
inheriting(text) ? keptOrigins.includes(contextOrigin) : kept(text);
|
|
89
|
+
|
|
76
90
|
const target = ({
|
|
77
91
|
url: text,
|
|
78
92
|
previous = false,
|
|
@@ -118,7 +132,7 @@ export function protectedOrigins(rules, extraOrigins = []) {
|
|
|
118
132
|
return !extra.includes(originOf(u));
|
|
119
133
|
};
|
|
120
134
|
|
|
121
|
-
return { url, target, cookieDomain, storageKey, unparseable, extensionFrame };
|
|
135
|
+
return { url, target, kept, keptTarget, cookieDomain, storageKey, unparseable, extensionFrame };
|
|
122
136
|
}
|
|
123
137
|
|
|
124
138
|
export function credentialOrigins(rules) {
|
package/src/version.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
export const version = '0.1.
|
|
1
|
+
export const version = '0.1.50';
|