Google chrome extension 不重新刻蚀铬扩展
我使用一个警报来使用github v3 api获取github通知,并注意到获取api被及时调用,但没有得到最新的结果,不确定可能是什么问题Google chrome extension 不重新刻蚀铬扩展,google-chrome-extension,github-api-v3,Google Chrome Extension,Github Api V3,我使用一个警报来使用github v3 api获取github通知,并注意到获取api被及时调用,但没有得到最新的结果,不确定可能是什么问题 try{ const count = await getNotifications(searchQueries); await chrome.storage.local.set({[dbName]: count}) chrome.storage.local.get(dbName, showNotification); }cat
try{
const count = await getNotifications(searchQueries);
await chrome.storage.local.set({[dbName]: count})
chrome.storage.local.get(dbName, showNotification);
}catch(e) {
console.log(e)
}
...
async function getNotifications(repo) {
const headers = {
'Authorization': `Bearer ${access_token}`,
'Content-Type': 'application/json',
}
let response = await fetch(`https://api.github.com/notifications`, {headers});
const notifications = await response.json();
// alert(notifications.length)
return notifications.length
}
试试@wOxxOm,我检查了标题,它已经不在缓存中了。但是,如果我检查弹出窗口,然后使用cmd+刷新,它只会工作/更新新数据r@wOxxOm添加代码代码代码看起来很好。还可以尝试
fetch(url,{cache:“no-store”})
和“no-cache”
@wOxxOm“no-store”工作。谢谢你的帮助