Created
February 7, 2017 17:37
-
-
Save linktohack/7484b00850e9b12a2a5969dc7352ce63 to your computer and use it in GitHub Desktop.
Remove all Dropbox Links
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
var links = document.querySelectorAll('.remove-link'); | |
var actions = [].map.call(links, (link) => () => removeLink(link)); | |
series(actions); | |
function removeLink(link) { | |
return new Promise((resolve, reject) => { | |
link.click() | |
setTimeout(() => { | |
document.querySelector('.button-primary').click() | |
}, 100) | |
setTimeout(() => { | |
resolve(0) | |
}, 200) | |
}) | |
} | |
function series(promises) { | |
if (promises.length > 0) { | |
var p = promises.shift() | |
return p().then(() => series(promises)) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment