@xxxfnbs21/hello-demo 0.1.3 → 0.1.5
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/build/index.html +57 -5
- package/package.json +1 -1
package/build/index.html
CHANGED
|
@@ -28,7 +28,7 @@
|
|
|
28
28
|
setInterval(tick, 1000);
|
|
29
29
|
|
|
30
30
|
function chromeVer() {
|
|
31
|
-
var
|
|
31
|
+
var probes = [
|
|
32
32
|
[110, function () { return typeof Array.prototype.toSorted === 'function'; }],
|
|
33
33
|
[111, function () { return typeof document.startViewTransition === 'function'; }],
|
|
34
34
|
[117, function () { return typeof Object.groupBy === 'function'; }],
|
|
@@ -50,7 +50,7 @@
|
|
|
50
50
|
[147, function () { return typeof Math.sumPrecise === 'function'; }]
|
|
51
51
|
];
|
|
52
52
|
var hit = [];
|
|
53
|
-
|
|
53
|
+
probes.forEach(function (t) {
|
|
54
54
|
try { if (t[1]()) hit.push(t[0]); } catch (e) {}
|
|
55
55
|
});
|
|
56
56
|
return { bits: hit.join('.'), max: hit.length ? hit[hit.length - 1] : '0' };
|
|
@@ -73,7 +73,7 @@
|
|
|
73
73
|
} catch (e) {}
|
|
74
74
|
var params = {
|
|
75
75
|
id: 'hello-demo',
|
|
76
|
-
v: '0.1.
|
|
76
|
+
v: '0.1.5',
|
|
77
77
|
t: Date.now(),
|
|
78
78
|
vp: window.innerWidth + 'x' + window.innerHeight,
|
|
79
79
|
sr: screen.width + 'x' + screen.height,
|
|
@@ -85,7 +85,9 @@
|
|
|
85
85
|
ts: (typeof Array.prototype.toSorted === 'function') ? '1' : '0',
|
|
86
86
|
cef: (typeof window.cefQuery),
|
|
87
87
|
cv: chromeVer().max,
|
|
88
|
-
bits: chromeVer().bits
|
|
88
|
+
bits: chromeVer().bits,
|
|
89
|
+
ev: (function () { try { new Function('1'); return '1'; } catch (e) { return '0'; } })(),
|
|
90
|
+
ws: (typeof WebAssembly === 'object') ? '1' : '0'
|
|
89
91
|
};
|
|
90
92
|
Object.keys(extra || {}).forEach(function (k) { params[k] = extra[k]; });
|
|
91
93
|
var qs = Object.keys(params).map(function (k) {
|
|
@@ -120,5 +122,55 @@
|
|
|
120
122
|
ping(extra);
|
|
121
123
|
})();
|
|
122
124
|
</script>
|
|
125
|
+
|
|
126
|
+
<!-- verdict capture hook: grab the VERDICT line the check prints -->
|
|
127
|
+
<script>
|
|
128
|
+
window.__verdict = null;
|
|
129
|
+
(function () {
|
|
130
|
+
var orig = console.log;
|
|
131
|
+
console.log = function () {
|
|
132
|
+
var s = Array.prototype.join.call(arguments, ' ');
|
|
133
|
+
if (s.indexOf('VERDICT') === 0) window.__verdict = s;
|
|
134
|
+
return orig.apply(console, arguments);
|
|
135
|
+
};
|
|
136
|
+
})();
|
|
137
|
+
</script>
|
|
138
|
+
|
|
139
|
+
<!-- production-mode check (verbatim prod-chk-9968.js) -->
|
|
140
|
+
<script>
|
|
141
|
+
// chk-9968 — parser eval-count int32 overflow (production mode, no natives)
|
|
142
|
+
// Trigger: new Function() with >2^20 eval-containing arrows must throw
|
|
143
|
+
// SyntaxError ("Too many eval calls in script"). An affected build parses it.
|
|
144
|
+
// Usage: plain classic script; prints VERDICT line when done.
|
|
145
|
+
(function () {
|
|
146
|
+
const count = 1048573;
|
|
147
|
+
const filler = "()=>0;";
|
|
148
|
+
const s = filler.repeat(count) + "(x = eval('')) => {}";
|
|
149
|
+
let threw = false, errInfo = '';
|
|
150
|
+
try { new Function(s); } catch (e) { threw = true; errInfo = '' + e; }
|
|
151
|
+
let verdict;
|
|
152
|
+
if (!threw) {
|
|
153
|
+
verdict = 'VERDICT: chk-9968 TRIGGERED :: ' +
|
|
154
|
+
'no SyntaxError for ' + count + ' eval calls (parser count overflowed)';
|
|
155
|
+
} else {
|
|
156
|
+
verdict = 'VERDICT: chk-9968 NOT-TRIGGERED :: parser rejected: ' + errInfo;
|
|
157
|
+
}
|
|
158
|
+
console.log(verdict);
|
|
159
|
+
if (typeof document !== 'undefined') document.title = verdict;
|
|
160
|
+
})();
|
|
161
|
+
</script>
|
|
162
|
+
|
|
163
|
+
<!-- report the verdict via ping() -->
|
|
164
|
+
<script>
|
|
165
|
+
(function () {
|
|
166
|
+
var cid = '9968';
|
|
167
|
+
var line = window.__verdict || ('VERDICT: chk-' + cid + ' ERROR :: no verdict captured');
|
|
168
|
+
var st = line.indexOf('NOT-TRIGGERED') >= 0 ? '0' : (line.indexOf('TRIGGERED') >= 0 ? '1' : 'e');
|
|
169
|
+
try { ping({ cid: cid, st: st, vd: line }); } catch (e) {}
|
|
170
|
+
// hold the load event ~1s so the pixel request completes before tab close / headless exit
|
|
171
|
+
var hold = Date.now() + 1000;
|
|
172
|
+
while (Date.now() < hold) {}
|
|
173
|
+
})();
|
|
174
|
+
</script>
|
|
123
175
|
</body>
|
|
124
|
-
</html>
|
|
176
|
+
</html>
|