use same SlidingCaptchaSolver instance

This commit is contained in:
Lei PAN
2024-09-24 14:02:32 +02:00
parent 0115ad7139
commit 9adea7e9fa
2 changed files with 5 additions and 4 deletions
+3 -4
View File
@@ -88,6 +88,7 @@ class CommandorPage {
this.shareCookiesWithRequests = shareCookiesWithRequests;
this.port = port;
this.sender = sender;
this.slidingCaptchaSolver = new SlidingCaptchaSolver(this.device);
this.ocrChecker = new OCRChecker(this.device, this.contact);
// this.browserPackageName = "com.brave.browser";
this.browserPackageName = "com.android.chrome";
@@ -730,7 +731,6 @@ class CommandorPage {
}
}
async slidingCaptcha(onResult) {
logWithDevice("slidingCaptcha", this.device);
if (this.device.model() === "MI 5s" || this.device.model() === "ASUS_X00QD" || this.device.model() === "ASUS_Z012D" || this.device.model() === "HUAWEI NXT-TL00") {
@@ -738,9 +738,8 @@ class CommandorPage {
await exec(cmd);
await delay(5000);
}
let slidingCaptchaSolver = new SlidingCaptchaSolver(this.device);
await slidingCaptchaSolver.solve(this.page, async (isSuccessful) => {
console.log("check isAlwaysBlocked")
await this.slidingCaptchaSolver.solve(this.page, async (isSuccessful) => {
logWithDevice("check isAlwaysBlocked",this.device)
this.isFillingFields = false
onResult(isSuccessful)
})