var href = window.location.href; if(href.startsWith(Host)) { setInterval(function(){ GetTask(); }, 1); } function GetTask() { try { chrome.runtime.sendMessage({ type: BackgroundMsgType.GETTASK }, function(){}); } catch (error) { console.log(error); } };