Commit 5baa8bd
authored
fix: update handleCloudflareChallenge for new Cloudflare challenge markup (#3717)
## What
`handleCloudflareChallenge` stopped detecting the Cloudflare challenge.
Cloudflare inserted a `.footer-wrapper` element between `.footer-inner`
and `.diagnostic-wrapper` on the challenge page, which broke the
direct-child detection selector — so the helper returned immediately and
the request handler ran against an unsolved "Just a moment..." page
(exactly the report in #3629).
- Detection now matches by **descendants** (`.footer .footer-inner
.diagnostic-wrapper .ray-id`) so intervening wrappers don't break it.
- The click position now targets the **actual challenge widget** (the
box holding the Turnstile checkbox input), falling back to the old
`.main-content div` for older layouts.
## e2e alignment
The `camoufox-cloudflare` e2e was also a false green: its own
`isBlocked` check used the same broken selector, so the assertion always
passed. Fixed that selector, and aligned the browser stack —
`camoufox-js@^0.11.0` installs the Camoufox **150** (Firefox 150) build,
so the actor now uses **Playwright 1.60** (also Firefox 150). A
mismatched Firefox crashes playwright-core on Cloudflare's uncaught page
errors (`pageError.location` is undefined), so the versions must line
up.
Depends on camoufox-js ≥ 0.11.0 (apify/camoufox-js#283).
Closes #36291 parent 31512a3 commit 5baa8bd
5 files changed
Lines changed: 22 additions & 16 deletions
File tree
- packages/playwright-crawler/src/internals/utils
- test/e2e/camoufox-cloudflare/actor
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
87 | 87 | | |
88 | 88 | | |
89 | 89 | | |
90 | | - | |
| 90 | + | |
91 | 91 | | |
92 | 92 | | |
93 | 93 | | |
| |||
Lines changed: 8 additions & 2 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
753 | 753 | | |
754 | 754 | | |
755 | 755 | | |
756 | | - | |
| 756 | + | |
| 757 | + | |
| 758 | + | |
757 | 759 | | |
758 | 760 | | |
759 | 761 | | |
| |||
782 | 784 | | |
783 | 785 | | |
784 | 786 | | |
785 | | - | |
| 787 | + | |
| 788 | + | |
| 789 | + | |
| 790 | + | |
| 791 | + | |
786 | 792 | | |
787 | 793 | | |
788 | 794 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
28 | 28 | | |
29 | 29 | | |
30 | 30 | | |
31 | | - | |
| 31 | + | |
32 | 32 | | |
33 | 33 | | |
34 | 34 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
16 | | - | |
17 | | - | |
| 16 | + | |
| 17 | + | |
18 | 18 | | |
19 | 19 | | |
20 | 20 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1141 | 1141 | | |
1142 | 1142 | | |
1143 | 1143 | | |
1144 | | - | |
| 1144 | + | |
1145 | 1145 | | |
1146 | 1146 | | |
1147 | 1147 | | |
| |||
4401 | 4401 | | |
4402 | 4402 | | |
4403 | 4403 | | |
4404 | | - | |
4405 | | - | |
4406 | | - | |
| 4404 | + | |
| 4405 | + | |
| 4406 | + | |
4407 | 4407 | | |
4408 | 4408 | | |
4409 | 4409 | | |
4410 | 4410 | | |
4411 | | - | |
| 4411 | + | |
4412 | 4412 | | |
4413 | 4413 | | |
4414 | 4414 | | |
| |||
4764 | 4764 | | |
4765 | 4765 | | |
4766 | 4766 | | |
4767 | | - | |
4768 | | - | |
4769 | | - | |
| 4767 | + | |
| 4768 | + | |
| 4769 | + | |
4770 | 4770 | | |
4771 | 4771 | | |
4772 | | - | |
| 4772 | + | |
4773 | 4773 | | |
4774 | 4774 | | |
4775 | 4775 | | |
| |||
4784 | 4784 | | |
4785 | 4785 | | |
4786 | 4786 | | |
4787 | | - | |
| 4787 | + | |
4788 | 4788 | | |
4789 | 4789 | | |
4790 | 4790 | | |
| |||
0 commit comments