I want to download all the .nitro-files from a website, using DevTools console.
This is the code I allready have
(async function downloadNitroFilesFromNetwork() {
// Überprüft ob die DevTools geöffnet sind & ob der Netzwerk-Tab ausgewählt ist
if (!window.performance || !window.performance.getEntriesByType) {
console.error("DevTools müssen geöffnet und der Netzwerk-Tab ausgewählt sein");
return;
}
const nitroFiles = [];
const entries = performance.getEntriesByType('resource');
// Filtert Dateien mit .nitro-Endung heraus
entries.forEach(entry => {
if (entry.name.endsWith('.nitro')) {
nitroFiles.push(entry.name);
}
});
// Lädt die .nitro-Dateien einzeln herunter
for (const url of nitroFiles) {
const response = await fetch(url);
if (!response.ok) {
console.error(`Failed to download ${url}: ${response.statusText}`);
continue;
}
const blob = await response.blob();
const link = document.createElement('a');
const fileName = url.split('/').pop();
link.href = URL.createObjectURL(blob);
link.download = fileName;
document.body.appendChild(link);
link.click();
document.body.removeChild(link);
}
console.log(`Downloaded ${nitroFiles.length} .nitro files`);
})();
The website I want to download the files from, has CORS enabaled. I seams like the script dont get any Information because the output is: Downloaded 0 .nitro files
I tried CORS-Blocker-Extension and a Proxy-Server allready