From 7be2f3515f48df84c92b69bf80be97f5c462498a Mon Sep 17 00:00:00 2001 From: zmzimpl Date: Sat, 14 Sep 2024 11:23:59 +0800 Subject: [PATCH] =?UTF-8?q?=E6=9C=AC=E5=9C=B0=20Chrome=20=E5=90=AF?= =?UTF-8?q?=E5=8A=A8=E6=A8=A1=E5=BC=8F=E4=B8=8B=E5=A2=9E=E5=8A=A0=20puppet?= =?UTF-8?q?eer=20=E8=B0=83=E8=AF=95=E7=9A=84=E5=BC=80=E5=85=B3?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 6 + package-lock.json | 548 +----------------- package.json | 3 - packages/main/src/fingerprint/index.ts | 39 +- packages/main/src/puppeteer/helpers.ts | 33 -- packages/main/src/security-restrictions.ts | 5 +- packages/main/src/utils/get-settings.ts | 1 + packages/renderer/src/i18n.ts | 35 +- packages/renderer/src/pages/api/index.tsx | 39 +- .../renderer/src/pages/settings/index.tsx | 8 + packages/shared/types/common.d.ts | 1 + 11 files changed, 120 insertions(+), 598 deletions(-) diff --git a/README.md b/README.md index 175c337..2ae20a5 100644 --- a/README.md +++ b/README.md @@ -64,6 +64,12 @@ Chromium 源码修改请参考 [chrome-power-chromium](https://github.com/zmzimp - [VirtualBrowser](https://github.com/Virtual-Browser/VirtualBrowser) - [toolBoxClient](https://github.com/web3ToolBoxDev/toolBoxClient) +## FAQ + +### Windows 10 安装之后闪退 + +尝试在安装完成之后,右键启动程序 - 属性,在目标的末尾加入 --no-sandbox 或者 --in-process-gpu,再尝试启动 + ## 打赏 🙌你可以通过向下面的钱包打赏一杯咖啡来支持我 diff --git a/package-lock.json b/package-lock.json index 1ecf996..0e28f68 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,18 +1,15 @@ { "name": "chrome-power", - "version": "1.1.1", + "version": "1.1.3", "lockfileVersion": 2, "requires": true, "packages": { "": { "name": "chrome-power", - "version": "1.1.1", + "version": "1.1.3", "hasInstallScript": true, "dependencies": { "@reduxjs/toolkit": "^1.9.7", - "@supabase/auth-ui-react": "^0.4.6", - "@supabase/auth-ui-shared": "^0.1.8", - "@supabase/supabase-js": "^2.38.4", "@types/portscanner": "^2.1.2", "@vitejs/plugin-react": "^4.0.4", "active-win": "^8.1.1", @@ -1938,101 +1935,6 @@ "url": "https://github.com/sindresorhus/is?sponsor=1" } }, - "node_modules/@stitches/core": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz", - "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==" - }, - "node_modules/@supabase/auth-ui-react": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/@supabase/auth-ui-react/-/auth-ui-react-0.4.6.tgz", - "integrity": "sha512-uvjcH/K0rvFKUE5Uam5JI6IGXUWSv55GTYcVRRQFEwfav2sT4hzBh6A0gkX9gEZEprhSA9S5Pp5+TzkCAKgcbg==", - "dependencies": { - "@stitches/core": "^1.2.8", - "@supabase/auth-ui-shared": "0.1.8", - "prop-types": "^15.7.2", - "react": "^18.2.0", - "react-dom": "^18.2.0" - }, - "peerDependencies": { - "@supabase/supabase-js": "^2.21.0" - } - }, - "node_modules/@supabase/auth-ui-shared": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@supabase/auth-ui-shared/-/auth-ui-shared-0.1.8.tgz", - "integrity": "sha512-ouQ0DjKcEFg+0gZigFIEgu01V3e6riGZPzgVD0MJsCBNsMsiDT74+GgCEIElMUpTGkwSja3xLwdFRFgMNFKcjg==", - "peerDependencies": { - "@supabase/supabase-js": "^2.21.0" - } - }, - "node_modules/@supabase/functions-js": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.5.tgz", - "integrity": "sha512-BNzC5XhCzzCaggJ8s53DP+WeHHGT/NfTsx2wUSSGKR2/ikLFQTBCDzMvGz/PxYMqRko/LwncQtKXGOYp1PkPaw==", - "dependencies": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "node_modules/@supabase/gotrue-js": { - "version": "2.57.0", - "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.57.0.tgz", - "integrity": "sha512-/CcAW40aPKgp9/w9WgXVUQFg1AOdvFR687ONOMjASPBuC6FsNbKlcXp4pc+rwKNtxyxDkBbR+x7zj/8g00r/Og==", - "dependencies": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "node_modules/@supabase/node-fetch": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/@supabase/node-fetch/-/node-fetch-2.6.14.tgz", - "integrity": "sha512-w/Tsd22e/5fAeoxqQ4P2MX6EyF+iM6rc9kmlMVFkHuG0rAltt2TLhFbDJfemnHbtvnazWaRfy5KnFU/SYT37dQ==", - "dependencies": { - "whatwg-url": "^5.0.0" - }, - "engines": { - "node": "4.x || >=6.0.0" - } - }, - "node_modules/@supabase/postgrest-js": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.8.5.tgz", - "integrity": "sha512-XvoqN5e5Z4TsQOYWLQYLW0HIlZtFSzwAcwiuToaSBSTpLOGCg4NaZ7au5GfBzCQJZdZPY5vk5FvwthfDsQK/Jw==", - "dependencies": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "node_modules/@supabase/realtime-js": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.8.4.tgz", - "integrity": "sha512-5C9slLTGikHnYmAnIBOaPogAgbcNY68vnIyE6GpqIKjHElVb6LIi4clwNcjHSj4z6szuvvzj8T/+ePEgGEGekw==", - "dependencies": { - "@supabase/node-fetch": "^2.6.14", - "@types/phoenix": "^1.5.4", - "@types/websocket": "^1.0.3", - "websocket": "^1.0.34" - } - }, - "node_modules/@supabase/storage-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.4.tgz", - "integrity": "sha512-yspHD19I9uQUgfTh0J94+/r/g6hnhdQmw6Y7OWqr/EbnL6uvicGV1i1UDkkmeUHqfF9Mbt2sLtuxRycYyKv2ew==", - "dependencies": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "node_modules/@supabase/supabase-js": { - "version": "2.38.4", - "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.38.4.tgz", - "integrity": "sha512-bYwxm/GosvRqOMIv6YP7qUTZWi/trgHtDWUEZDEmyRHW24d0JYIb1GOt6RaO2hsWlecn88DAJIpjoNbprocgRA==", - "dependencies": { - "@supabase/functions-js": "^2.1.5", - "@supabase/gotrue-js": "^2.56.0", - "@supabase/node-fetch": "^2.6.14", - "@supabase/postgrest-js": "^1.8.5", - "@supabase/realtime-js": "^2.8.4", - "@supabase/storage-js": "^2.5.4" - } - }, "node_modules/@szmarczak/http-timer": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", @@ -2282,12 +2184,8 @@ "node_modules/@types/node": { "version": "18.17.19", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.19.tgz", - "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==" - }, - "node_modules/@types/phoenix": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.3.tgz", - "integrity": "sha512-D8TtchWVnU2ZdPVDY6tBJuz8MUDmCNVduilZTrf0Gn/u5I/uZEXOsaL4Gs4F0j43cysHsU/4h7eqAKc+SF2boQ==" + "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==", + "devOptional": true }, "node_modules/@types/plist": { "version": "3.0.5", @@ -2411,14 +2309,6 @@ "dev": true, "optional": true }, - "node_modules/@types/websocket": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.8.tgz", - "integrity": "sha512-wvkOpWApbuxVfHhSQ1XrjVN4363vsfLJwEo4AboIZk0g1vJA5nmLp8GXUHuIdf4/Fe7+/V0Efe2HvWiLqHtlqw==", - "dependencies": { - "@types/node": "*" - } - }, "node_modules/@types/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", @@ -4395,6 +4285,8 @@ "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", "hasInstallScript": true, + "optional": true, + "peer": true, "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -5375,15 +5267,6 @@ "node": ">= 10" } }, - "node_modules/d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "dependencies": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, "node_modules/data-uri-to-buffer": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", @@ -6105,21 +5988,6 @@ "dev": true, "peer": true }, - "node_modules/es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "hasInstallScript": true, - "dependencies": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - }, - "engines": { - "node": ">=0.10" - } - }, "node_modules/es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -6127,25 +5995,6 @@ "dev": true, "optional": true }, - "node_modules/es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "dependencies": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "node_modules/es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "dependencies": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, "node_modules/esbuild": { "version": "0.18.11", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.11.tgz", @@ -6338,25 +6187,6 @@ "node": ">=6" } }, - "node_modules/esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "dependencies": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "engines": { - "node": ">=0.10" - } - }, - "node_modules/esniff/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - }, "node_modules/espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -6434,15 +6264,6 @@ "node": ">= 0.6" } }, - "node_modules/event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "dependencies": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, "node_modules/events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -6531,19 +6352,6 @@ } ] }, - "node_modules/ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "dependencies": { - "type": "^2.7.2" - } - }, - "node_modules/ext/node_modules/type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - }, "node_modules/extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -7772,11 +7580,6 @@ "url": "https://github.com/sponsors/sindresorhus" } }, - "node_modules/is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, "node_modules/isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -8727,11 +8530,6 @@ "node": ">= 0.4.0" } }, - "node_modules/next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, "node_modules/node-addon-api": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", @@ -8783,6 +8581,8 @@ "version": "4.6.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", + "optional": true, + "peer": true, "bin": { "node-gyp-build": "bin.js", "node-gyp-build-optional": "optional.js", @@ -12664,21 +12464,6 @@ "node": ">=10" } }, - "node_modules/prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "dependencies": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - } - }, - "node_modules/prop-types/node_modules/react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - }, "node_modules/protocol-buffers-schema": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", @@ -15216,11 +15001,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, - "node_modules/type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, "node_modules/type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -15271,14 +15051,6 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, - "node_modules/typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "dependencies": { - "is-typedarray": "^1.0.0" - } - }, "node_modules/typescript": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", @@ -15455,6 +15227,8 @@ "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", "hasInstallScript": true, + "optional": true, + "peer": true, "dependencies": { "node-gyp-build": "^4.3.0" }, @@ -15849,35 +15623,6 @@ "node": ">=4.0" } }, - "node_modules/websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "dependencies": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/websocket/node_modules/debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "dependencies": { - "ms": "2.0.0" - } - }, - "node_modules/websocket/node_modules/ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - }, "node_modules/whatwg-encoding": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", @@ -16119,14 +15864,6 @@ "node": ">=10" } }, - "node_modules/yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==", - "engines": { - "node": ">=0.10.32" - } - }, "node_modules/yaku": { "version": "0.16.7", "resolved": "https://registry.npmjs.org/yaku/-/yaku-0.16.7.tgz", @@ -17493,93 +17230,6 @@ "integrity": "sha512-t09vSN3MdfsyCHoFcTRCH/iUtG7OJ0CsjzB8cjAmKc/va/kIgeDI/TxsigdncE/4be734m0cvIYwNaV4i2XqAw==", "dev": true }, - "@stitches/core": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/@stitches/core/-/core-1.2.8.tgz", - "integrity": "sha512-Gfkvwk9o9kE9r9XNBmJRfV8zONvXThnm1tcuojL04Uy5uRyqg93DC83lDebl0rocZCfKSjUv+fWYtMQmEDJldg==" - }, - "@supabase/auth-ui-react": { - "version": "0.4.6", - "resolved": "https://registry.npmjs.org/@supabase/auth-ui-react/-/auth-ui-react-0.4.6.tgz", - "integrity": "sha512-uvjcH/K0rvFKUE5Uam5JI6IGXUWSv55GTYcVRRQFEwfav2sT4hzBh6A0gkX9gEZEprhSA9S5Pp5+TzkCAKgcbg==", - "requires": { - "@stitches/core": "^1.2.8", - "@supabase/auth-ui-shared": "0.1.8", - "prop-types": "^15.7.2", - "react": "^18.2.0", - "react-dom": "^18.2.0" - } - }, - "@supabase/auth-ui-shared": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/@supabase/auth-ui-shared/-/auth-ui-shared-0.1.8.tgz", - "integrity": "sha512-ouQ0DjKcEFg+0gZigFIEgu01V3e6riGZPzgVD0MJsCBNsMsiDT74+GgCEIElMUpTGkwSja3xLwdFRFgMNFKcjg==", - "requires": {} - }, - "@supabase/functions-js": { - "version": "2.1.5", - "resolved": "https://registry.npmjs.org/@supabase/functions-js/-/functions-js-2.1.5.tgz", - "integrity": "sha512-BNzC5XhCzzCaggJ8s53DP+WeHHGT/NfTsx2wUSSGKR2/ikLFQTBCDzMvGz/PxYMqRko/LwncQtKXGOYp1PkPaw==", - "requires": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "@supabase/gotrue-js": { - "version": "2.57.0", - "resolved": "https://registry.npmjs.org/@supabase/gotrue-js/-/gotrue-js-2.57.0.tgz", - "integrity": "sha512-/CcAW40aPKgp9/w9WgXVUQFg1AOdvFR687ONOMjASPBuC6FsNbKlcXp4pc+rwKNtxyxDkBbR+x7zj/8g00r/Og==", - "requires": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "@supabase/node-fetch": { - "version": "2.6.14", - "resolved": "https://registry.npmjs.org/@supabase/node-fetch/-/node-fetch-2.6.14.tgz", - "integrity": "sha512-w/Tsd22e/5fAeoxqQ4P2MX6EyF+iM6rc9kmlMVFkHuG0rAltt2TLhFbDJfemnHbtvnazWaRfy5KnFU/SYT37dQ==", - "requires": { - "whatwg-url": "^5.0.0" - } - }, - "@supabase/postgrest-js": { - "version": "1.8.5", - "resolved": "https://registry.npmjs.org/@supabase/postgrest-js/-/postgrest-js-1.8.5.tgz", - "integrity": "sha512-XvoqN5e5Z4TsQOYWLQYLW0HIlZtFSzwAcwiuToaSBSTpLOGCg4NaZ7au5GfBzCQJZdZPY5vk5FvwthfDsQK/Jw==", - "requires": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "@supabase/realtime-js": { - "version": "2.8.4", - "resolved": "https://registry.npmjs.org/@supabase/realtime-js/-/realtime-js-2.8.4.tgz", - "integrity": "sha512-5C9slLTGikHnYmAnIBOaPogAgbcNY68vnIyE6GpqIKjHElVb6LIi4clwNcjHSj4z6szuvvzj8T/+ePEgGEGekw==", - "requires": { - "@supabase/node-fetch": "^2.6.14", - "@types/phoenix": "^1.5.4", - "@types/websocket": "^1.0.3", - "websocket": "^1.0.34" - } - }, - "@supabase/storage-js": { - "version": "2.5.4", - "resolved": "https://registry.npmjs.org/@supabase/storage-js/-/storage-js-2.5.4.tgz", - "integrity": "sha512-yspHD19I9uQUgfTh0J94+/r/g6hnhdQmw6Y7OWqr/EbnL6uvicGV1i1UDkkmeUHqfF9Mbt2sLtuxRycYyKv2ew==", - "requires": { - "@supabase/node-fetch": "^2.6.14" - } - }, - "@supabase/supabase-js": { - "version": "2.38.4", - "resolved": "https://registry.npmjs.org/@supabase/supabase-js/-/supabase-js-2.38.4.tgz", - "integrity": "sha512-bYwxm/GosvRqOMIv6YP7qUTZWi/trgHtDWUEZDEmyRHW24d0JYIb1GOt6RaO2hsWlecn88DAJIpjoNbprocgRA==", - "requires": { - "@supabase/functions-js": "^2.1.5", - "@supabase/gotrue-js": "^2.56.0", - "@supabase/node-fetch": "^2.6.14", - "@supabase/postgrest-js": "^1.8.5", - "@supabase/realtime-js": "^2.8.4", - "@supabase/storage-js": "^2.5.4" - } - }, "@szmarczak/http-timer": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-4.0.6.tgz", @@ -17814,12 +17464,8 @@ "@types/node": { "version": "18.17.19", "resolved": "https://registry.npmjs.org/@types/node/-/node-18.17.19.tgz", - "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==" - }, - "@types/phoenix": { - "version": "1.6.3", - "resolved": "https://registry.npmjs.org/@types/phoenix/-/phoenix-1.6.3.tgz", - "integrity": "sha512-D8TtchWVnU2ZdPVDY6tBJuz8MUDmCNVduilZTrf0Gn/u5I/uZEXOsaL4Gs4F0j43cysHsU/4h7eqAKc+SF2boQ==" + "integrity": "sha512-+pMhShR3Or5GR0/sp4Da7FnhVmTalWm81M6MkEldbwjETSaPalw138Z4KdpQaistvqQxLB7Cy4xwYdxpbSOs9Q==", + "devOptional": true }, "@types/plist": { "version": "3.0.5", @@ -17943,14 +17589,6 @@ "dev": true, "optional": true }, - "@types/websocket": { - "version": "1.0.8", - "resolved": "https://registry.npmjs.org/@types/websocket/-/websocket-1.0.8.tgz", - "integrity": "sha512-wvkOpWApbuxVfHhSQ1XrjVN4363vsfLJwEo4AboIZk0g1vJA5nmLp8GXUHuIdf4/Fe7+/V0Efe2HvWiLqHtlqw==", - "requires": { - "@types/node": "*" - } - }, "@types/yauzl": { "version": "2.10.0", "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.0.tgz", @@ -19427,6 +19065,8 @@ "version": "4.0.8", "resolved": "https://registry.npmjs.org/bufferutil/-/bufferutil-4.0.8.tgz", "integrity": "sha512-4T53u4PdgsXqKaIctwF8ifXlRTTmEPJ8iEPWFdGZvcf7sbwYo6FKFEX9eNNAnzFZ7EzJAQ3CJeOtCRA4rDp7Pw==", + "optional": true, + "peer": true, "requires": { "node-gyp-build": "^4.3.0" } @@ -20153,15 +19793,6 @@ "minimist": "^1.2.0" } }, - "d": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/d/-/d-1.0.1.tgz", - "integrity": "sha512-m62ShEObQ39CfralilEQRjH6oAMtNCV1xJyEx5LpRYUVN+EviphDgUc/F3hnYbADmkiNs67Y+3ylmlG7Lnu+FA==", - "requires": { - "es5-ext": "^0.10.50", - "type": "^1.0.1" - } - }, "data-uri-to-buffer": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.1.tgz", @@ -20734,17 +20365,6 @@ "dev": true, "peer": true }, - "es5-ext": { - "version": "0.10.64", - "resolved": "https://registry.npmjs.org/es5-ext/-/es5-ext-0.10.64.tgz", - "integrity": "sha512-p2snDhiLaXe6dahss1LddxqEm+SkuDvV8dnIQG0MWjyHpcMNfXKPE+/Cc0y+PhxJX3A4xGNeFCj5oc0BUh6deg==", - "requires": { - "es6-iterator": "^2.0.3", - "es6-symbol": "^3.1.3", - "esniff": "^2.0.1", - "next-tick": "^1.1.0" - } - }, "es6-error": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", @@ -20752,25 +20372,6 @@ "dev": true, "optional": true }, - "es6-iterator": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/es6-iterator/-/es6-iterator-2.0.3.tgz", - "integrity": "sha512-zw4SRzoUkd+cl+ZoE15A9o1oQd920Bb0iOJMQkQhl3jNc03YqVjAhG7scf9C5KWRU/R13Orf588uCC6525o02g==", - "requires": { - "d": "1", - "es5-ext": "^0.10.35", - "es6-symbol": "^3.1.1" - } - }, - "es6-symbol": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/es6-symbol/-/es6-symbol-3.1.3.tgz", - "integrity": "sha512-NJ6Yn3FuDinBaBRWl/q5X/s4koRHBrgKAu+yGI6JCBeiu3qrcbJhwT2GeR/EXVfylRk8dpQVJoLEFhK+Mu31NA==", - "requires": { - "d": "^1.0.1", - "ext": "^1.1.2" - } - }, "esbuild": { "version": "0.18.11", "resolved": "https://registry.npmjs.org/esbuild/-/esbuild-0.18.11.tgz", @@ -20908,24 +20509,6 @@ "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==" }, - "esniff": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/esniff/-/esniff-2.0.1.tgz", - "integrity": "sha512-kTUIGKQ/mDPFoJ0oVfcmyJn4iBDRptjNVIzwIFR7tqWXdVI9xfA2RMwY/gbSpJG3lkdWNEjLap/NqVHZiJsdfg==", - "requires": { - "d": "^1.0.1", - "es5-ext": "^0.10.62", - "event-emitter": "^0.3.5", - "type": "^2.7.2" - }, - "dependencies": { - "type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - } - } - }, "espree": { "version": "9.6.1", "resolved": "https://registry.npmjs.org/espree/-/espree-9.6.1.tgz", @@ -20975,15 +20558,6 @@ "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==" }, - "event-emitter": { - "version": "0.3.5", - "resolved": "https://registry.npmjs.org/event-emitter/-/event-emitter-0.3.5.tgz", - "integrity": "sha512-D9rRn9y7kLPnJ+hMq7S/nhvoKwwvVJahBi2BPmx3bvbsEdK3W9ii8cBSGjP+72/LnM4n6fo3+dkCX5FeTQruXA==", - "requires": { - "d": "1", - "es5-ext": "~0.10.14" - } - }, "events": { "version": "3.3.0", "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", @@ -21054,21 +20628,6 @@ } } }, - "ext": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/ext/-/ext-1.7.0.tgz", - "integrity": "sha512-6hxeJYaL110a9b5TEJSj0gojyHQAmA2ch5Os+ySCiA1QGdS697XWY1pzsrSjqA9LDEEgdB/KypIlR59RcLuHYw==", - "requires": { - "type": "^2.7.2" - }, - "dependencies": { - "type": { - "version": "2.7.2", - "resolved": "https://registry.npmjs.org/type/-/type-2.7.2.tgz", - "integrity": "sha512-dzlvlNlt6AXU7EBSfpAscydQ7gXB+pPGsPnfJnZpiNJBDj7IaJzQlBZYGdEi4R9HmPdBv2XmWJ6YUtoTa7lmCw==" - } - } - }, "extract-zip": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", @@ -21991,11 +21550,6 @@ "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==" }, - "is-typedarray": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", - "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==" - }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -22720,11 +22274,6 @@ "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==" }, - "next-tick": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/next-tick/-/next-tick-1.1.0.tgz", - "integrity": "sha512-CXdUiJembsNjuToQvxayPZF9Vqht7hewsvy2sOWafLvi2awflj9mOC6bHIg50orX8IJvWKY9wYQ/zB2kogPslQ==" - }, "node-addon-api": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.0.0.tgz", @@ -22814,7 +22363,9 @@ "node-gyp-build": { "version": "4.6.1", "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.6.1.tgz", - "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==" + "integrity": "sha512-24vnklJmyRS8ViBNI8KbtK/r/DmXQMRiOMXTNz2nrTnAYUwjmEEbnnpB/+kt+yWRv73bPsSPRFddrcIbAxSiMQ==", + "optional": true, + "peer": true }, "node-releases": { "version": "2.0.13", @@ -25276,23 +24827,6 @@ "retry": "^0.12.0" } }, - "prop-types": { - "version": "15.8.1", - "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.8.1.tgz", - "integrity": "sha512-oj87CgZICdulUohogVAR7AjlC0327U4el4L6eAvOqCeudMDVU0NThNaV+b9Df4dXgSP1gXMTnPdhfe/2qDH5cg==", - "requires": { - "loose-envify": "^1.4.0", - "object-assign": "^4.1.1", - "react-is": "^16.13.1" - }, - "dependencies": { - "react-is": { - "version": "16.13.1", - "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.13.1.tgz", - "integrity": "sha512-24e6ynE2H+OKt4kqsOvNd8kBpV65zoxbA4BVsEOB3ARVWQki/DHzaUoC5KuON/BiccDaCCTZBuOcfZs70kR8bQ==" - } - } - }, "protocol-buffers-schema": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/protocol-buffers-schema/-/protocol-buffers-schema-3.6.0.tgz", @@ -27179,11 +26713,6 @@ "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.2.tgz", "integrity": "sha512-AEYxH93jGFPn/a2iVAwW87VuUIkR1FVUKB77NwMF7nBTDkDrrT/Hpt/IrCJ0QXhW27jTBDcf5ZY7w6RiqTMw2Q==" }, - "type": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/type/-/type-1.2.0.tgz", - "integrity": "sha512-+5nt5AAniqsCnu2cEQQdpzCAh33kVx8n0VoFidKpB1dVVLAN/F+bgVOqOJqOnEnrhp222clB5p3vUlD+1QAnfg==" - }, "type-check": { "version": "0.4.0", "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.4.0.tgz", @@ -27219,14 +26748,6 @@ "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==" }, - "typedarray-to-buffer": { - "version": "3.1.5", - "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", - "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", - "requires": { - "is-typedarray": "^1.0.0" - } - }, "typescript": { "version": "5.1.3", "resolved": "https://registry.npmjs.org/typescript/-/typescript-5.1.3.tgz", @@ -27360,6 +26881,8 @@ "version": "5.0.10", "resolved": "https://registry.npmjs.org/utf-8-validate/-/utf-8-validate-5.0.10.tgz", "integrity": "sha512-Z6czzLq4u8fPOyx7TU6X3dvUZVvoJmxSQ+IcrlmagKhilxlhZgxPK6C5Jqbkw1IDUmFTM+cz9QDnnLTwDz/2gQ==", + "optional": true, + "peer": true, "requires": { "node-gyp-build": "^4.3.0" } @@ -27602,34 +27125,6 @@ "integrity": "sha512-kyDivFZ7ZM0BVOUteVbDFhlRt7Ah/CSPwJdi8hBpkK7QLumUqdLtVfm/PX/hkcnrvr0i77fO5+TjZ94Pe+C9iw==", "dev": true }, - "websocket": { - "version": "1.0.34", - "resolved": "https://registry.npmjs.org/websocket/-/websocket-1.0.34.tgz", - "integrity": "sha512-PRDso2sGwF6kM75QykIesBijKSVceR6jL2G8NGYyq2XrItNC2P5/qL5XeR056GhA+Ly7JMFvJb9I312mJfmqnQ==", - "requires": { - "bufferutil": "^4.0.1", - "debug": "^2.2.0", - "es5-ext": "^0.10.50", - "typedarray-to-buffer": "^3.1.5", - "utf-8-validate": "^5.0.2", - "yaeti": "^0.0.6" - }, - "dependencies": { - "debug": { - "version": "2.6.9", - "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", - "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", - "requires": { - "ms": "2.0.0" - } - }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==" - } - } - }, "whatwg-encoding": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-2.0.0.tgz", @@ -27798,11 +27293,6 @@ "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==" }, - "yaeti": { - "version": "0.0.6", - "resolved": "https://registry.npmjs.org/yaeti/-/yaeti-0.0.6.tgz", - "integrity": "sha512-MvQa//+KcZCUkBTIC9blM+CU9J2GzuTytsOUwf2lidtvkx/6gnEp1QvJv34t9vdjhFmha/mUiNDbN0D0mJWdug==" - }, "yaku": { "version": "0.16.7", "resolved": "https://registry.npmjs.org/yaku/-/yaku-0.16.7.tgz", diff --git a/package.json b/package.json index 4cb2dfc..f8320c9 100644 --- a/package.json +++ b/package.json @@ -64,9 +64,6 @@ }, "dependencies": { "@reduxjs/toolkit": "^1.9.7", - "@supabase/auth-ui-react": "^0.4.6", - "@supabase/auth-ui-shared": "^0.1.8", - "@supabase/supabase-js": "^2.38.4", "@types/portscanner": "^2.1.2", "@vitejs/plugin-react": "^4.0.4", "active-win": "^8.1.1", diff --git a/packages/main/src/fingerprint/index.ts b/packages/main/src/fingerprint/index.ts index e1bb909..2d162ea 100644 --- a/packages/main/src/fingerprint/index.ts +++ b/packages/main/src/fingerprint/index.ts @@ -22,8 +22,8 @@ import {getPort} from '../server/index'; import {randomFingerprint} from '../services/window-service'; import {bridgeMessageToUI, getClientPort, getMainWindow} from '../mainWindow'; import {Mutex} from 'async-mutex'; -import {modifyPageInfo, presetCookie} from '../puppeteer/helpers'; - +import {presetCookie} from '../puppeteer/helpers'; +import {modifyPageInfo} from '../puppeteer/helpers'; const mutex = new Mutex(); const logger = createLogger(WINDOW_LOGGER_LABEL); @@ -37,6 +37,7 @@ async function connectBrowser( openStartPage: boolean = true, ) { const windowData = await WindowDB.getById(windowId); + const settings = getSettings(); const browserURL = `http://${HOST}:${port}`; const {data} = await api.get(browserURL + '/json/version'); if (data.webSocketDebuggerUrl) { @@ -58,9 +59,9 @@ async function connectBrowser( const newPage = await target.page(); if (newPage) { await newPage.waitForNavigation({waitUntil: 'networkidle0'}); - // await newPage.setRequestInterception(true); - // await pageRequestInterceptor(windowId, newPage); - await modifyPageInfo(windowId, newPage, ipInfo); + if (!settings.useLocalChrome) { + await modifyPageInfo(windowId, newPage, ipInfo); + } } }); const pages = await browser.pages(); @@ -72,12 +73,15 @@ async function connectBrowser( ? pages?.[0] : await browser.newPage(); try { - await modifyPageInfo(windowId, page, ipInfo); + if (!settings.useLocalChrome) { + await modifyPageInfo(windowId, page, ipInfo); + } if (getClientPort() && openStartPage) { await page.goto( `http://localhost:${getClientPort()}/#/start?windowId=${windowId}&serverPort=${getPort()}`, ); } + } catch (error) { logger.error(error); } @@ -143,6 +147,7 @@ export async function openFingerprintWindow(id: number, headless = false) { fingerprint, }); } + if (driverPath) { const chromePort = await getAvailablePort(); let finalProxy; @@ -165,7 +170,7 @@ export async function openFingerprintWindow(id: number, headless = false) { '--disable-background-mode', `--remote-debugging-port=${chromePort}`, `--user-data-dir=${windowDataDir}`, - `--user-agent=${fingerprint?.ua}`, + // `--user-agent=${fingerprint?.ua}`, '--unhandled-rejections=strict', // below is for debug // '--enable-logging', @@ -179,7 +184,7 @@ export async function openFingerprintWindow(id: number, headless = false) { if (finalProxy) { launchParamter.push(`--proxy-server=${finalProxy}`); } - if (ipInfo?.timeZone) { + if (ipInfo?.timeZone && !settings.useLocalChrome) { launchParamter.push(`--timezone=${ipInfo.timeZone}`); launchParamter.push(`--tz=${ipInfo.timeZone}`); } @@ -219,13 +224,25 @@ export async function openFingerprintWindow(id: number, headless = false) { logger.info('Http Proxy server was closed.'); }); } - await closeFingerprintWindow(id); + await closeFingerprintWindow(id, true); }); await sleep(1); try { - return connectBrowser(chromePort, ipInfo, windowData.id, !!windowData.proxy_id); + if (!settings.useLocalChrome || settings.automationConnect) { + return connectBrowser(chromePort, ipInfo, windowData.id, !!windowData.proxy_id); + } else { + await WindowDB.update(windowData.id, { + status: 2, + port: undefined, + opened_at: db.fn.now() as unknown as string, + }); + return { + window: windowData, + browser: { message: 'Automation connect is disabled' }, + }; + } } catch (error) { logger.error(error); execSync(`taskkill /PID ${chromeInstance.pid} /F`); @@ -300,7 +317,7 @@ export async function closeFingerprintWindow(id: number, force = false) { const port = window.port; const status = window.status; if (status > 1) { - if (force) { + if (force && port) { try { const browserURL = `http://${HOST}:${port}`; const browser = await puppeteer.connect({browserURL, defaultViewport: null}); diff --git a/packages/main/src/puppeteer/helpers.ts b/packages/main/src/puppeteer/helpers.ts index f1865e8..0a1ea65 100644 --- a/packages/main/src/puppeteer/helpers.ts +++ b/packages/main/src/puppeteer/helpers.ts @@ -98,39 +98,6 @@ export const presetCookie = async (windowId: number, browser: Browser) => { cookies: correctedCookie, }); await page.close(); - // cookieToMap(windowId, correctedCookie || []); - // const runTask = limitConcurrency(10); // 最多同时执行 10 个任务 - - // const cookieTasks: Promise[] = []; - // const cookiesMap = cookieMap.get(windowId); - - // if (cookiesMap) { - // cookiesMap.forEach((cookies, domain) => { - // cookieTasks.push( - // new Promise(resolve => { - // runTask(async () => { - // const page = await browser.newPage(); - // // 获取 CDP 会话 - // const client = await page.target().createCDPSession(); - // try { - // await client.send('Network.enable'); - // await client.send('Network.setCookies', { - // cookies: cookies, - // }); - // } catch (error) { - // console.log(domain, 'set cookie error:', error); - // } finally { - // await page.close(); - // } - // resolve(); - // }); - // }), - // ); - // }); - // } - - // await Promise.all(cookieTasks); - // } } } return true; diff --git a/packages/main/src/security-restrictions.ts b/packages/main/src/security-restrictions.ts index 7b05cb8..1427007 100644 --- a/packages/main/src/security-restrictions.ts +++ b/packages/main/src/security-restrictions.ts @@ -120,7 +120,10 @@ app.on('web-contents-created', (_, contents) => { delete webPreferences.preloadURL; // Disable Node.js integration - webPreferences.nodeIntegration = false; + webPreferences.nodeIntegration = true; + + // Disable webSecurity + webPreferences.webSecurity = false; // Enable contextIsolation webPreferences.contextIsolation = true; diff --git a/packages/main/src/utils/get-settings.ts b/packages/main/src/utils/get-settings.ts index f90b863..21a9326 100644 --- a/packages/main/src/utils/get-settings.ts +++ b/packages/main/src/utils/get-settings.ts @@ -10,6 +10,7 @@ export const getSettings = (): SettingOptions => { useLocalChrome: true, localChromePath: '', chromiumBinPath: '', + automationConnect: false, }; try { diff --git a/packages/renderer/src/i18n.ts b/packages/renderer/src/i18n.ts index c629cf9..cddfa0f 100644 --- a/packages/renderer/src/i18n.ts +++ b/packages/renderer/src/i18n.ts @@ -94,7 +94,7 @@ i18n settings_use_local_chrome: 'Use Chrome', settings_chrome_path: 'Chrome.exe Path', setting_chromium_path: 'Chromium Path', - + settings_automation_connect: 'Automation connect', footer_ok: 'OK', footer_cancel: 'Cancel', @@ -110,6 +110,22 @@ i18n header_language: 'Language', header_settings: 'Settings', header_sign_out: 'Sign out', + + // 英语 + api_title: 'API', + api_link: 'Document', + api_description: 'API is used for developers to connect to browser instances using `Puppeteer / Playwright / Selenium` and other automation tools to execute automation scripts. Non-developers do not need to use this feature.', + api_status: 'API Status', + api_url: 'API URL', + api_supported: 'Supported API', + api_control: 'Control Start/Stop', + api_getProfiles: 'Get all Profiles list', + api_openProfile: 'Open specified Profiles by ID (contains debugging link)', + api_closeProfile: 'Close specified Profiles by ID', + api_windows: 'Windows CRUD', + api_windowsDoc: 'Details Document', + api_proxy: 'Proxy CRUD', + api_proxyDoc: 'Details Document', }, }, zh: { @@ -198,7 +214,7 @@ i18n settings_use_local_chrome: '使用本地 Chrome', settings_chrome_path: 'Chrome.exe 路径', setting_chromium_path: 'Chromium 内核路径', - + settings_automation_connect: '自动化连接', footer_ok: '确定', footer_cancel: '取消', @@ -214,6 +230,21 @@ i18n header_settings: '设置', header_language: '语言', header_sign_out: '退出登录', + + api_title: 'API', + api_link: '接口文档', + api_description: 'API 作用于开发人员通过 `Puppeteer / Playwright / Selenium` 等自动化工具连接浏览器实例,执行自动化脚本,非开发人员无需使用此功能。', + api_status: '接口状态', + api_url: '接口 URL', + api_supported: '已支持接口', + api_control: '控制开启/关闭', + api_getProfiles: '获取所有 Profiles 列表', + api_openProfile: '根据 ID 打开指定 Profiles(返回值中有调试链接)', + api_closeProfile: '根据 ID 关闭指定 Profiles', + api_windows: 'Windows CRUD', + api_windowsDoc: '详情文档', + api_proxy: '代理 CRUD', + api_proxyDoc: '详情文档', }, }, }, diff --git a/packages/renderer/src/pages/api/index.tsx b/packages/renderer/src/pages/api/index.tsx index 0026829..f5978ac 100644 --- a/packages/renderer/src/pages/api/index.tsx +++ b/packages/renderer/src/pages/api/index.tsx @@ -4,7 +4,7 @@ import './index.css'; import {CommonBridge} from '#preload'; import {useEffect, useState} from 'react'; import {Divider, Typography, Form} from 'antd'; - +import {useTranslation} from 'react-i18next'; const {Title, Paragraph, Text, Link} = Typography; const Api = () => { @@ -13,6 +13,7 @@ const Api = () => { status: 'ok', port: undefined, }); + const {t} = useTranslation(); const fetchApi = async () => { const apiInfo = await CommonBridge.getApi(); setApiInfo(apiInfo); @@ -24,22 +25,22 @@ const Api = () => { return ( <> - API 详情{' '} + {t('api_title')} <Link + className="ml-2" href="https://documenter.getpostman.com/view/25586363/2sA3BkdZ61#intro" target="_blank" > - 查看 API 文档 + {t('api_link')} </Link> - API 作用于开发人员通过 Puppeteer / Playwright / Selenium{' '} - 等自动化工具连接浏览器实例,执行自动化脚本,非开发人员无需使用此功能。 + {t('api_description')} @@ -50,10 +51,10 @@ const Api = () => { wrapperCol={{span: 20}} style={{maxWidth: 600}} > - + {apiInfo.status} - + { - 已支持接口 - 控制开启/关闭 - * 获取所有 Profiles 列表 + {t('api_supported')} + {t('api_control')} + {t('api_getProfiles')} GET /profiles - * 根据 ID 打开指定 Profiles(返回值中有调试链接) + {t('api_openProfile')} GET /profiles/open?windowId=xxx - * 根据 ID 关闭指定 Profiles + {t('api_closeProfile')} GET /profiles/close?windowId=xxx - Windows CRUD - + {t('api_windows')} + - 详情文档 + {t('api_windowsDoc')} - 代理 CRUD - + {t('api.proxy')} + - 详情文档 + {t('api_proxyDoc')} diff --git a/packages/renderer/src/pages/settings/index.tsx b/packages/renderer/src/pages/settings/index.tsx index b755e81..da39933 100644 --- a/packages/renderer/src/pages/settings/index.tsx +++ b/packages/renderer/src/pages/settings/index.tsx @@ -9,6 +9,7 @@ type FieldType = { useLocalChrome: boolean; localChromePath: string; chromiumBinPath: string; + automationConnect: boolean; }; const Settings = () => { @@ -17,6 +18,7 @@ const Settings = () => { useLocalChrome: true, localChromePath: '', chromiumBinPath: '', + automationConnect: false, }); const [form] = Form.useForm(); const {t} = useTranslation(); @@ -137,6 +139,12 @@ const Settings = () => { )} + + label={t('settings_automation_connect')} + name="automationConnect" + > + + {/*
diff --git a/packages/shared/types/common.d.ts b/packages/shared/types/common.d.ts index c45325b..7eb4d47 100644 --- a/packages/shared/types/common.d.ts +++ b/packages/shared/types/common.d.ts @@ -9,6 +9,7 @@ export interface SettingOptions { useLocalChrome: boolean; localChromePath: string; chromiumBinPath: string; + automationConnect: boolean; } export type NoticeType = 'info' | 'success' | 'error' | 'warning' | 'loading';