diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index d2d5536..4ffdf7b 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -74,7 +74,7 @@ function logWithDevice(message, device) { const searchTexts = ['hermes+rdv+online+paris', 'hermes+rdv+enligne+paris', 'hermes+rdv+en+ligne+paris', 'hermes+rendezvous+en+ligne+paris', 'hermes+appointment+online+paris', 'hermes+appointment+online+paris', 'appointment+hermes+paris+on+line', 'hermes+rendez+vous+online+paris', 'hermes+rendez+vous+paris+en+ligne', 'hermes+rendez+vous+paris+enligne', 'hermes+rendez+vous+paris+online', 'online+appointment+hermes+paris', 'hermes+online+appointment+paris', 'paris+hermes+online+appointment'] class CommandorPage { - constructor(contact, device, sender, mongoManager, selectedStore = DEFAULT_STORE, audioAnalyse = false, alertBeep = false, port = 9000, onlyForCookies = true) { + constructor(contact, device, sender, mongoManager, selectedStore = DEFAULT_STORE, audioAnalyse = false, alertBeep = false, port = 9000, onlyForCookies = false) { this.contact = contact; this.device = device; this.mongoManager = mongoManager; @@ -1161,16 +1161,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") - } else - this.sender.sendMessage(cookiesString) + try { + 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") + } else + this.sender.sendMessage(cookiesString) + } catch (e) { + console.log(e) + } } async handleBraveSkipBtn() {