Created
February 20, 2022 23:04
-
-
Save ElnuDev/32f49e5d254f0c7e89cbb963514cdef1 to your computer and use it in GitHub Desktop.
NextRequest Downloader
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// ==UserScript== | |
// @name NextRequest Downloader | |
// @version 1 | |
// @grant none | |
// ==/UserScript== | |
let downloadButton = document.createElement("button"); | |
downloadButton.innerHTML = "Download all"; | |
downloadButton.style.position = "absolute"; | |
downloadButton.style.top = "8px"; | |
downloadButton.style.left = "8px"; | |
downloadButton.style.zIndex = 999; | |
document.body.append(downloadButton); | |
downloadButton.onclick = () => { | |
downloadButton.innerHTML = "Working on it..."; | |
document.querySelectorAll("a").forEach(element => { | |
if (element.title != "Show/hide contents") { | |
return; | |
} | |
element.click(); | |
}); | |
// Wait for one second for expanded contents to load in | |
setTimeout(() => { | |
document.querySelectorAll("a").forEach(element => { | |
if (!element.href.endsWith("/download")) { | |
return; | |
} | |
window.open(element.href, "_blank"); | |
}); | |
}, 1000); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment