@webcrawlerapi/stealth 1.0.2 → 1.0.3
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/stealth.js +12 -6
package/package.json
CHANGED
package/stealth.js
CHANGED
|
@@ -21,7 +21,7 @@ const UA =
|
|
|
21
21
|
'Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 ' +
|
|
22
22
|
'(KHTML, like Gecko) Chrome/151.0.0.0 Safari/537.36';
|
|
23
23
|
|
|
24
|
-
const VERSION = '1.0.
|
|
24
|
+
const VERSION = '1.0.3';
|
|
25
25
|
|
|
26
26
|
/* ------------------------------------------------------------------ *
|
|
27
27
|
* The in-page bootstrap. Runs inside every document before page JS. *
|
|
@@ -294,10 +294,14 @@ function buildInitScript(cfg) {
|
|
|
294
294
|
} catch (_) {}
|
|
295
295
|
|
|
296
296
|
// --- WebGL vendor / renderer ---
|
|
297
|
-
// Spoofing is applied only when
|
|
298
|
-
// llvmpipe / Mesa OffScreen
|
|
299
|
-
//
|
|
300
|
-
//
|
|
297
|
+
// Spoofing is applied only when the renderer gives the host away (software
|
|
298
|
+
// rendering such as SwiftShader / llvmpipe / Mesa OffScreen, or a server /
|
|
299
|
+
// datacenter GPU such as an NVIDIA L40S, A100, H100, T4 or vGPU slice) or the
|
|
300
|
+
// caller explicitly asked for it. When the engine reports an ordinary consumer
|
|
301
|
+
// GPU we leave it alone: swapping a real, coherent renderer for a different one
|
|
302
|
+
// only creates contradictions. A datacenter GPU is not a consumer GPU: real
|
|
303
|
+
// cloud-browser hosts (e.g. Kernel) expose one and bot protection (Reuters)
|
|
304
|
+
// blocks on it.
|
|
301
305
|
try {
|
|
302
306
|
let softwareGL = false;
|
|
303
307
|
try {
|
|
@@ -308,7 +312,9 @@ function buildInitScript(cfg) {
|
|
|
308
312
|
const real = dbg
|
|
309
313
|
? String(gl.getParameter(dbg.UNMASKED_RENDERER_WEBGL) || '')
|
|
310
314
|
: String(gl.getParameter(gl.RENDERER) || '');
|
|
311
|
-
softwareGL =
|
|
315
|
+
softwareGL =
|
|
316
|
+
/swiftshader|llvmpipe|software|mesa offscreen|angle \(google/i.test(real) ||
|
|
317
|
+
/\b(?:[AHL]\d{2,3}[A-Z]?|T4|V100|K80|P100|P4|GRID|Tesla|vGPU)\b|-\d+Q\b|NVIDIA (?:A|H|L)\d/i.test(real);
|
|
312
318
|
}
|
|
313
319
|
} catch (_) {}
|
|
314
320
|
|