diff --git a/myblock/background/worker.js b/myblock/background/worker.js index 791dda7..a0ce0ac 100644 --- a/myblock/background/worker.js +++ b/myblock/background/worker.js @@ -19,7 +19,7 @@ chrome.runtime.onMessage.addListener(function (request, sender, sendResponse) { case BackgroundMsgType.ERROR: console.log(request, task_manager, sender); // 利用sender tab id 返回正确的任务id case BackgroundMsgType.GETTASK: - // sendResponse({type: "error"}) + console.log(request, task_manager, sender); // 利用sender tab id 返回正确的任务id } // sendResponse({type: MsgType.NEWURL, url: "https://playerduo.com/api/playerDuo-service-v2/rip113?lang=en&deviceType=browser"}); GetTask(sender); diff --git a/myblock/content/inject.js b/myblock/content/inject.js index 8a2c5d6..ceadccf 100644 --- a/myblock/content/inject.js +++ b/myblock/content/inject.js @@ -19,14 +19,14 @@ function SendContent() { function GetTask() { chrome.runtime.sendMessage({ type: BackgroundMsgType.GETTASK }, function (response) { switch(response.type) { - case BackgroundMsgType.FETCH: - setTimeout(function(){ - GetTask(); - }, 6000) - case BackgroundMsgType.WAIT: + case InjectMsgType.WAIT: setTimeout(function(){ GetTask(); }, 1000); + default: + setTimeout(function(){ + GetTask(); + }, 6000) } }) }