@prosopo/procaptcha-frictionless 2.12.0 → 2.12.2
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/.turbo/turbo-build$colon$cjs.log +3 -3
- package/.turbo/turbo-build$colon$tsc.log +25 -25
- package/.turbo/turbo-build.log +4 -4
- package/CHANGELOG.md +37 -0
- package/dist/cjs/customDetectBot.cjs +12 -1
- package/dist/customDetectBot.d.ts.map +1 -1
- package/dist/customDetectBot.js +12 -1
- package/dist/customDetectBot.js.map +1 -1
- package/package.json +11 -11
- package/src/customDetectBot.ts +19 -0
- package/src/tests/customDetectBotSimd.test.ts +1 -1
- package/tsconfig.tsbuildinfo +1 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-frictionless@2.12.
|
|
2
|
+
> @prosopo/procaptcha-frictionless@2.12.2 build:cjs
|
|
3
3
|
> NODE_ENV=${NODE_ENV:-development}; vite build --config vite.cjs.config.ts --mode $NODE_ENV
|
|
4
4
|
|
|
5
5
|
ViteCommonJSConfig: .
|
|
@@ -60,6 +60,6 @@ Build end
|
|
|
60
60
|
rendering chunks...
|
|
61
61
|
[2mdist/cjs/[22m[36mindex.cjs [39m[1m[2m0.24 kB[22m[1m[22m
|
|
62
62
|
[2mdist/cjs/[22m[36mdetectorLoader.cjs [39m[1m[2m1.37 kB[22m[1m[22m
|
|
63
|
-
[2mdist/cjs/[22m[36mcustomDetectBot.cjs [39m[1m[2m3.
|
|
63
|
+
[2mdist/cjs/[22m[36mcustomDetectBot.cjs [39m[1m[2m3.34 kB[22m[1m[22m
|
|
64
64
|
[2mdist/cjs/[22m[36mProcaptchaFrictionless.cjs [39m[1m[2m7.98 kB[22m[1m[22m
|
|
65
|
-
[32m✓ built in
|
|
65
|
+
[32m✓ built in 120ms[39m
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-frictionless@2.12.
|
|
2
|
+
> @prosopo/procaptcha-frictionless@2.12.2 build:tsc
|
|
3
3
|
> tsc --build --verbose
|
|
4
4
|
|
|
5
|
-
|
|
5
|
+
11:38:11 AM - Projects in this build:
|
|
6
6
|
* ../../dev/config/tsconfig.json
|
|
7
7
|
* ../locale/tsconfig.json
|
|
8
8
|
* ../util/tsconfig.json
|
|
@@ -26,49 +26,49 @@
|
|
|
26
26
|
* ../procaptcha-react/tsconfig.json
|
|
27
27
|
* tsconfig.json
|
|
28
28
|
|
|
29
|
-
|
|
29
|
+
11:38:11 AM - Project '../../dev/config/tsconfig.json' is up to date because newest input '../../dev/config/src/webpack/webpack.config.ts' is older than output '../../dev/config/tsconfig.tsbuildinfo'
|
|
30
30
|
|
|
31
|
-
|
|
31
|
+
11:38:11 AM - Project '../locale/tsconfig.json' is up to date because newest input '../locale/src/translationKey.ts' is older than output '../locale/tsconfig.tsbuildinfo'
|
|
32
32
|
|
|
33
|
-
|
|
33
|
+
11:38:11 AM - Project '../util/tsconfig.json' is up to date because newest input '../util/src/url.ts' is older than output '../util/tsconfig.tsbuildinfo'
|
|
34
34
|
|
|
35
|
-
|
|
35
|
+
11:38:11 AM - Project '../util-crypto/tsconfig.json' is up to date because newest input '../util-crypto/src/types.ts' is older than output '../util-crypto/tsconfig.tsbuildinfo'
|
|
36
36
|
|
|
37
|
-
|
|
37
|
+
11:38:11 AM - Project '../types/tsconfig.json' is up to date because newest input '../types/src/keyring/keyring/types.ts' is older than output '../types/tsconfig.tsbuildinfo'
|
|
38
38
|
|
|
39
|
-
|
|
39
|
+
11:38:11 AM - Project '../detector/tsconfig.json' is up to date because newest input '../detector/src/index.js' is older than output '../detector/tsconfig.tsbuildinfo'
|
|
40
40
|
|
|
41
|
-
|
|
41
|
+
11:38:11 AM - Project '../api/tsconfig.json' is up to date because newest input '../api/src/index.ts' is older than output '../api/tsconfig.tsbuildinfo'
|
|
42
42
|
|
|
43
|
-
|
|
43
|
+
11:38:11 AM - Project '../logger/tsconfig.json' is up to date because newest input '../logger/src/index.ts' is older than output '../logger/tsconfig.tsbuildinfo'
|
|
44
44
|
|
|
45
|
-
|
|
45
|
+
11:38:11 AM - Project '../common/tsconfig.json' is up to date because newest input '../common/src/error.ts' is older than output '../common/tsconfig.tsbuildinfo'
|
|
46
46
|
|
|
47
|
-
|
|
47
|
+
11:38:11 AM - Project '../fingerprintjs/tsconfig.json' is up to date because newest input '../fingerprintjs/src/utils/browser.ts' is older than output '../fingerprintjs/tsconfig.tsbuildinfo'
|
|
48
48
|
|
|
49
|
-
|
|
49
|
+
11:38:11 AM - Project '../fingerprint/tsconfig.json' is up to date because newest input '../fingerprint/src/index.ts' is older than output '../fingerprint/tsconfig.tsbuildinfo'
|
|
50
50
|
|
|
51
|
-
|
|
51
|
+
11:38:11 AM - Project '../load-balancer/tsconfig.json' is up to date because newest input '../load-balancer/src/index.ts' is older than output '../load-balancer/tsconfig.tsbuildinfo'
|
|
52
52
|
|
|
53
|
-
|
|
53
|
+
11:38:11 AM - Project '../widget-skeleton/tsconfig.json' is up to date because newest input '../widget-skeleton/src/index.ts' is older than output '../widget-skeleton/tsconfig.tsbuildinfo'
|
|
54
54
|
|
|
55
|
-
|
|
55
|
+
11:38:11 AM - Project '../keyring/tsconfig.json' is up to date because newest input '../keyring/src/keyring/keyring.ts' is older than output '../keyring/tsconfig.tsbuildinfo'
|
|
56
56
|
|
|
57
|
-
|
|
57
|
+
11:38:11 AM - Project '../account/tsconfig.json' is up to date because newest input '../account/src/index.ts' is older than output '../account/tsconfig.tsbuildinfo'
|
|
58
58
|
|
|
59
|
-
|
|
59
|
+
11:38:11 AM - Project '../procaptcha-common/tsconfig.json' is up to date because newest input '../procaptcha-common/src/extensionLoader.ts' is older than output '../procaptcha-common/tsconfig.tsbuildinfo'
|
|
60
60
|
|
|
61
|
-
|
|
61
|
+
11:38:11 AM - Project '../procaptcha-pow/tsconfig.json' is up to date because newest input '../procaptcha-pow/src/index.ts' is older than output '../procaptcha-pow/tsconfig.tsbuildinfo'
|
|
62
62
|
|
|
63
|
-
|
|
63
|
+
11:38:11 AM - Project '../procaptcha-puzzle/tsconfig.json' is up to date because newest input '../procaptcha-puzzle/src/index.ts' is older than output '../procaptcha-puzzle/tsconfig.tsbuildinfo'
|
|
64
64
|
|
|
65
|
-
|
|
65
|
+
11:38:11 AM - Project '../datasets/tsconfig.json' is up to date because newest input '../datasets/src/tests/mocks/data/captchas.ts' is older than output '../datasets/tsconfig.tsbuildinfo'
|
|
66
66
|
|
|
67
|
-
|
|
67
|
+
11:38:11 AM - Project '../procaptcha/tsconfig.json' is up to date because newest input '../procaptcha/src/index.ts' is older than output '../procaptcha/tsconfig.tsbuildinfo'
|
|
68
68
|
|
|
69
|
-
|
|
69
|
+
11:38:12 AM - Project '../procaptcha-react/tsconfig.json' is up to date because newest input '../procaptcha-react/src/index.ts' is older than output '../procaptcha-react/tsconfig.tsbuildinfo'
|
|
70
70
|
|
|
71
|
-
|
|
71
|
+
11:38:12 AM - Project 'tsconfig.json' is out of date because output file 'tsconfig.tsbuildinfo' does not exist
|
|
72
72
|
|
|
73
|
-
|
|
73
|
+
11:38:12 AM - Building project '/home/runner/work/captcha/captcha/packages/procaptcha-frictionless/tsconfig.json'...
|
|
74
74
|
|
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
|
|
2
|
-
> @prosopo/procaptcha-frictionless@2.12.
|
|
2
|
+
> @prosopo/procaptcha-frictionless@2.12.2 build
|
|
3
3
|
> npm run build:cross-env -- --mode ${NODE_ENV:-development}
|
|
4
4
|
|
|
5
5
|
|
|
6
|
-
> @prosopo/procaptcha-frictionless@2.12.
|
|
6
|
+
> @prosopo/procaptcha-frictionless@2.12.2 build:cross-env
|
|
7
7
|
> vite build --config vite.esm.config.ts --mode production
|
|
8
8
|
|
|
9
9
|
ViteEsmConfig: .
|
|
@@ -63,6 +63,6 @@ Build end
|
|
|
63
63
|
rendering chunks...
|
|
64
64
|
[2mdist/[22m[36mindex.js [39m[1m[2m0.11 kB[22m[1m[22m
|
|
65
65
|
[2mdist/[22m[36mdetectorLoader.js [39m[1m[2m0.11 kB[22m[1m[22m
|
|
66
|
-
[2mdist/[22m[36mcustomDetectBot.js [39m[1m[
|
|
66
|
+
[2mdist/[22m[36mcustomDetectBot.js [39m[1m[2m3.16 kB[22m[1m[22m
|
|
67
67
|
[2mdist/[22m[36mProcaptchaFrictionless.js [39m[1m[2m6.59 kB[22m[1m[22m
|
|
68
|
-
[32m✓ built in
|
|
68
|
+
[32m✓ built in 166ms[39m
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,42 @@
|
|
|
1
1
|
# @prosopo/procaptcha-frictionless
|
|
2
2
|
|
|
3
|
+
## 2.12.2
|
|
4
|
+
### Patch Changes
|
|
5
|
+
|
|
6
|
+
- 970bca2: feat(provider): record the page URL a frictionless session originated from and require it
|
|
7
|
+
|
|
8
|
+
The frictionless client now reports the page it was rendered on (built from `window.location.origin + pathname`) in the challenge request, and the provider stores it on the session as `currentUrl`. The value is reduced to scheme + host + path on both the client and the provider (`sanitisePageUrl`): the query string, fragment and any embedded `user:pass@` credentials are stripped so URL-borne secrets (tokens, reset codes, session ids) are never persisted. A session whose request carries no usable page URL is treated as a bot signal and forced down the image-captcha path (`FrictionlessReason.MISSING_CURRENT_URL`).
|
|
9
|
+
- Updated dependencies [8986976]
|
|
10
|
+
- Updated dependencies [970bca2]
|
|
11
|
+
- @prosopo/types@4.9.1
|
|
12
|
+
- @prosopo/api@3.5.7
|
|
13
|
+
- @prosopo/common@3.1.42
|
|
14
|
+
- @prosopo/detector@3.5.2
|
|
15
|
+
- @prosopo/procaptcha-common@2.11.2
|
|
16
|
+
- @prosopo/procaptcha-pow@2.10.7
|
|
17
|
+
- @prosopo/procaptcha-puzzle@2.10.22
|
|
18
|
+
- @prosopo/procaptcha-react@2.9.80
|
|
19
|
+
|
|
20
|
+
## 2.12.1
|
|
21
|
+
### Patch Changes
|
|
22
|
+
|
|
23
|
+
- Updated dependencies [dfb0c53]
|
|
24
|
+
- Updated dependencies [6ecc576]
|
|
25
|
+
- Updated dependencies [619dc9f]
|
|
26
|
+
- Updated dependencies [11f1e8c]
|
|
27
|
+
- Updated dependencies [b166037]
|
|
28
|
+
- Updated dependencies [1111ff2]
|
|
29
|
+
- Updated dependencies [6a7b122]
|
|
30
|
+
- @prosopo/common@3.1.41
|
|
31
|
+
- @prosopo/widget-skeleton@2.8.4
|
|
32
|
+
- @prosopo/types@4.9.0
|
|
33
|
+
- @prosopo/api@3.5.6
|
|
34
|
+
- @prosopo/detector@3.5.1
|
|
35
|
+
- @prosopo/procaptcha-common@2.11.1
|
|
36
|
+
- @prosopo/procaptcha-pow@2.10.6
|
|
37
|
+
- @prosopo/procaptcha-puzzle@2.10.21
|
|
38
|
+
- @prosopo/procaptcha-react@2.9.79
|
|
39
|
+
|
|
3
40
|
## 2.12.0
|
|
4
41
|
### Minor Changes
|
|
5
42
|
|
|
@@ -4,6 +4,16 @@ const api = require("@prosopo/api");
|
|
|
4
4
|
const common = require("@prosopo/common");
|
|
5
5
|
const procaptchaCommon = require("@prosopo/procaptcha-common");
|
|
6
6
|
const detectorLoader = require("./detectorLoader.cjs");
|
|
7
|
+
const getCurrentPageUrl = () => {
|
|
8
|
+
if (typeof window === "undefined" || !window.location) {
|
|
9
|
+
return void 0;
|
|
10
|
+
}
|
|
11
|
+
const { origin, pathname } = window.location;
|
|
12
|
+
if (!origin || origin === "null") {
|
|
13
|
+
return void 0;
|
|
14
|
+
}
|
|
15
|
+
return `${origin}${pathname || ""}`;
|
|
16
|
+
};
|
|
7
17
|
const withTimeout = async (promise, ms) => {
|
|
8
18
|
let timeoutId;
|
|
9
19
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -55,7 +65,8 @@ const customDetectBot = async (config, container, restartFn) => {
|
|
|
55
65
|
config.account.address,
|
|
56
66
|
userAccount.account.address,
|
|
57
67
|
config.mode,
|
|
58
|
-
void 0
|
|
68
|
+
void 0,
|
|
69
|
+
getCurrentPageUrl()
|
|
59
70
|
);
|
|
60
71
|
if (detectionResult.getSimdReadings) {
|
|
61
72
|
void detectionResult.getSimdReadings(6e4).catch(() => void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACX,oBAAoB,EAEpB,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"customDetectBot.d.ts","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAqBA,OAAO,KAAK,EACX,oBAAoB,EAEpB,MAAM,gBAAgB,CAAC;AAsBxB,eAAO,MAAM,WAAW,GAAU,CAAC,WACzB,OAAO,CAAC,CAAC,CAAC,MACf,MAAM,KACR,OAAO,CAAC,CAAC,CAoBX,CAAC;AAEF,QAAA,MAAM,eAAe,EAAE,oBAmGtB,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/dist/customDetectBot.js
CHANGED
|
@@ -2,6 +2,16 @@ import { ProviderApi } from "@prosopo/api";
|
|
|
2
2
|
import { ProsopoEnvError } from "@prosopo/common";
|
|
3
3
|
import { ExtensionLoader, getProcaptchaRandomActiveProvider, pickIpMode } from "@prosopo/procaptcha-common";
|
|
4
4
|
import { DetectorLoader } from "./detectorLoader.js";
|
|
5
|
+
const getCurrentPageUrl = () => {
|
|
6
|
+
if (typeof window === "undefined" || !window.location) {
|
|
7
|
+
return void 0;
|
|
8
|
+
}
|
|
9
|
+
const { origin, pathname } = window.location;
|
|
10
|
+
if (!origin || origin === "null") {
|
|
11
|
+
return void 0;
|
|
12
|
+
}
|
|
13
|
+
return `${origin}${pathname || ""}`;
|
|
14
|
+
};
|
|
5
15
|
const withTimeout = async (promise, ms) => {
|
|
6
16
|
let timeoutId;
|
|
7
17
|
const timeoutPromise = new Promise((_, reject) => {
|
|
@@ -53,7 +63,8 @@ const customDetectBot = async (config, container, restartFn) => {
|
|
|
53
63
|
config.account.address,
|
|
54
64
|
userAccount.account.address,
|
|
55
65
|
config.mode,
|
|
56
|
-
void 0
|
|
66
|
+
void 0,
|
|
67
|
+
getCurrentPageUrl()
|
|
57
68
|
);
|
|
58
69
|
if (detectionResult.getSimdReadings) {
|
|
59
70
|
void detectionResult.getSimdReadings(6e4).catch(() => void 0);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"customDetectBot.js","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,eAAe,EACf,iCAAiC,EACjC,UAAU,GACV,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;
|
|
1
|
+
{"version":3,"file":"customDetectBot.js","sourceRoot":"","sources":["../src/customDetectBot.ts"],"names":[],"mappings":"AAcA,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAC3C,OAAO,EAAE,eAAe,EAAE,MAAM,iBAAiB,CAAC;AAClD,OAAO,EACN,eAAe,EACf,iCAAiC,EACjC,UAAU,GACV,MAAM,4BAA4B,CAAC;AAMpC,OAAO,EAAE,cAAc,EAAE,MAAM,qBAAqB,CAAC;AASrD,MAAM,iBAAiB,GAAG,GAAuB,EAAE;IAClD,IAAI,OAAO,MAAM,KAAK,WAAW,IAAI,CAAC,MAAM,CAAC,QAAQ,EAAE,CAAC;QACvD,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,MAAM,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,MAAM,CAAC,QAAQ,CAAC;IAC7C,IAAI,CAAC,MAAM,IAAI,MAAM,KAAK,MAAM,EAAE,CAAC;QAClC,OAAO,SAAS,CAAC;IAClB,CAAC;IACD,OAAO,GAAG,MAAM,GAAG,QAAQ,IAAI,EAAE,EAAE,C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,CAAC;QAET,CAAC;IACF,CAAC;IAED,OAAO;QACN,WAAW,EAAE,OAAO,CAAC,WAAW;QAChC,SAAS,EAAE,OAAO,CAAC,SAAS;QAC5B,QAAQ,EAAE,QAAQ;QAClB,MAAM,EAAE,OAAO,CAAC,MAAM;QACtB,WAAW,EAAE,WAAW;QACxB,KAAK,EAAE,OAAO,CAAC,KAAK;QACpB,EAAE,EAAE,OAAO,CAAC,EAAE;QAEd,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,kBAAkB,EAAE,eAAe,CAAC,YAAY;QAChD,gBAAgB,EAAE,eAAe,CAAC,eAAe;QACjD,qBAAqB,EAAE,eAAe,CAAC,qBAAqB;QAC5D,kBAAkB,EAAE,eAAe,CAAC,kBAAkB;QACtD,eAAe,EAAE,eAAe,CAAC,eAAe;KAChD,CAAC;AACH,CAAC,CAAC;AAEF,eAAe,eAAe,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@prosopo/procaptcha-frictionless",
|
|
3
|
-
"version": "2.12.
|
|
3
|
+
"version": "2.12.2",
|
|
4
4
|
"author": "PROSOPO LIMITED <info@prosopo.io>",
|
|
5
5
|
"license": "Apache-2.0",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -30,21 +30,21 @@
|
|
|
30
30
|
},
|
|
31
31
|
"browserslist": ["> 0.5%, last 2 versions, not dead"],
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@prosopo/api": "3.5.
|
|
34
|
-
"@prosopo/common": "3.1.
|
|
35
|
-
"@prosopo/detector": "3.5.
|
|
33
|
+
"@prosopo/api": "3.5.7",
|
|
34
|
+
"@prosopo/common": "3.1.42",
|
|
35
|
+
"@prosopo/detector": "3.5.2",
|
|
36
36
|
"@prosopo/locale": "3.2.5",
|
|
37
|
-
"@prosopo/procaptcha-common": "2.11.
|
|
38
|
-
"@prosopo/procaptcha-pow": "2.10.
|
|
39
|
-
"@prosopo/procaptcha-puzzle": "2.10.
|
|
40
|
-
"@prosopo/procaptcha-react": "2.9.
|
|
41
|
-
"@prosopo/types": "4.
|
|
42
|
-
"@prosopo/widget-skeleton": "2.8.
|
|
37
|
+
"@prosopo/procaptcha-common": "2.11.2",
|
|
38
|
+
"@prosopo/procaptcha-pow": "2.10.7",
|
|
39
|
+
"@prosopo/procaptcha-puzzle": "2.10.22",
|
|
40
|
+
"@prosopo/procaptcha-react": "2.9.80",
|
|
41
|
+
"@prosopo/types": "4.9.1",
|
|
42
|
+
"@prosopo/widget-skeleton": "2.8.4",
|
|
43
43
|
"dotenv": "16.4.5",
|
|
44
44
|
"react": "18.3.1"
|
|
45
45
|
},
|
|
46
46
|
"devDependencies": {
|
|
47
|
-
"@prosopo/config": "3.3.
|
|
47
|
+
"@prosopo/config": "3.3.4",
|
|
48
48
|
"@types/node": "22.10.2",
|
|
49
49
|
"@vitest/coverage-v8": "3.2.4",
|
|
50
50
|
"concurrently": "9.0.1",
|
package/src/customDetectBot.ts
CHANGED
|
@@ -26,6 +26,24 @@ import type {
|
|
|
26
26
|
import type { BotDetectionFunctionResult } from "@prosopo/types";
|
|
27
27
|
import { DetectorLoader } from "./detectorLoader.js";
|
|
28
28
|
|
|
29
|
+
// The page the widget is rendered on, reduced to origin + path. Deliberately
|
|
30
|
+
// built from `origin` + `pathname` (never `href`) so the query string,
|
|
31
|
+
// fragment, and any embedded `user:pass@` credentials never leave the browser
|
|
32
|
+
// — sites routinely carry tokens / session ids / reset codes in those parts.
|
|
33
|
+
// Returns undefined in non-browser contexts (SSR / tests) or for opaque
|
|
34
|
+
// origins; the provider then treats the session as having no page URL and
|
|
35
|
+
// forces an image captcha.
|
|
36
|
+
const getCurrentPageUrl = (): string | undefined => {
|
|
37
|
+
if (typeof window === "undefined" || !window.location) {
|
|
38
|
+
return undefined;
|
|
39
|
+
}
|
|
40
|
+
const { origin, pathname } = window.location;
|
|
41
|
+
if (!origin || origin === "null") {
|
|
42
|
+
return undefined;
|
|
43
|
+
}
|
|
44
|
+
return `${origin}${pathname || ""}`;
|
|
45
|
+
};
|
|
46
|
+
|
|
29
47
|
export const withTimeout = async <T>(
|
|
30
48
|
promise: Promise<T>,
|
|
31
49
|
ms: number,
|
|
@@ -108,6 +126,7 @@ const customDetectBot: BotDetectionFunction = async (
|
|
|
108
126
|
userAccount.account.address,
|
|
109
127
|
config.mode,
|
|
110
128
|
undefined,
|
|
129
|
+
getCurrentPageUrl(),
|
|
111
130
|
);
|
|
112
131
|
if (detectionResult.getSimdReadings) {
|
|
113
132
|
// Fire-and-forget: triggers the memoised prefetch inside the catcher
|
|
@@ -93,7 +93,7 @@ describe("customDetectBot SIMD deferral", () => {
|
|
|
93
93
|
|
|
94
94
|
expect(mocks.getFrictionlessCaptcha).toHaveBeenCalledTimes(1);
|
|
95
95
|
const args = mocks.getFrictionlessCaptcha.mock.calls[0];
|
|
96
|
-
// args: token, headHash, dappAccount, userAccount, mode, simdReadings
|
|
96
|
+
// args: token, headHash, dappAccount, userAccount, mode, simdReadings, currentUrl
|
|
97
97
|
expect(args?.[5]).toBeUndefined();
|
|
98
98
|
});
|
|
99
99
|
|