chromeworker/chromeproxy/content/inject.js

27 lines
400 B
JavaScript

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