简体   繁体   中英

Is there any way to get the content of already fetched JavaScript/ CSS/ image of a webpage?

When the webpage gets loaded it fetches all the required dependency so is there any way we get the already fetched content and show it in console (without making another call to the server).

I tried the fetch() method by passing the "force-cache" option but it doesn't work always (eg what if the server sends in the header to not cache specific file).

Any idea about this?

The document has all the info on it. So you can access document.scripts , document.images , document.styleSheets , etc.

This very page has this image, for example: 此页面上开发工具的屏幕截图

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM