Skip to content

Instantly share code, notes, and snippets.

@phette23
Created July 20, 2026 17:00
Show Gist options
  • Select an option

  • Save phette23/4b1f68bb92e4a1ec70ecd051ecd2fa9d to your computer and use it in GitHub Desktop.

Select an option

Save phette23/4b1f68bb92e4a1ec70ecd051ecd2fa9d to your computer and use it in GitHub Desktop.
Repeatedly click "restore from archive" button in Panopto folder
// Unarchive all sessions in a folder
// Poll the DOM every second for a floating modal progress indicator,
// then if it's not present click the first "Restore from Archive" button.
// override window confirm so we don't have to click it manually
window.confirm = () => true
const interval = setInterval(() => {
const modal = document.querySelector("#loadingMessage")
if (!modal || modal.style.display === "none") {
const restoreButton = document.querySelector(
"div[role='button'][data-automation-id='restore-from-archive']",
)
if (restoreButton) {
restoreButton.click()
return console.log("Restore from Archive button clicked")
} else {
console.error(
"No modal but also no restore button...hopefully we're done?",
)
return clearInterval(interval)
}
}
return console.log("Modal progress is present, waiting...")
}, 1000)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment