1. 需要改为一个Chrome一个任务. 因为有全局的cookie.
如果开相同的网站会导致cookie混乱.
This commit is contained in:
2021-05-08 18:15:29 +08:00
parent 32fcc9deb3
commit fa568b53c4
5 changed files with 47 additions and 43 deletions

View File

@@ -8,15 +8,8 @@ if( window.location.href === "http://localhost:12203/start") {
};
ws.onmessage = function(evt) {
console.log("Received Message: ", JSON.parse(evt.data));
// if (window.location.hostname !== "www.zhipin.com") {
// var handler = window.open("https://www.zhipin.com/")
// }
chrome.runtime.sendMessage(JSON.parse(evt.data))
};
ws.onclose = function(evt) {
@@ -29,34 +22,7 @@ if( window.location.href === "http://localhost:12203/start") {
}
// setInterval(function name() {
// chrome.runtime.sendMessage({say: "Hello"})
// fetch("http://localhost:12203/api").then((response)=>{
// console.log(response);
// console.log(response.json())
// })
// }, 10000)
// 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);
// }
// };