availablity check before run on active tab

This commit is contained in:
2020-01-11 20:40:25 +08:00
parent 341abebc66
commit f1cf32b83a
3 changed files with 20 additions and 6 deletions

View File

@ -56,6 +56,11 @@ class Extractor {
tab = await createTab(task.urls[0], false);
} else {
tab = await getActiveTab(true) || await getActiveTab(false);
let succ = await ping(tab);
if (!succ) {
console.log('Cannot contact with active tab.');
return;
}
}
this._running = true;
return this._tasks.reduce((pms, task, i) => {