From ee0e0513dceda38237bd26f8df1351c497837f9b Mon Sep 17 00:00:00 2001 From: PAN Lei Date: Tue, 29 Nov 2022 10:58:21 +0100 Subject: [PATCH] try to clear browser every time --- src/workers/CommandorPage.js | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/workers/CommandorPage.js b/src/workers/CommandorPage.js index e4b2cec..421fdbc 100644 --- a/src/workers/CommandorPage.js +++ b/src/workers/CommandorPage.js @@ -98,9 +98,6 @@ class CommandorPage { let cancel const intervalTask = setInterval(() => { if (this.isTerminated) { - this.device.shell("pm clear com.android.chrome") - this.device.shell("am set-debug-app --persistent com.android.chrome") - this.device.shell("pm am start -n com.android.chrome/com.google.android.apps.chrome.Main") log("request terminated, will close device") context.close() // this.page.close() @@ -375,11 +372,13 @@ class CommandorPage { reserve.source_from = this.device.model(); await this.mongoManager.saveReserveToDb(reserve.to_mongo_dict()) await this.deleteFromBlackList() + await this.resetBrowser() this.isTerminated = true } async saveToBlackList() { await this.mongoManager.saveBlackListToDb(new BlackListContactPojo(this.contact)) + await this.resetBrowser() this.isTerminated = true }