@wenathlan/extension 1.1.60 → 1.1.61
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 +4 -3
- package/dist/immutablelog.d.ts +73 -0
- package/dist/immutablelog.d.ts.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +534 -1
- package/dist/index.js.map +4 -4
- package/dist/maskinputs.d.ts +52 -0
- package/dist/maskinputs.d.ts.map +1 -0
- package/dist/memory.d.ts +65 -1
- package/dist/memory.d.ts.map +1 -1
- package/dist/originpolicy.d.ts +150 -0
- package/dist/originpolicy.d.ts.map +1 -0
- package/dist/policy.d.ts +56 -1
- package/dist/policy.d.ts.map +1 -1
- package/dist/protocol.d.ts +76 -1
- package/dist/protocol.d.ts.map +1 -1
- package/dist/types.d.ts +146 -2
- package/dist/types.d.ts.map +1 -1
- package/dist/version.d.ts +1 -1
- package/extension/dist/background.js +715 -51
- package/extension/dist/background.js.map +4 -4
- package/extension/dist/manifest.json +1 -1
- package/extension/dist/pagebridge.js +91 -28
- package/extension/dist/pagebridge.js.map +3 -3
- package/extension/dist/popup.html +1 -1
- package/extension/dist/popup.js +39 -0
- package/extension/dist/popup.js.map +2 -2
- package/extension/dist/sidepanel.html +1 -1
- package/extension/dist/sidepanel.js +279 -0
- package/extension/dist/sidepanel.js.map +4 -4
- package/extension/manifest.json +1 -1
- package/package.json +1 -1
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
"manifest_version": 3,
|
|
3
3
|
"key": "MIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAnOEjO8Z0PDgQyfvawGcaO2j+o0GLCFTLNj7TkYC/Avo9l2NenMRq7gp90Nfd7E9MViv/OMcCKSYZ5unv12QPRtv31C+a5UQWDFAOP/cH5mwMd6hsayElrSoW8ta+FwFqmr9dIFkn7cQEU3YhZr4Gcbs+ycUHOxVgDA4NBKB0rQ6e9VW5LvTw0isRYUrqM+M72vKxHk9zUIYYn/LGPvottKBYi2GLr0PHSeC2UE+Shmq7vcFIXj6hDjvD4kLJ5sKoUllEcZ1TPuBcnHUQ9ndKA5iktXDQOIJCUJmi7a0YJ2PGg7fvpYfT9k0ai/qZ+pIoRfoOEwE01bPoDn7NjeYnNQIDAQAB",
|
|
4
4
|
"name": "Devthink",
|
|
5
|
-
"version": "1.1.
|
|
5
|
+
"version": "1.1.61",
|
|
6
6
|
"description": "A consent-first bridge for reviewed browser-agent tasks.",
|
|
7
7
|
"permissions": [
|
|
8
8
|
"activeTab",
|
|
@@ -1,35 +1,56 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
(() => {
|
|
3
|
-
//
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
const
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
if (
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
return { url, line, ...column !== void 0 ? { column } : {}, ...condition !== void 0 ? { condition } : {} };
|
|
3
|
+
// maskinputs.ts
|
|
4
|
+
var maskmarker = "[redacted]";
|
|
5
|
+
function fieldshapekind(name) {
|
|
6
|
+
const lowered = name.toLowerCase();
|
|
7
|
+
if (lowered.includes("password") || lowered.includes("passwd") || lowered.includes("pwd") || lowered.includes("passphrase")) return "password";
|
|
8
|
+
if (lowered.includes("token") || lowered.includes("apikey") || lowered.includes("api_key") || lowered.includes("auth") || lowered.includes("bearer")) return "token";
|
|
9
|
+
if (lowered.includes("card") || lowered.includes("cvc") || lowered.includes("cvv") || lowered.includes("expiry") || lowered.includes("pan")) return "card";
|
|
10
|
+
if (lowered.includes("secret")) return "secret";
|
|
11
|
+
return void 0;
|
|
13
12
|
}
|
|
14
|
-
function
|
|
15
|
-
|
|
16
|
-
|
|
13
|
+
function maskingfield(name, shapes) {
|
|
14
|
+
if (fieldshapekind(name) !== void 0) return true;
|
|
15
|
+
const lowered = name.toLowerCase();
|
|
16
|
+
return shapes.some((shape) => shape !== "" && lowered.includes(shape));
|
|
17
|
+
}
|
|
18
|
+
function maskvalue(value) {
|
|
19
|
+
return value === "" ? "" : maskmarker;
|
|
20
|
+
}
|
|
21
|
+
function maskfield(input) {
|
|
22
|
+
return maskingfield(input.name, input.shapes) ? maskvalue(input.value) : input.value;
|
|
23
|
+
}
|
|
24
|
+
function maskrecord(record, shapes) {
|
|
25
|
+
const masked = {};
|
|
26
|
+
for (const [key, value] of Object.entries(record)) {
|
|
27
|
+
if (typeof value === "string") {
|
|
28
|
+
const sibling = record.name;
|
|
29
|
+
masked[key] = key === "value" && typeof sibling === "string" ? maskfield({ name: sibling, value, shapes }) : maskfield({ name: key, value, shapes });
|
|
30
|
+
} else if (Array.isArray(value)) masked[key] = value.map((item) => Boolean(item) && typeof item === "object" && !Array.isArray(item) ? maskrecord(item, shapes) : item);
|
|
31
|
+
else if (Boolean(value) && typeof value === "object") masked[key] = maskrecord(value, shapes);
|
|
32
|
+
else masked[key] = value;
|
|
33
|
+
}
|
|
34
|
+
return masked;
|
|
35
|
+
}
|
|
36
|
+
function masktypedvalues(input) {
|
|
37
|
+
const sensitive = maskingfield(input.step.target ?? "", input.shapes) || maskingfield(input.step.kind, input.shapes);
|
|
38
|
+
const maskedvalue = input.step.value !== void 0 && sensitive ? maskvalue(input.step.value) : input.step.value;
|
|
39
|
+
let maskedoptions = input.step.options;
|
|
40
|
+
if (input.step.options !== void 0) {
|
|
41
|
+
try {
|
|
42
|
+
const parsed = JSON.parse(input.step.options);
|
|
43
|
+
if (Boolean(parsed) && typeof parsed === "object" && !Array.isArray(parsed)) maskedoptions = JSON.stringify(maskrecord(parsed, input.shapes));
|
|
44
|
+
} catch {
|
|
45
|
+
}
|
|
46
|
+
}
|
|
47
|
+
return { ...maskedvalue !== void 0 ? { value: maskedvalue } : {}, ...maskedoptions !== void 0 ? { options: maskedoptions } : {} };
|
|
17
48
|
}
|
|
18
|
-
function
|
|
19
|
-
|
|
20
|
-
const entry = value;
|
|
21
|
-
const expression = typeof entry.expression === "string" && entry.expression.trim() ? entry.expression.trim() : void 0;
|
|
22
|
-
if (expression === void 0) return void 0;
|
|
23
|
-
const scope = typeof entry.scope === "string" && entry.scope.trim() ? entry.scope.trim() : "topframe";
|
|
24
|
-
return { expression, scope };
|
|
49
|
+
function maskformstate(fields, shapes) {
|
|
50
|
+
return fields.map((field) => ({ ...field, value: maskfield({ name: field.name, value: field.value, shapes }) }));
|
|
25
51
|
}
|
|
26
|
-
function
|
|
27
|
-
|
|
28
|
-
const entry = value;
|
|
29
|
-
const urlpattern = typeof entry.urlpattern === "string" && entry.urlpattern.trim() ? entry.urlpattern.trim() : void 0;
|
|
30
|
-
const source = typeof entry.source === "string" ? entry.source : void 0;
|
|
31
|
-
if (urlpattern === void 0 || source === void 0 || source.trim().length === 0) return void 0;
|
|
32
|
-
return { urlpattern, source };
|
|
52
|
+
function maskobservation(shot, shapes) {
|
|
53
|
+
return { ...shot, forms: shot.forms.map((form) => maskingfield(form.name, shapes) ? { ...form, options: [maskmarker] } : form) };
|
|
33
54
|
}
|
|
34
55
|
|
|
35
56
|
// emulation.ts
|
|
@@ -132,6 +153,38 @@
|
|
|
132
153
|
return walk(0, 0);
|
|
133
154
|
}
|
|
134
155
|
|
|
156
|
+
// cdpbus.ts
|
|
157
|
+
function breakpointinputof(value) {
|
|
158
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
159
|
+
const entry = value;
|
|
160
|
+
const url = typeof entry.url === "string" && entry.url.trim() ? entry.url.trim() : void 0;
|
|
161
|
+
const line = typeof entry.line === "number" && Number.isInteger(entry.line) && entry.line >= 0 ? entry.line : void 0;
|
|
162
|
+
if (url === void 0 || line === void 0) return void 0;
|
|
163
|
+
const column = typeof entry.column === "number" && Number.isInteger(entry.column) && entry.column >= 0 ? entry.column : void 0;
|
|
164
|
+
const condition = typeof entry.condition === "string" && entry.condition.trim() ? entry.condition.trim() : void 0;
|
|
165
|
+
return { url, line, ...column !== void 0 ? { column } : {}, ...condition !== void 0 ? { condition } : {} };
|
|
166
|
+
}
|
|
167
|
+
function stepmodeof(value) {
|
|
168
|
+
const modes = ["stepover", "stepinto", "stepout", "resume"];
|
|
169
|
+
return typeof value === "string" && modes.includes(value) ? value : void 0;
|
|
170
|
+
}
|
|
171
|
+
function watchexpressionof(value) {
|
|
172
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
173
|
+
const entry = value;
|
|
174
|
+
const expression = typeof entry.expression === "string" && entry.expression.trim() ? entry.expression.trim() : void 0;
|
|
175
|
+
if (expression === void 0) return void 0;
|
|
176
|
+
const scope = typeof entry.scope === "string" && entry.scope.trim() ? entry.scope.trim() : "topframe";
|
|
177
|
+
return { expression, scope };
|
|
178
|
+
}
|
|
179
|
+
function overrideinputof(value) {
|
|
180
|
+
if (!value || typeof value !== "object" || Array.isArray(value)) return void 0;
|
|
181
|
+
const entry = value;
|
|
182
|
+
const urlpattern = typeof entry.urlpattern === "string" && entry.urlpattern.trim() ? entry.urlpattern.trim() : void 0;
|
|
183
|
+
const source = typeof entry.source === "string" ? entry.source : void 0;
|
|
184
|
+
if (urlpattern === void 0 || source === void 0 || source.trim().length === 0) return void 0;
|
|
185
|
+
return { urlpattern, source };
|
|
186
|
+
}
|
|
187
|
+
|
|
135
188
|
// runtimeline.ts
|
|
136
189
|
var loglevels = ["error", "warn", "info", "log", "debug", "trace"];
|
|
137
190
|
function levelrank(level) {
|
|
@@ -4484,6 +4537,16 @@
|
|
|
4484
4537
|
for (const cookie of targets) document.cookie = `${cookie.name}=; path=/; expires=Thu, 01 Jan 1970 00:00:00 GMT`;
|
|
4485
4538
|
return { cleared: targets.length, summary: `Cleared ${targets.length} cookie${targets.length === 1 ? "" : "s"} through the page cookie jar of ${location.origin}.` };
|
|
4486
4539
|
}
|
|
4487
|
-
|
|
4540
|
+
function maskstepvalues(step, shapes) {
|
|
4541
|
+
const masked = masktypedvalues({ step, shapes });
|
|
4542
|
+
return { ...step, ...masked.value !== void 0 ? { value: masked.value } : {}, ...masked.options !== void 0 ? { options: masked.options } : {} };
|
|
4543
|
+
}
|
|
4544
|
+
function maskobservationstate(fields, shapes) {
|
|
4545
|
+
return maskformstate(fields, shapes);
|
|
4546
|
+
}
|
|
4547
|
+
function maskobservationsnapshot(shot, shapes) {
|
|
4548
|
+
return maskobservation(shot, shapes);
|
|
4549
|
+
}
|
|
4550
|
+
Object.assign(globalThis, { devthinkbridge: { maskstepvalues, maskobservationstate, maskobservationsnapshot, capturesnapshot, previewtarget, performstep, readdialogs, measurepage, elementrect, queryelements, preparecapture, scrollcapture, restorecapture, scrollcontainercapture, waitsettle, pdfsegment, pdfbreaks, videoframe, canvasdata, streamelements, mediaelements, pageassets, pageimages, parsehtmlmarkup, resourcerecords, writecookies, readcookies, clearcookies, revertemulationlayer } });
|
|
4488
4551
|
})();
|
|
4489
4552
|
//# sourceMappingURL=pagebridge.js.map
|