The solution is as follows:
Use the performance.getEntries() method to get a list of all successfully loaded resources, traverse all page resource collections (css/image/js/font, etc.) in the onload event, and use the exclusion method to filter out successful ones from all collections List of resources, that is, the resources that failed to load