Fix personal nodriver evaluate normalization#120
Merged
genz27 merged 3 commits intoTheSmallHanCat:mainfrom Apr 17, 2026
Merged
Conversation
anthony9981
reviewed
Apr 14, 2026
| if return_by_value: | ||
| return self._normalize_nodriver_evaluate_result(result) | ||
| return result | ||
| return self._normalize_nodriver_evaluate_result(result) |
There was a problem hiding this comment.
Remove return_by_value check is not good, change default value above to True is better
Contributor
Author
There was a problem hiding this comment.
Addressed in 8a8f5c4: I kept the return_by_value switch, changed its default to true, and only normalize when return_by_value is enabled. This preserves the non-value path while making existing evaluate callers return plain Python values by default.
Contributor
Author
|
Updated per review: _tab_evaluate now keeps the return_by_value switch, but defaults it to true so the nodriver evaluate result is normalized by default for existing internal callers. The non-value path is still preserved if it is needed later. |
genz27
approved these changes
Apr 17, 2026
Collaborator
genz27
left a comment
There was a problem hiding this comment.
已同步 main,冲突已解决,并完成本地测试验证。
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
nodrivertab.evaluate()results in personal captcha modepersonalscore-test DOM parsing and restores full browser fingerprint extractionReproduction
I reproduced this against current upstream
mainlocally withBrowserCaptchaService.get_custom_score()onhttps://antcpt.com/score_detector/.Before this patch:
verify_resultended assuccess=falsewithsource=antcpt_dom_timeoutget_last_fingerprint()only had the fallback UA/lang because the full object was not parsedRoot cause:
_tab_evaluate()only normalized results whenreturn_by_value=True, but most callers do not pass that flag and receive nodriver's serialized object-entry structure instead of plain Python values_extract_tab_fingerprint()passed an uninvoked arrow function (() => { ... }) so nodriver did not return the intended object payloadAfter this patch:
verify_result.success=truescore=0.9user_agent,accept_language,sec_ch_ua,sec_ch_ua_mobile,sec_ch_ua_platform)Validation
python3 -m py_compile src/services/browser_captcha_personal.pypersonalget_custom_score()reproduction before/after patch on upstreammain