TODO: 1. 生成对应需求的tab. 方便多进程处理数据. 2. 处理chromeproxy_client的hash路径. 而不是label.

This commit is contained in:
eson 2020-11-20 19:13:45 +08:00
parent 4bf8705a8d
commit 741cf154fe

View File

@ -31,7 +31,7 @@ function FinishTask(sender, content) {
var formdata = new FormData();
formdata.append("taskid", task.data.taskid);
formdata.append("content", content);
console.log(task.data.taskid);
// console.log(task.data.taskid);
fetch(FinishTaskUrl, {method: "POST", body: formdata }).then(function (response) {
if (response.ok) {
response.json().then(function (value) {
@ -45,7 +45,7 @@ function FinishTask(sender, content) {
// TODO: 汇报错误
// ErrorTask(sender, error);
console.log(error)
GetTask(sender);
// GetTask(sender);
return;
});
}
@ -95,6 +95,11 @@ chrome.webRequest.onBeforeRequest.addListener(function (details) {
var params = new URLSearchParams(details.url)
UpdateHost(params.get("taskurl"))
chrome.tabs.remove(details.tabId, function () { });
chrome.tabs.query({currentWindow: true}, function(tabs) {
for( tab in tabs) {
console.log(tab);
}
})
return { cancel: true };
}
}, { 'urls': ["<all_urls>"] }, ['blocking']);