create sendCookiesToQueue() method
This commit is contained in:
@@ -757,7 +757,11 @@ class CommandorPage {
|
|||||||
let url = this.page.url();
|
let url = this.page.url();
|
||||||
logWithDevice("successful url is " + url, this.device)
|
logWithDevice("successful url is " + url, this.device)
|
||||||
await this.push_message_to_db(publishType, url)
|
await this.push_message_to_db(publishType, url)
|
||||||
// this.firstStart = false;
|
if (this.onlyForCookies) {
|
||||||
|
await this.sendCookiesToQueue();
|
||||||
|
this.isTerminated = true;
|
||||||
|
await this.resetBrowser()
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
async push_message_to_db(publishType, url) {
|
async push_message_to_db(publishType, url) {
|
||||||
@@ -926,18 +930,7 @@ class CommandorPage {
|
|||||||
}
|
}
|
||||||
})
|
})
|
||||||
logWithDevice("this.page.bringToFront();", this.device)
|
logWithDevice("this.page.bringToFront();", this.device)
|
||||||
const cookiesSet = await this.page.cookies();
|
await this.sendCookiesToQueue();
|
||||||
let cookiesString = ""
|
|
||||||
cookiesSet.forEach((cookie) => {
|
|
||||||
cookiesString = cookiesString + cookie.name + "=" + cookie.value + ";"
|
|
||||||
})
|
|
||||||
console.log(cookiesString);
|
|
||||||
if (this.onlyForCookies) {
|
|
||||||
// if (this.contact.ipCountry === "DE")
|
|
||||||
this.sender.sendMessage(cookiesString, "REQUEST_DATA_DE")
|
|
||||||
this.isTerminated = true
|
|
||||||
} else
|
|
||||||
this.sender.sendMessage(cookiesString)
|
|
||||||
await this.page.bringToFront();
|
await this.page.bringToFront();
|
||||||
await this.fillFields(this.page)
|
await this.fillFields(this.page)
|
||||||
await delay(2 * 1000);
|
await delay(2 * 1000);
|
||||||
@@ -1167,6 +1160,20 @@ class CommandorPage {
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
async sendCookiesToQueue() {
|
||||||
|
const cookiesSet = await this.page.cookies();
|
||||||
|
let cookiesString = ""
|
||||||
|
cookiesSet.forEach((cookie) => {
|
||||||
|
cookiesString = cookiesString + cookie.name + "=" + cookie.value + ";"
|
||||||
|
})
|
||||||
|
console.log(cookiesString);
|
||||||
|
if (this.onlyForCookies) {
|
||||||
|
this.sender.sendMessage(cookiesString, "REQUEST_DATA_DE")
|
||||||
|
this.isTerminated = true
|
||||||
|
} else
|
||||||
|
this.sender.sendMessage(cookiesString)
|
||||||
|
}
|
||||||
|
|
||||||
async handleBraveSkipBtn() {
|
async handleBraveSkipBtn() {
|
||||||
let model = this.device.model()
|
let model = this.device.model()
|
||||||
if (model === "CPH2219") {
|
if (model === "CPH2219") {
|
||||||
@@ -1365,7 +1372,6 @@ class CommandorPage {
|
|||||||
} else {
|
} else {
|
||||||
await this.tapForDevice(this.device, 411, 2100)
|
await this.tapForDevice(this.device, 411, 2100)
|
||||||
}
|
}
|
||||||
// await this.device.shell("input tap " + 411 + " " + 2100)
|
|
||||||
}
|
}
|
||||||
await delay(2000);
|
await delay(2000);
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user