Skip to content

Instantly share code, notes, and snippets.

@rhodessteve
Created May 19, 2021 13:30
Show Gist options
  • Save rhodessteve/6dc5e2e7dd606d1fa0bd0f443f95bbd4 to your computer and use it in GitHub Desktop.
Save rhodessteve/6dc5e2e7dd606d1fa0bd0f443f95bbd4 to your computer and use it in GitHub Desktop.
function deleteNext() {
waitAndClick('#inactive-workflows-module-heading h3', () => {
waitAndClick('[data-operation="delete"]', () => {
waitAndClick('[name="Delete"]');
})
})
document.querySelector('[data-operation="delete"]').click();
document.querySelector('[name="Delete"]').click();
}
function waitAndClick(selector, callback) {
const el = document.querySelector(selector);
if (el) {
el.click();
return (callback) ? callback() : null;
}
return setTimeout(() => {
waitAndClick(selector, callback);
}, 100);
}
deleteNext();
@rhodessteve
Copy link
Author

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment