support brave version 1.65.133
This commit is contained in:
@@ -25,6 +25,7 @@ const OCRResult = {
|
||||
BRAVE_PRIVACY: Symbol("BRAVE_PRIVACY"),
|
||||
BRAVE_PRIVACY_PUB: Symbol("BRAVE_PRIVACY_PUB"),
|
||||
BRAVE_NOTIFICATION: Symbol("BRAVE_NOTIFICATION"),
|
||||
BRAVE_PUSH_NOTIFICATION: Symbol("BRAVE_PUSH_NOTIFICATION"),
|
||||
CHOOSE_POSITION: Symbol("CHOOSE_POSITION"),
|
||||
BRAVE_VPN_SKIP: Symbol("BRAVE_VPN_SKIP"),
|
||||
}
|
||||
|
||||
@@ -220,7 +220,7 @@ class CommandorPage {
|
||||
if (this.isTerminated) {
|
||||
log(this.device.model() + ":request terminated, send cancel()");
|
||||
try {
|
||||
if (this.page !== undefined) {
|
||||
if (this.page !== undefined && !this.page.isClosed()) {
|
||||
await this.page.close()
|
||||
}
|
||||
} catch (e) {
|
||||
@@ -1048,6 +1048,12 @@ class CommandorPage {
|
||||
await delay(2000);
|
||||
await this.checkResultWithOcr();
|
||||
break;
|
||||
case OCRResult.BRAVE_PUSH_NOTIFICATION:
|
||||
logWithDevice("BRAVE_NOTIFICATION", this.device)
|
||||
await this.handleBravePushNotification()
|
||||
await delay(3000);
|
||||
await this.checkResultWithOcr();
|
||||
break
|
||||
case OCRResult.BRAVE_NOTIFICATION:
|
||||
logWithDevice("BRAVE_NOTIFICATION", this.device)
|
||||
if (this.device.model() === "21091116C") {
|
||||
@@ -1289,6 +1295,7 @@ class CommandorPage {
|
||||
|
||||
async sendCookiesToQueue() {
|
||||
try {
|
||||
if (!this.page.isClosed()) {
|
||||
const cookiesSet = await this.page.cookies();
|
||||
let cookiesString = ""
|
||||
cookiesSet.forEach((cookie) => {
|
||||
@@ -1303,6 +1310,7 @@ class CommandorPage {
|
||||
} else {
|
||||
this.sender.sendMessage(cookiesString)
|
||||
}
|
||||
}
|
||||
} catch (e) {
|
||||
console.log(e)
|
||||
}
|
||||
@@ -1527,6 +1535,11 @@ class CommandorPage {
|
||||
}
|
||||
return findIp
|
||||
}
|
||||
|
||||
async handleBravePushNotification() {
|
||||
await this.tapForDevice(this.device, 100, 400)
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
module
|
||||
|
||||
@@ -77,6 +77,8 @@ const BRAVE_SKIP_PRIVACY_PAGE = "Partagez des informations"
|
||||
const BRAVE_SKIP_PRIVACY_PAGE_3 = "Partagez de informations"
|
||||
const BRAVE_SKIP_PRIVACY_PAGE_2 = "Partagez des renseignements"
|
||||
|
||||
const PUSH_NOTIFICATION_1 = "Brave à vous envoyer des notifications "
|
||||
|
||||
class OCRChecker {
|
||||
|
||||
constructor(device, contact) {
|
||||
@@ -101,6 +103,9 @@ class OCRChecker {
|
||||
} else if (result.includes(BRAVE_NOTIFICATION)) {
|
||||
await this.deleteFile(fileName)
|
||||
return OCRResult.BRAVE_NOTIFICATION
|
||||
} else if (result.includes(PUSH_NOTIFICATION_1)) {
|
||||
await this.deleteFile(fileName)
|
||||
return OCRResult.BRAVE_PUSH_NOTIFICATION
|
||||
} else if (result.includes(CHOOSE_POSITION_GOOGLE_FR)) {
|
||||
await this.deleteFile(fileName)
|
||||
return OCRResult.CHOOSE_POSITION
|
||||
|
||||
Reference in New Issue
Block a user