try to save data while onResponse

This commit is contained in:
Lei PAN
2023-04-20 19:32:11 +02:00
parent 66209894d6
commit 087a847d98
2 changed files with 11 additions and 10 deletions
-4
View File
@@ -13,10 +13,6 @@ adb -s 07f9c883 shell am start -n com.android.chrome/com.google.android.apps.chr
adb -s 76a3ac8d shell pm clear com.android.chrome
adb -s 76a3ac8d shell am set-debug-app --persistent com.android.chrome
adb -s 76a3ac8d shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#xiao mi
adb -s 47e7e36b shell pm clear com.android.chrome
adb -s 47e7e36b shell am set-debug-app --persistent com.android.chrome
adb -s 47e7e36b shell am start -n com.android.chrome/com.google.android.apps.chrome.Main
#huawei
adb -s EPHUT20825001518 shell pm clear com.android.chrome
adb -s EPHUT20825001518 shell am set-debug-app --persistent com.android.chrome
+11 -6
View File
@@ -418,16 +418,21 @@ class CommandorPage {
}
async onResponse(response) {
// let rex = new RegExp(REGEX_RDV_URL)
// log("onResponse with url:" + response.url())
// if (rex.test(response.url())) {
// log("rdv url found:" + response.url())
// await this.push_message_to_db(PublishType.SUCCESS, response.url())
// }
let rex = new RegExp(REGEX_RDV_URL)
log("onResponse with url:" + response.url())
// log("onResponse with url:" + response.body())
if (rex.test(response.url())) {
log("rdv url found:" + response.url())
await this.push_message_to_db(PublishType.SUCCESS, response.url())
}
}
async push_message_to_queue(publishType) {
let url = this.page.url();
await this.push_message_to_db(publishType, url)
}
async push_message_to_db(publishType, url) {
let splitedUrl = url.split("/");
let id = splitedUrl[splitedUrl.length - 1];
if (url === "https://rendezvousparis.hermes.com/client/welcome") {