@intuned/runtime-dev 1.1.3-dev-00 → 1.1.3-dev-01

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.
@@ -48,8 +48,10 @@ async function getProductionPlaywrightConstructs({
48
48
  headless,
49
49
  viewport: null,
50
50
  proxy,
51
- downloadsPath
51
+ downloadsPath,
52
+ userAgent: "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_15_7) AppleWebKit/537.36 (KHTML, like Gecko) HeadlessChrome/130.0.6723.31 Safari/537.36"
52
53
  });
54
+ await context.addInitScript(fingerprintToScript());
53
55
  context.once("close", async () => {
54
56
  try {
55
57
  await (0, _fsExtra.rm)(userDataDir, {
@@ -185,4 +187,18 @@ async function getRemotePlaywrightContext(cdpAddress) {
185
187
  browser,
186
188
  context
187
189
  };
190
+ }
191
+ function fingerprintToScript() {
192
+ return `
193
+ (() => {
194
+
195
+ // WebGL Spoofing
196
+ const getParameterProxy = WebGLRenderingContext.prototype.getParameter;
197
+ WebGLRenderingContext.prototype.getParameter = function(param) {
198
+ if (param === 37445) return 'Google Inc. (Apple)';
199
+ if (param === 37446) return 'ANGLE (Apple, Apple M1 Pro, OpenGL 4.1)'; // UNMASKED_RENDERER_WEBGL
200
+ return getParameterProxy.call(this, param);
201
+ };
202
+ })();
203
+ `;
188
204
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@intuned/runtime-dev",
3
- "version": "1.1.3-dev-00",
3
+ "version": "1.1.3-dev-01",
4
4
  "description": "Intuned runtime",
5
5
  "exports": {
6
6
  ".": "./dist/index.js",