@rickcedwhat/playwright-smart-vision 0.2.0-next.ea65044 → 0.3.0-next.0be9706
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/dist/author/apply.d.ts +83 -0
- package/dist/author/apply.d.ts.map +1 -0
- package/dist/author/apply.js +206 -0
- package/dist/author/apply.js.map +1 -0
- package/dist/author/author.test.d.ts +2 -0
- package/dist/author/author.test.d.ts.map +1 -0
- package/dist/author/author.test.js +157 -0
- package/dist/author/author.test.js.map +1 -0
- package/dist/author/catalog.d.ts +19 -0
- package/dist/author/catalog.d.ts.map +1 -0
- package/dist/author/catalog.js +118 -0
- package/dist/author/catalog.js.map +1 -0
- package/dist/author/detect.d.ts +27 -0
- package/dist/author/detect.d.ts.map +1 -0
- package/dist/author/detect.js +246 -0
- package/dist/author/detect.js.map +1 -0
- package/dist/author/geometry.d.ts +55 -0
- package/dist/author/geometry.d.ts.map +1 -0
- package/dist/author/geometry.js +317 -0
- package/dist/author/geometry.js.map +1 -0
- package/dist/author/geometry.test.d.ts +2 -0
- package/dist/author/geometry.test.d.ts.map +1 -0
- package/dist/author/geometry.test.js +263 -0
- package/dist/author/geometry.test.js.map +1 -0
- package/dist/author/index.d.ts +11 -0
- package/dist/author/index.d.ts.map +1 -0
- package/dist/author/index.js +6 -0
- package/dist/author/index.js.map +1 -0
- package/dist/author/labels.d.ts +33 -0
- package/dist/author/labels.d.ts.map +1 -0
- package/dist/author/labels.js +111 -0
- package/dist/author/labels.js.map +1 -0
- package/dist/author/labels.test.d.ts +2 -0
- package/dist/author/labels.test.d.ts.map +1 -0
- package/dist/author/labels.test.js +64 -0
- package/dist/author/labels.test.js.map +1 -0
- package/dist/author/show.d.ts +8 -0
- package/dist/author/show.d.ts.map +1 -0
- package/dist/author/show.js +20 -0
- package/dist/author/show.js.map +1 -0
- package/dist/author/storage.d.ts +3 -0
- package/dist/author/storage.d.ts.map +1 -0
- package/dist/author/storage.js +18 -0
- package/dist/author/storage.js.map +1 -0
- package/dist/configure.d.ts.map +1 -1
- package/dist/configure.js +2 -0
- package/dist/configure.js.map +1 -1
- package/dist/devtools.d.ts +16 -0
- package/dist/devtools.d.ts.map +1 -1
- package/dist/devtools.js +555 -93
- package/dist/devtools.js.map +1 -1
- package/dist/field-extractor.d.ts +2 -0
- package/dist/field-extractor.d.ts.map +1 -1
- package/dist/field-extractor.js +33 -15
- package/dist/field-extractor.js.map +1 -1
- package/dist/index.d.ts +2 -0
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/dist/ocr-test.d.ts.map +1 -1
- package/dist/ocr-test.js +7 -9
- package/dist/ocr-test.js.map +1 -1
- package/dist/screen.d.ts +24 -0
- package/dist/screen.d.ts.map +1 -0
- package/dist/screen.js +62 -0
- package/dist/screen.js.map +1 -0
- package/dist/utils/ocr.d.ts +12 -0
- package/dist/utils/ocr.d.ts.map +1 -1
- package/dist/utils/ocr.js +52 -4
- package/dist/utils/ocr.js.map +1 -1
- package/dist/utils/vision.d.ts +1 -0
- package/dist/utils/vision.d.ts.map +1 -1
- package/dist/utils/vision.js +31 -1
- package/dist/utils/vision.js.map +1 -1
- package/package.json +5 -1
package/dist/devtools.js
CHANGED
|
@@ -1,26 +1,76 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
1
|
+
import fs from 'node:fs';
|
|
2
|
+
import os from 'node:os';
|
|
3
|
+
import path from 'node:path';
|
|
4
|
+
import { getGlobalConfig, loadScreen, writeScreenBuffer } from './configure.js';
|
|
5
|
+
import { FieldExtractor } from './field-extractor.js';
|
|
6
|
+
import { screenDir } from './author/storage.js';
|
|
7
|
+
import { ensureCvReady } from './utils/vision.js';
|
|
8
|
+
import { getOCRUtil } from './utils/ocr.js';
|
|
9
|
+
/** First document-capture listener: type into the name field before Guacamole can steal keys. */
|
|
10
|
+
const DEVTOOLS_KEYS = `(function () {
|
|
11
|
+
if (window.__ocrNameInputShield) return;
|
|
12
|
+
window.__ocrNameInputShield = true;
|
|
13
|
+
|
|
14
|
+
document.addEventListener('keydown', (e) => {
|
|
15
|
+
const input = document.getElementById('__ocr-name-input');
|
|
16
|
+
if (input && e.target === input) {
|
|
17
|
+
if (e.ctrlKey || e.metaKey || e.altKey) return;
|
|
18
|
+
const start = input.selectionStart ?? input.value.length;
|
|
19
|
+
const end = input.selectionEnd ?? input.value.length;
|
|
20
|
+
if (e.key.length === 1) {
|
|
21
|
+
input.value = input.value.slice(0, start) + e.key + input.value.slice(end);
|
|
22
|
+
input.setSelectionRange(start + 1, start + 1);
|
|
23
|
+
} else if (e.key === 'Backspace') {
|
|
24
|
+
if (start !== end) {
|
|
25
|
+
input.value = input.value.slice(0, start) + input.value.slice(end);
|
|
26
|
+
input.setSelectionRange(start, start);
|
|
27
|
+
} else if (start > 0) {
|
|
28
|
+
input.value = input.value.slice(0, start - 1) + input.value.slice(end);
|
|
29
|
+
input.setSelectionRange(start - 1, start - 1);
|
|
30
|
+
}
|
|
31
|
+
} else if (e.key === 'Enter') {
|
|
32
|
+
document.getElementById('__ocr-modal-save')?.click();
|
|
33
|
+
} else if (e.key === 'Escape') {
|
|
34
|
+
document.getElementById('__ocr-modal-backdrop')?.remove();
|
|
35
|
+
} else {
|
|
36
|
+
return;
|
|
37
|
+
}
|
|
38
|
+
e.preventDefault();
|
|
39
|
+
e.stopImmediatePropagation();
|
|
40
|
+
return;
|
|
41
|
+
}
|
|
42
|
+
|
|
43
|
+
if (document.getElementById('__ocr-library-backdrop')) {
|
|
44
|
+
if (e.key === 'ArrowDown' || e.key === 'ArrowUp' || e.key === 'Enter' || e.key === 'Escape') {
|
|
45
|
+
e.preventDefault();
|
|
8
46
|
e.stopImmediatePropagation();
|
|
47
|
+
window.__ocrLibraryKey && window.__ocrLibraryKey(e.key);
|
|
9
48
|
}
|
|
10
|
-
|
|
11
|
-
for (const type of ['keydown', 'keyup', 'keypress']) {
|
|
12
|
-
document.addEventListener(type, shield, true);
|
|
49
|
+
return;
|
|
13
50
|
}
|
|
14
|
-
}
|
|
15
51
|
|
|
52
|
+
if (e.key === 'Escape') {
|
|
53
|
+
if (document.getElementById('__ocr-inspect-overlay')) {
|
|
54
|
+
e.preventDefault();
|
|
55
|
+
e.stopImmediatePropagation();
|
|
56
|
+
window.__ocrHideInspect && window.__ocrHideInspect();
|
|
57
|
+
return;
|
|
58
|
+
}
|
|
59
|
+
const fab = document.getElementById('__ocr-fab');
|
|
60
|
+
if (fab && fab.classList.contains('open')) {
|
|
61
|
+
e.preventDefault();
|
|
62
|
+
e.stopImmediatePropagation();
|
|
63
|
+
fab.classList.remove('open');
|
|
64
|
+
}
|
|
65
|
+
}
|
|
66
|
+
}, true);
|
|
67
|
+
})();`;
|
|
68
|
+
const FAB_SCRIPT = `(function () {
|
|
16
69
|
if (window.__ocrDevtools) return;
|
|
17
70
|
window.__ocrDevtools = true;
|
|
18
71
|
|
|
19
|
-
console.log('[OCR devtools] script loaded, readyState:', document.readyState);
|
|
20
|
-
|
|
21
72
|
function init() {
|
|
22
73
|
if (document.getElementById('__ocr-fab')) return;
|
|
23
|
-
console.log('[OCR devtools] mounting FAB');
|
|
24
74
|
|
|
25
75
|
const style = document.createElement('style');
|
|
26
76
|
style.textContent = \`
|
|
@@ -30,10 +80,12 @@ const FAB_SCRIPT = `(function () {
|
|
|
30
80
|
right: 20px;
|
|
31
81
|
z-index: 2147483647;
|
|
32
82
|
font-family: system-ui, sans-serif;
|
|
33
|
-
display:
|
|
34
|
-
|
|
83
|
+
display: flex;
|
|
84
|
+
flex-direction: column;
|
|
85
|
+
align-items: center;
|
|
86
|
+
gap: 10px;
|
|
35
87
|
}
|
|
36
|
-
#__ocr-fab-btn {
|
|
88
|
+
#__ocr-fab-btn, #__ocr-fab-actions button {
|
|
37
89
|
width: 48px;
|
|
38
90
|
height: 48px;
|
|
39
91
|
min-width: 48px;
|
|
@@ -45,46 +97,44 @@ const FAB_SCRIPT = `(function () {
|
|
|
45
97
|
background: #1a1a2e;
|
|
46
98
|
border: 2px solid #4f46e5;
|
|
47
99
|
color: #fff;
|
|
48
|
-
font-size: 20px;
|
|
49
|
-
line-height: 1;
|
|
50
100
|
cursor: pointer;
|
|
51
101
|
display: flex;
|
|
52
102
|
align-items: center;
|
|
53
103
|
justify-content: center;
|
|
54
|
-
flex-shrink: 0;
|
|
55
|
-
aspect-ratio: 1;
|
|
56
104
|
appearance: none;
|
|
57
105
|
-webkit-appearance: none;
|
|
58
106
|
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
|
|
59
|
-
transition: transform 0.15s;
|
|
60
107
|
}
|
|
61
|
-
#__ocr-fab-btn
|
|
62
|
-
#__ocr-fab-
|
|
63
|
-
|
|
64
|
-
bottom: 56px;
|
|
65
|
-
right: 0;
|
|
66
|
-
background: #1a1a2e;
|
|
67
|
-
border: 1px solid #4f46e5;
|
|
68
|
-
border-radius: 8px;
|
|
69
|
-
overflow: hidden;
|
|
70
|
-
box-shadow: 0 4px 16px rgba(0,0,0,0.5);
|
|
108
|
+
#__ocr-fab-btn { font-size: 26px; line-height: 1; transition: transform 0.2s; }
|
|
109
|
+
#__ocr-fab.open #__ocr-fab-btn { transform: rotate(45deg); }
|
|
110
|
+
#__ocr-fab-actions {
|
|
71
111
|
display: none;
|
|
112
|
+
flex-direction: column;
|
|
113
|
+
gap: 10px;
|
|
72
114
|
}
|
|
73
|
-
#__ocr-fab
|
|
74
|
-
#__ocr-fab-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
-
|
|
115
|
+
#__ocr-fab.open #__ocr-fab-actions { display: flex; }
|
|
116
|
+
#__ocr-fab-actions button { width: 40px; height: 40px; min-width: 40px; min-height: 40px; }
|
|
117
|
+
#__ocr-fab-actions button:hover { filter: brightness(1.15); }
|
|
118
|
+
#__ocr-fab-actions button:disabled { opacity: 0.35; cursor: not-allowed; filter: none; }
|
|
119
|
+
#__ocr-fab-overlay.on { background: #3d6d3d; border-color: #5a9; }
|
|
120
|
+
#__ocr-fab-chip {
|
|
121
|
+
position: absolute;
|
|
122
|
+
right: 56px;
|
|
123
|
+
bottom: 12px;
|
|
124
|
+
max-width: 160px;
|
|
125
|
+
overflow: hidden;
|
|
126
|
+
text-overflow: ellipsis;
|
|
83
127
|
white-space: nowrap;
|
|
84
|
-
|
|
128
|
+
background: #1a1a2e;
|
|
129
|
+
color: #cfc;
|
|
130
|
+
border: 1px solid #4f46e5;
|
|
131
|
+
border-radius: 6px;
|
|
132
|
+
padding: 4px 8px;
|
|
133
|
+
font-size: 11px;
|
|
134
|
+
pointer-events: none;
|
|
85
135
|
}
|
|
86
|
-
#__ocr-fab-
|
|
87
|
-
#__ocr-modal-backdrop {
|
|
136
|
+
#__ocr-fab-chip[hidden] { display: none; }
|
|
137
|
+
#__ocr-modal-backdrop, #__ocr-library-backdrop {
|
|
88
138
|
position: fixed;
|
|
89
139
|
inset: 0;
|
|
90
140
|
background: rgba(0,0,0,0.6);
|
|
@@ -94,18 +144,19 @@ const FAB_SCRIPT = `(function () {
|
|
|
94
144
|
justify-content: center;
|
|
95
145
|
font-family: system-ui, sans-serif;
|
|
96
146
|
}
|
|
97
|
-
#__ocr-modal {
|
|
147
|
+
#__ocr-modal, #__ocr-library {
|
|
98
148
|
background: #1a1a2e;
|
|
99
149
|
border: 1px solid #4f46e5;
|
|
100
150
|
border-radius: 12px;
|
|
101
151
|
padding: 20px;
|
|
102
|
-
width: 480px;
|
|
103
|
-
max-width: 90vw;
|
|
104
152
|
box-shadow: 0 8px 32px rgba(0,0,0,0.6);
|
|
105
153
|
font-family: system-ui, sans-serif;
|
|
106
154
|
line-height: normal;
|
|
155
|
+
color: #e2e8f0;
|
|
107
156
|
}
|
|
108
|
-
#__ocr-modal
|
|
157
|
+
#__ocr-modal { width: 480px; max-width: 90vw; }
|
|
158
|
+
#__ocr-library { width: min(860px, 94vw); max-height: 86vh; display: flex; flex-direction: column; }
|
|
159
|
+
#__ocr-modal h3, #__ocr-library h3 { margin: 0 0 12px; color: #e2e8f0; font-size: 15px; }
|
|
109
160
|
#__ocr-modal img { width: 100%; border-radius: 6px; border: 1px solid #4f46e5; margin-bottom: 12px; }
|
|
110
161
|
#__ocr-modal input {
|
|
111
162
|
width: 100%;
|
|
@@ -123,13 +174,49 @@ const FAB_SCRIPT = `(function () {
|
|
|
123
174
|
-webkit-user-select: text;
|
|
124
175
|
}
|
|
125
176
|
#__ocr-modal input:focus { border-color: #818cf8; }
|
|
126
|
-
#__ocr-modal-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
|
127
|
-
#__ocr-modal-actions button
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
#__ocr-modal-save
|
|
131
|
-
#__ocr-modal-
|
|
132
|
-
#__ocr-modal-
|
|
177
|
+
#__ocr-modal-actions, #__ocr-library-actions { display: flex; gap: 8px; justify-content: flex-end; }
|
|
178
|
+
#__ocr-modal-actions button, #__ocr-library-actions button {
|
|
179
|
+
padding: 7px 16px; border-radius: 6px; border: none; font-size: 13px; cursor: pointer;
|
|
180
|
+
}
|
|
181
|
+
#__ocr-modal-save, #__ocr-library-choose { background: #4f46e5; color: #fff; }
|
|
182
|
+
#__ocr-modal-save:hover, #__ocr-library-choose:hover { background: #6366f1; }
|
|
183
|
+
#__ocr-modal-save:disabled, #__ocr-library-choose:disabled { opacity: 0.5; cursor: default; }
|
|
184
|
+
#__ocr-modal-cancel, #__ocr-library-cancel { background: #2d2d4e; color: #e2e8f0; }
|
|
185
|
+
#__ocr-library-body { display: grid; grid-template-columns: 220px 1fr; gap: 12px; min-height: 280px; margin-bottom: 12px; }
|
|
186
|
+
#__ocr-library-list {
|
|
187
|
+
overflow: auto;
|
|
188
|
+
max-height: 52vh;
|
|
189
|
+
border: 1px solid #333;
|
|
190
|
+
border-radius: 8px;
|
|
191
|
+
background: #111;
|
|
192
|
+
}
|
|
193
|
+
#__ocr-library-list button {
|
|
194
|
+
display: block;
|
|
195
|
+
width: 100%;
|
|
196
|
+
text-align: left;
|
|
197
|
+
background: none;
|
|
198
|
+
border: none;
|
|
199
|
+
border-bottom: 1px solid #2a2a2a;
|
|
200
|
+
color: #ddd;
|
|
201
|
+
padding: 8px 10px;
|
|
202
|
+
cursor: pointer;
|
|
203
|
+
font: 13px/1.3 ui-monospace, SFMono-Regular, Menlo, monospace;
|
|
204
|
+
}
|
|
205
|
+
#__ocr-library-list button:hover { background: #2a2a2a; }
|
|
206
|
+
#__ocr-library-list button.active { background: #243a24; color: #cfc; }
|
|
207
|
+
#__ocr-library-list .muted { color: #888; font-size: 11px; }
|
|
208
|
+
#__ocr-library-preview {
|
|
209
|
+
background: #000;
|
|
210
|
+
border: 1px solid #333;
|
|
211
|
+
border-radius: 8px;
|
|
212
|
+
min-height: 220px;
|
|
213
|
+
display: flex;
|
|
214
|
+
align-items: center;
|
|
215
|
+
justify-content: center;
|
|
216
|
+
overflow: hidden;
|
|
217
|
+
}
|
|
218
|
+
#__ocr-library-preview img { max-width: 100%; max-height: 52vh; display: block; }
|
|
219
|
+
#__ocr-library-empty { color: #888; padding: 16px; font-size: 13px; }
|
|
133
220
|
#__ocr-toast {
|
|
134
221
|
position: fixed;
|
|
135
222
|
bottom: 80px;
|
|
@@ -144,51 +231,181 @@ const FAB_SCRIPT = `(function () {
|
|
|
144
231
|
box-shadow: 0 4px 12px rgba(0,0,0,0.4);
|
|
145
232
|
transition: opacity 0.3s;
|
|
146
233
|
}
|
|
234
|
+
#__ocr-toast.err { background: #4a2020; color: #fcc; }
|
|
235
|
+
#__ocr-inspect-overlay {
|
|
236
|
+
position: fixed;
|
|
237
|
+
inset: 0;
|
|
238
|
+
z-index: 2147483645;
|
|
239
|
+
pointer-events: auto;
|
|
240
|
+
}
|
|
241
|
+
#__ocr-inspect-overlay .hit {
|
|
242
|
+
position: absolute;
|
|
243
|
+
border: 2px solid #6af;
|
|
244
|
+
background: rgba(80,160,255,.12);
|
|
245
|
+
box-sizing: border-box;
|
|
246
|
+
cursor: pointer;
|
|
247
|
+
}
|
|
248
|
+
#__ocr-inspect-overlay .hit.low { border-color: #f66; background: rgba(255,80,80,.12); }
|
|
249
|
+
#__ocr-inspect-overlay .hit.on { outline: 2px solid #ffe08a; z-index: 2; }
|
|
250
|
+
#__ocr-inspect-overlay .part {
|
|
251
|
+
position: absolute;
|
|
252
|
+
border: 1px dashed #9cf;
|
|
253
|
+
pointer-events: none;
|
|
254
|
+
}
|
|
255
|
+
#__ocr-inspect-pop {
|
|
256
|
+
position: absolute;
|
|
257
|
+
z-index: 3;
|
|
258
|
+
width: min(280px, 90vw);
|
|
259
|
+
background: #1c1c1c;
|
|
260
|
+
border: 1px solid #444;
|
|
261
|
+
border-radius: 8px;
|
|
262
|
+
padding: 10px;
|
|
263
|
+
color: #ddd;
|
|
264
|
+
font: 12px/1.35 system-ui, sans-serif;
|
|
265
|
+
pointer-events: none;
|
|
266
|
+
}
|
|
267
|
+
#__ocr-inspect-pop b { display: block; margin-bottom: 4px; color: #fff; }
|
|
147
268
|
\`;
|
|
148
269
|
(document.head || document.documentElement).appendChild(style);
|
|
149
270
|
|
|
150
271
|
const fab = document.createElement('div');
|
|
151
272
|
fab.id = '__ocr-fab';
|
|
152
273
|
fab.innerHTML = \`
|
|
153
|
-
<div id="__ocr-fab-
|
|
154
|
-
<button id="__ocr-
|
|
274
|
+
<div id="__ocr-fab-actions">
|
|
275
|
+
<button id="__ocr-fab-overlay" type="button" disabled title="Choose a screen first">▦</button>
|
|
276
|
+
<button id="__ocr-fab-library" type="button" title="Choose screen">☰</button>
|
|
277
|
+
<button id="__ocr-fab-capture" type="button" title="Capture screen">👁</button>
|
|
155
278
|
</div>
|
|
156
|
-
<button id="__ocr-fab-btn" title="
|
|
279
|
+
<button id="__ocr-fab-btn" title="smart-vision" aria-expanded="false">+</button>
|
|
280
|
+
<div id="__ocr-fab-chip" hidden></div>
|
|
157
281
|
\`;
|
|
158
282
|
|
|
159
283
|
function isolateFromPage(el) {
|
|
160
|
-
const types = ['mousedown', 'mouseup', 'click', 'dblclick', 'keydown', 'keyup', 'keypress', 'input', 'compositionstart', 'compositionupdate', 'compositionend'];
|
|
284
|
+
const types = ['mousedown', 'mouseup', 'click', 'dblclick', 'keydown', 'keyup', 'keypress', 'input', 'pointerdown', 'pointerup', 'compositionstart', 'compositionupdate', 'compositionend'];
|
|
161
285
|
for (const type of types) {
|
|
162
286
|
el.addEventListener(type, (e) => e.stopPropagation());
|
|
163
287
|
}
|
|
164
288
|
}
|
|
165
289
|
|
|
166
290
|
isolateFromPage(fab);
|
|
167
|
-
|
|
168
291
|
(document.body || document.documentElement).appendChild(fab);
|
|
169
292
|
|
|
170
293
|
const fabBtn = fab.querySelector('#__ocr-fab-btn');
|
|
171
|
-
const
|
|
172
|
-
const
|
|
294
|
+
const captureBtn = fab.querySelector('#__ocr-fab-capture');
|
|
295
|
+
const libraryBtn = fab.querySelector('#__ocr-fab-library');
|
|
296
|
+
const overlayBtn = fab.querySelector('#__ocr-fab-overlay');
|
|
297
|
+
const chip = fab.querySelector('#__ocr-fab-chip');
|
|
298
|
+
let currentScreen = '';
|
|
299
|
+
let currentHasIndex = false;
|
|
300
|
+
let overlayOn = false;
|
|
301
|
+
let hoverTimer = 0;
|
|
302
|
+
|
|
303
|
+
let openedByHover = false;
|
|
304
|
+
|
|
305
|
+
function setOpen(open) {
|
|
306
|
+
fab.classList.toggle('open', open);
|
|
307
|
+
fabBtn.setAttribute('aria-expanded', open ? 'true' : 'false');
|
|
308
|
+
if (!open) openedByHover = false;
|
|
309
|
+
}
|
|
310
|
+
|
|
311
|
+
fabBtn.addEventListener('click', (e) => {
|
|
312
|
+
e.stopPropagation();
|
|
313
|
+
if (openedByHover && fab.classList.contains('open')) {
|
|
314
|
+
openedByHover = false;
|
|
315
|
+
return;
|
|
316
|
+
}
|
|
317
|
+
setOpen(!fab.classList.contains('open'));
|
|
318
|
+
});
|
|
319
|
+
fab.addEventListener('mouseenter', () => {
|
|
320
|
+
clearTimeout(hoverTimer);
|
|
321
|
+
openedByHover = true;
|
|
322
|
+
setOpen(true);
|
|
323
|
+
});
|
|
173
324
|
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
325
|
+
function syncOverlayBtn() {
|
|
326
|
+
overlayBtn.disabled = !currentHasIndex;
|
|
327
|
+
overlayBtn.title = currentHasIndex
|
|
328
|
+
? (overlayOn ? 'Hide overlay' : 'Show overlay')
|
|
329
|
+
: (currentScreen ? 'Apply this screen in TM v2 first' : 'Choose a screen first');
|
|
330
|
+
overlayBtn.classList.toggle('on', overlayOn);
|
|
331
|
+
}
|
|
332
|
+
|
|
333
|
+
function setCurrent(name, hasIndex) {
|
|
334
|
+
currentScreen = name || '';
|
|
335
|
+
currentHasIndex = !!hasIndex;
|
|
336
|
+
chip.hidden = !currentScreen;
|
|
337
|
+
chip.textContent = currentScreen;
|
|
338
|
+
if (overlayOn && !currentHasIndex) hideInspect();
|
|
339
|
+
syncOverlayBtn();
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
fab.addEventListener('mouseleave', () => {
|
|
343
|
+
hoverTimer = setTimeout(() => setOpen(false), 280);
|
|
177
344
|
});
|
|
345
|
+
document.addEventListener('mousedown', (e) => {
|
|
346
|
+
if (!fab.classList.contains('open')) return;
|
|
347
|
+
if (fab.contains(e.target)) return;
|
|
348
|
+
if (document.getElementById('__ocr-modal-backdrop')) return;
|
|
349
|
+
if (document.getElementById('__ocr-library-backdrop')) return;
|
|
350
|
+
setOpen(false);
|
|
351
|
+
}, true);
|
|
178
352
|
|
|
179
|
-
captureBtn.addEventListener('click', async () => {
|
|
180
|
-
|
|
181
|
-
|
|
353
|
+
captureBtn.addEventListener('click', async (e) => {
|
|
354
|
+
e.stopPropagation();
|
|
355
|
+
setOpen(false);
|
|
356
|
+
const overlayEl = document.getElementById('__ocr-inspect-overlay');
|
|
357
|
+
if (overlayEl) overlayEl.style.visibility = 'hidden';
|
|
358
|
+
fab.style.visibility = 'hidden';
|
|
182
359
|
let b64;
|
|
183
360
|
try {
|
|
184
361
|
b64 = await window.__ocrCapture();
|
|
185
362
|
} finally {
|
|
186
|
-
fab.style.
|
|
363
|
+
fab.style.visibility = '';
|
|
364
|
+
if (overlayEl) overlayEl.style.visibility = '';
|
|
187
365
|
}
|
|
188
|
-
|
|
366
|
+
showCaptureModal(b64);
|
|
367
|
+
});
|
|
368
|
+
|
|
369
|
+
libraryBtn.addEventListener('click', async (e) => {
|
|
370
|
+
e.stopPropagation();
|
|
371
|
+
setOpen(false);
|
|
372
|
+
await showLibraryModal();
|
|
189
373
|
});
|
|
190
374
|
|
|
191
|
-
|
|
375
|
+
overlayBtn.addEventListener('click', async (e) => {
|
|
376
|
+
e.stopPropagation();
|
|
377
|
+
if (overlayBtn.disabled) return;
|
|
378
|
+
if (overlayOn) {
|
|
379
|
+
hideInspect();
|
|
380
|
+
return;
|
|
381
|
+
}
|
|
382
|
+
setOpen(false);
|
|
383
|
+
overlayBtn.disabled = true;
|
|
384
|
+
overlayBtn.title = 'Matching…';
|
|
385
|
+
fab.style.visibility = 'hidden';
|
|
386
|
+
try {
|
|
387
|
+
const hits = await window.__ocrMatchOverlay(currentScreen);
|
|
388
|
+
showInspect(hits);
|
|
389
|
+
showToast('Overlay: ' + currentScreen);
|
|
390
|
+
} catch (err) {
|
|
391
|
+
showToast('Overlay failed: ' + (err && err.message ? err.message : err), true);
|
|
392
|
+
} finally {
|
|
393
|
+
fab.style.visibility = '';
|
|
394
|
+
syncOverlayBtn();
|
|
395
|
+
}
|
|
396
|
+
});
|
|
397
|
+
|
|
398
|
+
function showToast(msg, err) {
|
|
399
|
+
document.getElementById('__ocr-toast')?.remove();
|
|
400
|
+
const t = document.createElement('div');
|
|
401
|
+
t.id = '__ocr-toast';
|
|
402
|
+
if (err) t.className = 'err';
|
|
403
|
+
t.textContent = msg;
|
|
404
|
+
document.body.appendChild(t);
|
|
405
|
+
setTimeout(() => { t.style.opacity = '0'; setTimeout(() => t.remove(), 300); }, 2500);
|
|
406
|
+
}
|
|
407
|
+
|
|
408
|
+
function showCaptureModal(b64) {
|
|
192
409
|
const backdrop = document.createElement('div');
|
|
193
410
|
backdrop.id = '__ocr-modal-backdrop';
|
|
194
411
|
backdrop.innerHTML = \`
|
|
@@ -197,27 +414,21 @@ const FAB_SCRIPT = `(function () {
|
|
|
197
414
|
<img src="data:image/png;base64,\${b64}" />
|
|
198
415
|
<input id="__ocr-name-input" type="text" placeholder="Screen name (e.g. desktop, customer-info)" />
|
|
199
416
|
<div id="__ocr-modal-actions">
|
|
200
|
-
<button id="__ocr-modal-cancel">Cancel</button>
|
|
201
|
-
<button id="__ocr-modal-save">Save</button>
|
|
417
|
+
<button id="__ocr-modal-cancel" type="button">Cancel</button>
|
|
418
|
+
<button id="__ocr-modal-save" type="button">Save</button>
|
|
202
419
|
</div>
|
|
203
420
|
</div>
|
|
204
421
|
\`;
|
|
205
422
|
document.body.appendChild(backdrop);
|
|
206
|
-
|
|
207
423
|
const modal = backdrop.querySelector('#__ocr-modal');
|
|
208
424
|
const input = backdrop.querySelector('#__ocr-name-input');
|
|
209
425
|
const saveBtn = backdrop.querySelector('#__ocr-modal-save');
|
|
210
|
-
const cancelBtn = backdrop.querySelector('#__ocr-modal-cancel');
|
|
211
|
-
|
|
212
426
|
isolateFromPage(backdrop);
|
|
213
427
|
isolateFromPage(modal);
|
|
214
428
|
isolateFromPage(input);
|
|
215
|
-
|
|
216
429
|
input.focus();
|
|
217
|
-
|
|
218
|
-
cancelBtn.addEventListener('click', () => backdrop.remove());
|
|
430
|
+
backdrop.querySelector('#__ocr-modal-cancel').addEventListener('click', () => backdrop.remove());
|
|
219
431
|
backdrop.addEventListener('click', (e) => { if (e.target === backdrop) backdrop.remove(); });
|
|
220
|
-
|
|
221
432
|
saveBtn.addEventListener('click', async () => {
|
|
222
433
|
const name = input.value.trim();
|
|
223
434
|
if (!name) { input.focus(); return; }
|
|
@@ -226,6 +437,13 @@ const FAB_SCRIPT = `(function () {
|
|
|
226
437
|
try {
|
|
227
438
|
await window.__ocrSave(name, b64);
|
|
228
439
|
backdrop.remove();
|
|
440
|
+
let hasIndex = false;
|
|
441
|
+
try {
|
|
442
|
+
const listed = await window.__ocrListScreens();
|
|
443
|
+
const row = (listed || []).find((s) => s.name === name);
|
|
444
|
+
hasIndex = !!(row && row.hasIndex);
|
|
445
|
+
} catch (_) {}
|
|
446
|
+
setCurrent(name, hasIndex);
|
|
229
447
|
showToast('Saved: ' + name);
|
|
230
448
|
} catch (err) {
|
|
231
449
|
saveBtn.disabled = false;
|
|
@@ -233,20 +451,189 @@ const FAB_SCRIPT = `(function () {
|
|
|
233
451
|
alert('Save failed: ' + err.message);
|
|
234
452
|
}
|
|
235
453
|
});
|
|
454
|
+
}
|
|
236
455
|
|
|
237
|
-
|
|
238
|
-
|
|
239
|
-
|
|
456
|
+
async function showLibraryModal() {
|
|
457
|
+
let screens = [];
|
|
458
|
+
try {
|
|
459
|
+
screens = await window.__ocrListScreens() || [];
|
|
460
|
+
} catch (err) {
|
|
461
|
+
showToast('Could not list screens: ' + (err && err.message ? err.message : err), true);
|
|
462
|
+
return;
|
|
463
|
+
}
|
|
464
|
+
const backdrop = document.createElement('div');
|
|
465
|
+
backdrop.id = '__ocr-library-backdrop';
|
|
466
|
+
const names = screens.map((s) => s.name);
|
|
467
|
+
let selected = currentScreen && names.includes(currentScreen) ? currentScreen : (names[0] || '');
|
|
468
|
+
backdrop.innerHTML = \`
|
|
469
|
+
<div id="__ocr-library">
|
|
470
|
+
<h3>Choose current screen</h3>
|
|
471
|
+
<div id="__ocr-library-body">
|
|
472
|
+
<div id="__ocr-library-list"></div>
|
|
473
|
+
<div id="__ocr-library-preview"><span class="muted">No preview</span></div>
|
|
474
|
+
</div>
|
|
475
|
+
<div id="__ocr-library-actions">
|
|
476
|
+
<button id="__ocr-library-cancel" type="button">Cancel</button>
|
|
477
|
+
<button id="__ocr-library-choose" type="button">Choose current screen</button>
|
|
478
|
+
</div>
|
|
479
|
+
</div>
|
|
480
|
+
\`;
|
|
481
|
+
document.body.appendChild(backdrop);
|
|
482
|
+
isolateFromPage(backdrop);
|
|
483
|
+
isolateFromPage(backdrop.querySelector('#__ocr-library'));
|
|
484
|
+
const listEl = backdrop.querySelector('#__ocr-library-list');
|
|
485
|
+
const previewEl = backdrop.querySelector('#__ocr-library-preview');
|
|
486
|
+
const chooseBtn = backdrop.querySelector('#__ocr-library-choose');
|
|
487
|
+
chooseBtn.disabled = !screens.length;
|
|
488
|
+
|
|
489
|
+
function renderList() {
|
|
490
|
+
if (!screens.length) {
|
|
491
|
+
listEl.innerHTML = '<div id="__ocr-library-empty">No screens in the local cache yet. Capture one first.</div>';
|
|
492
|
+
return;
|
|
493
|
+
}
|
|
494
|
+
listEl.innerHTML = screens.map((s) => (
|
|
495
|
+
'<button type="button" data-name="' + s.name + '" class="' + (s.name === selected ? 'active' : '') + '">' +
|
|
496
|
+
s.name +
|
|
497
|
+
(s.hasIndex ? '' : '<div class="muted">capture only</div>') +
|
|
498
|
+
'</button>'
|
|
499
|
+
)).join('');
|
|
500
|
+
}
|
|
501
|
+
|
|
502
|
+
async function showPreview(name) {
|
|
503
|
+
selected = name;
|
|
504
|
+
renderList();
|
|
505
|
+
previewEl.innerHTML = '<span class="muted">Loading…</span>';
|
|
506
|
+
try {
|
|
507
|
+
const b64 = await window.__ocrScreenPreview(name);
|
|
508
|
+
if (!b64) {
|
|
509
|
+
previewEl.innerHTML = '<span class="muted">No blank.png</span>';
|
|
510
|
+
return;
|
|
511
|
+
}
|
|
512
|
+
previewEl.innerHTML = '<img alt="' + name + '" src="data:image/png;base64,' + b64 + '">';
|
|
513
|
+
} catch (err) {
|
|
514
|
+
previewEl.innerHTML = '<span class="muted">' + (err && err.message ? err.message : 'preview failed') + '</span>';
|
|
515
|
+
}
|
|
516
|
+
}
|
|
517
|
+
|
|
518
|
+
listEl.addEventListener('click', (e) => {
|
|
519
|
+
const btn = e.target.closest('button[data-name]');
|
|
520
|
+
if (btn) showPreview(btn.dataset.name);
|
|
240
521
|
});
|
|
522
|
+
|
|
523
|
+
window.__ocrLibraryKey = (key) => {
|
|
524
|
+
if (key === 'Escape') {
|
|
525
|
+
backdrop.remove();
|
|
526
|
+
return;
|
|
527
|
+
}
|
|
528
|
+
if (!screens.length) return;
|
|
529
|
+
const idx = Math.max(0, names.indexOf(selected));
|
|
530
|
+
if (key === 'ArrowDown') showPreview(names[Math.min(names.length - 1, idx + 1)]);
|
|
531
|
+
if (key === 'ArrowUp') showPreview(names[Math.max(0, idx - 1)]);
|
|
532
|
+
if (key === 'Enter') chooseBtn.click();
|
|
533
|
+
};
|
|
534
|
+
|
|
535
|
+
backdrop.querySelector('#__ocr-library-cancel').addEventListener('click', () => backdrop.remove());
|
|
536
|
+
backdrop.addEventListener('click', (e) => { if (e.target === backdrop) backdrop.remove(); });
|
|
537
|
+
chooseBtn.addEventListener('click', () => {
|
|
538
|
+
if (!selected) return;
|
|
539
|
+
const row = screens.find((s) => s.name === selected);
|
|
540
|
+
setCurrent(selected, !!(row && row.hasIndex));
|
|
541
|
+
backdrop.remove();
|
|
542
|
+
showToast('Current screen: ' + selected);
|
|
543
|
+
});
|
|
544
|
+
|
|
545
|
+
if (selected) showPreview(selected);
|
|
546
|
+
else renderList();
|
|
241
547
|
}
|
|
242
548
|
|
|
243
|
-
function
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
|
|
247
|
-
document.body.appendChild(t);
|
|
248
|
-
setTimeout(() => { t.style.opacity = '0'; setTimeout(() => t.remove(), 300); }, 2500);
|
|
549
|
+
function hideInspect() {
|
|
550
|
+
overlayOn = false;
|
|
551
|
+
document.getElementById('__ocr-inspect-overlay')?.remove();
|
|
552
|
+
syncOverlayBtn();
|
|
249
553
|
}
|
|
554
|
+
window.__ocrHideInspect = hideInspect;
|
|
555
|
+
|
|
556
|
+
function showInspect(hits) {
|
|
557
|
+
hideInspect();
|
|
558
|
+
overlayOn = true;
|
|
559
|
+
const root = document.createElement('div');
|
|
560
|
+
root.id = '__ocr-inspect-overlay';
|
|
561
|
+
const dpr = window.devicePixelRatio || 1;
|
|
562
|
+
const shield = (e) => {
|
|
563
|
+
e.preventDefault();
|
|
564
|
+
e.stopPropagation();
|
|
565
|
+
};
|
|
566
|
+
for (const type of ['mousedown', 'mouseup', 'click', 'dblclick', 'pointerdown', 'pointerup', 'contextmenu', 'wheel']) {
|
|
567
|
+
root.addEventListener(type, shield, true);
|
|
568
|
+
}
|
|
569
|
+
let pinned = '';
|
|
570
|
+
const pop = document.createElement('div');
|
|
571
|
+
pop.id = '__ocr-inspect-pop';
|
|
572
|
+
pop.hidden = true;
|
|
573
|
+
root.appendChild(pop);
|
|
574
|
+
|
|
575
|
+
const sorted = (hits || []).slice().sort((a, b) => (a.width * a.height) - (b.width * b.height));
|
|
576
|
+
for (const hit of sorted) {
|
|
577
|
+
const el = document.createElement('div');
|
|
578
|
+
el.className = 'hit' + ((hit.confidence || 0) < 0.7 ? ' low' : '');
|
|
579
|
+
el.dataset.name = hit.name;
|
|
580
|
+
el.style.left = (hit.x / dpr) + 'px';
|
|
581
|
+
el.style.top = (hit.y / dpr) + 'px';
|
|
582
|
+
el.style.width = (hit.width / dpr) + 'px';
|
|
583
|
+
el.style.height = (hit.height / dpr) + 'px';
|
|
584
|
+
for (const part of hit.parts || []) {
|
|
585
|
+
const p = document.createElement('div');
|
|
586
|
+
p.className = 'part';
|
|
587
|
+
p.style.left = ((part.x - hit.x) / dpr) + 'px';
|
|
588
|
+
p.style.top = ((part.y - hit.y) / dpr) + 'px';
|
|
589
|
+
p.style.width = (part.width / dpr) + 'px';
|
|
590
|
+
p.style.height = (part.height / dpr) + 'px';
|
|
591
|
+
el.appendChild(p);
|
|
592
|
+
}
|
|
593
|
+
el.addEventListener('pointerover', (e) => {
|
|
594
|
+
e.stopPropagation();
|
|
595
|
+
if (!pinned) showPop(hit, el);
|
|
596
|
+
});
|
|
597
|
+
el.addEventListener('pointerout', (e) => {
|
|
598
|
+
if (!pinned && !el.contains(e.relatedTarget)) pop.hidden = true;
|
|
599
|
+
});
|
|
600
|
+
el.addEventListener('click', (e) => {
|
|
601
|
+
e.preventDefault();
|
|
602
|
+
e.stopPropagation();
|
|
603
|
+
pinned = pinned === hit.name ? '' : hit.name;
|
|
604
|
+
root.querySelectorAll('.hit').forEach((node) => node.classList.toggle('on', node.dataset.name === pinned));
|
|
605
|
+
if (pinned) showPop(hit, el);
|
|
606
|
+
else pop.hidden = true;
|
|
607
|
+
});
|
|
608
|
+
root.appendChild(el);
|
|
609
|
+
}
|
|
610
|
+
root.addEventListener('click', (e) => {
|
|
611
|
+
if (e.target === root) {
|
|
612
|
+
pinned = '';
|
|
613
|
+
pop.hidden = true;
|
|
614
|
+
root.querySelectorAll('.hit').forEach((node) => node.classList.remove('on'));
|
|
615
|
+
}
|
|
616
|
+
});
|
|
617
|
+
function showPop(hit, el) {
|
|
618
|
+
pop.hidden = false;
|
|
619
|
+
const conf = hit.confidence == null ? '' : ' · ' + Math.round(hit.confidence * 100) + '%';
|
|
620
|
+
const parts = (hit.parts || []).map((p) => p.name).join(', ');
|
|
621
|
+
pop.innerHTML = '<b>' + hit.name + '</b>' +
|
|
622
|
+
(hit.type || 'element') + conf +
|
|
623
|
+
(parts ? '<div>' + parts + '</div>' : '');
|
|
624
|
+
const r = el.getBoundingClientRect();
|
|
625
|
+
let left = r.right + 8;
|
|
626
|
+
let top = r.top;
|
|
627
|
+
if (left + 280 > window.innerWidth) left = Math.max(8, r.left - 288);
|
|
628
|
+
if (top + 80 > window.innerHeight) top = Math.max(8, window.innerHeight - 90);
|
|
629
|
+
pop.style.left = left + 'px';
|
|
630
|
+
pop.style.top = top + 'px';
|
|
631
|
+
}
|
|
632
|
+
document.documentElement.appendChild(root);
|
|
633
|
+
syncOverlayBtn();
|
|
634
|
+
}
|
|
635
|
+
|
|
636
|
+
syncOverlayBtn();
|
|
250
637
|
}
|
|
251
638
|
|
|
252
639
|
if (document.readyState === 'loading') {
|
|
@@ -255,16 +642,91 @@ const FAB_SCRIPT = `(function () {
|
|
|
255
642
|
init();
|
|
256
643
|
}
|
|
257
644
|
})();`;
|
|
645
|
+
function listDevtoolsScreens() {
|
|
646
|
+
const root = getGlobalConfig().storage?.root;
|
|
647
|
+
if (!root || !fs.existsSync(root))
|
|
648
|
+
return [];
|
|
649
|
+
const out = [];
|
|
650
|
+
for (const ent of fs.readdirSync(root, { withFileTypes: true })) {
|
|
651
|
+
if (!ent.isDirectory() || ent.name.startsWith('.'))
|
|
652
|
+
continue;
|
|
653
|
+
const dir = path.join(root, ent.name);
|
|
654
|
+
if (!fs.existsSync(path.join(dir, 'blank.png')))
|
|
655
|
+
continue;
|
|
656
|
+
out.push({
|
|
657
|
+
name: ent.name,
|
|
658
|
+
hasIndex: fs.existsSync(path.join(dir, 'index.json')),
|
|
659
|
+
});
|
|
660
|
+
}
|
|
661
|
+
return out.sort((a, b) => a.name.localeCompare(b.name));
|
|
662
|
+
}
|
|
663
|
+
async function matchOverlay(page, name) {
|
|
664
|
+
const screen = loadScreen(name);
|
|
665
|
+
const shot = await page.screenshot({ timeout: 8_000 });
|
|
666
|
+
const tmp = path.join(os.tmpdir(), `ocr-fab-overlay-${Date.now()}.png`);
|
|
667
|
+
fs.writeFileSync(tmp, shot);
|
|
668
|
+
await ensureCvReady();
|
|
669
|
+
const ocr = await getOCRUtil();
|
|
670
|
+
const extractor = new FieldExtractor(ocr, false);
|
|
671
|
+
try {
|
|
672
|
+
await extractor.loadForms(screen.blankScreenPath, tmp);
|
|
673
|
+
const comparison = await extractor.extractElements(screen.elementConfigs, { locateOnly: true });
|
|
674
|
+
return comparison.elements.map((el) => {
|
|
675
|
+
const hit = {
|
|
676
|
+
name: el.name,
|
|
677
|
+
x: el.location.x,
|
|
678
|
+
y: el.location.y,
|
|
679
|
+
width: el.location.width,
|
|
680
|
+
height: el.location.height,
|
|
681
|
+
confidence: el.confidence ?? 0,
|
|
682
|
+
};
|
|
683
|
+
if (el.type)
|
|
684
|
+
hit.type = String(el.type);
|
|
685
|
+
if (el.parts?.length) {
|
|
686
|
+
hit.parts = el.parts.map((part) => ({
|
|
687
|
+
name: part.name,
|
|
688
|
+
x: part.location.x,
|
|
689
|
+
y: part.location.y,
|
|
690
|
+
width: part.location.width,
|
|
691
|
+
height: part.location.height,
|
|
692
|
+
}));
|
|
693
|
+
}
|
|
694
|
+
return hit;
|
|
695
|
+
});
|
|
696
|
+
}
|
|
697
|
+
finally {
|
|
698
|
+
extractor.cleanup();
|
|
699
|
+
fs.rmSync(tmp, { force: true });
|
|
700
|
+
}
|
|
701
|
+
}
|
|
702
|
+
async function expose(page, name, fn) {
|
|
703
|
+
try {
|
|
704
|
+
await page.exposeFunction(name, fn);
|
|
705
|
+
}
|
|
706
|
+
catch (err) {
|
|
707
|
+
if (!String(err).includes('already'))
|
|
708
|
+
throw err;
|
|
709
|
+
}
|
|
710
|
+
}
|
|
258
711
|
export async function injectDevtools(page) {
|
|
259
|
-
await page
|
|
712
|
+
await expose(page, '__ocrCapture', async () => {
|
|
260
713
|
const buffer = await page.screenshot({ timeout: 5_000 });
|
|
261
714
|
return buffer.toString('base64');
|
|
262
715
|
});
|
|
263
|
-
await page
|
|
716
|
+
await expose(page, '__ocrSave', async (name, b64) => {
|
|
264
717
|
writeScreenBuffer(name, Buffer.from(b64, 'base64'));
|
|
265
718
|
});
|
|
266
|
-
|
|
719
|
+
await expose(page, '__ocrListScreens', async () => listDevtoolsScreens());
|
|
720
|
+
await expose(page, '__ocrScreenPreview', async (name) => {
|
|
721
|
+
const blankPath = path.join(screenDir(name), 'blank.png');
|
|
722
|
+
if (!fs.existsSync(blankPath))
|
|
723
|
+
return null;
|
|
724
|
+
return fs.readFileSync(blankPath).toString('base64');
|
|
725
|
+
});
|
|
726
|
+
await expose(page, '__ocrMatchOverlay', async (name) => matchOverlay(page, name));
|
|
727
|
+
await page.addInitScript(DEVTOOLS_KEYS);
|
|
267
728
|
await page.addInitScript(FAB_SCRIPT);
|
|
729
|
+
await page.evaluate(DEVTOOLS_KEYS);
|
|
268
730
|
await page.evaluate(FAB_SCRIPT);
|
|
269
731
|
}
|
|
270
732
|
//# sourceMappingURL=devtools.js.map
|