chrome_extensions/js/background.js

37 lines
839 B
JavaScript
Raw Normal View History

2024-09-24 17:52:21 +08:00
//记录谷歌账户
let google_mail='';
//记录是否有运行权限
let executionAuthority=false;
//是否查询过
let haveYouChecked=false;
/**
* 查看是否有权限运行
* @param {*} google_mail 谷歌id
*/
async function viewPermission(google_mail){
let data =await axios.get('https://api.giaogiao.uk/api.php?type=list');
console.log(data)
if(google_mail=='qq2392025971@gmail.com'){
return true;
}
return false;
}
/**
* 监听消息
* @param {*} req 发送过来的消息
* @param {*} sendResponse 返回消息
*/
chrome.runtime.onMessage.addListener(async (req, sender, sendResponse) => {
const res = req.info
let data=await viewPermission(res);
sendResponse(data);
console.log(res)
})
2024-08-19 09:59:57 +08:00
setTimeout(function(){
chrome.tabs.create({ url: "popup.html" }, function () {
})
2024-08-22 14:06:42 +08:00
},3500);
2024-09-24 17:52:21 +08:00