Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我根据当前页面数据从 chrome 扩展发送获取请求。但不幸的是,当从缓存加载页面时,它不会发送新请求,每次请求发生时我都必须手动重新加载页面。如何绕过它并使 chrome 显式发送请求?谢谢。
您可以像这样分配自定义标头来获取 API。也许您可以在 chrome 扩展中应用相同的内容。
var myHeaders = new Headers(); myHeaders.append('cache-control', 'no-cache'); var myInit = { method: 'GET', headers: myHeaders, }; fetch(myRequest, myInit) .then(function(response) { return response; })