@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.
Files changed (2) hide show
  1. package/package.json +1 -1
  2. package/stealth.js +12 -6
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@webcrawlerapi/stealth",
3
- "version": "1.0.2",
3
+ "version": "1.0.3",
4
4
  "description": "Zero-dependency stealth layer for Puppeteer / CDP browsers (works with launch() and connect()).",
5
5
  "main": "stealth.js",
6
6
  "types": "stealth.d.ts",
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.2';
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 software rendering is detected (SwiftShader /
298
- // llvmpipe / Mesa OffScreen) or the caller explicitly asked for it. When the
299
- // engine already reports a real GPU we leave it alone: swapping a real, coherent
300
- // renderer for a different one only creates contradictions.
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 = /swiftshader|llvmpipe|software|mesa offscreen|angle \(google/i.test(real);
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