//记录谷歌账户 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) }) setTimeout(function(){ chrome.tabs.create({ url: "popup.html" }, function () { }) },3500);