google-photos-delete-tool
google-photos-delete-tool copied to clipboard
Need to manually click delete button each time
Great script! I'm seeing that after it runs the select on all of the photos, you get a prompt in the corner asking you to delete. If you don't manually click on delete it then just unselecting everything after a few seconds and does the same again in a cycle. If it was possible for it to select and click the button too so the process could be fully automated and left to run by itself
The selector for the confirmation button has changed. You can try the following method. If this doesn't work, you must obtain the selector from the button manually. To do this, go to the Elements tab in the developer tools, select the confirmation button when it appears, highlight the HTML of the button, right-click, and choose "Copy selector". ~Good Luck!
const ELEMENT_SELECTORS = { checkboxClass: '.ckGgle', languageAgnosticDeleteButton: 'div[data-delete-origin] button', deleteButton: 'button[aria-label="Delete"]', confirmationButton: '#yDmH0d > div.VfPpkd-Sx9Kwc.cC1eCc.UDxLd.PzCPDd.V639qd.bvQPzd.oEOLpc.A9Uzve.VfPpkd-Sx9Kwc-OWXEXe-FNFY6c > div.VfPpkd-wzTsW.O4g5Md.iWO5td > div > div.VfPpkd-cnG4Wd.m5OsGf > div > div.VfPpkd-T0kwCb.IdSMxc > button.VfPpkd-LgbsSe.VfPpkd-LgbsSe-OWXEXe-k8QpJ.nCP5yc.AjY5Oe.LQeN7.kDryjd' }
I just made a PR to fix this. :)
Thank you that worked for me, appreciate it!
Here is the changed console code to copy & paste (in case someone doesn't understand what to do with the above code)
https://pastebin.com/gemQ7wnX
FYI. the following confirmation button selector worked for me today
confirmationButton: '#yDmH0d > div.VfPpkd-Sx9Kwc.cC1eCc.UDxLd.PzCPDd.V639qd.oEOLpc.A9Uzve.VfPpkd-Sx9Kwc-OWXEXe-FNFY6c > div.VfPpkd-wzTsW.O4g5Md.iWO5td > div > div.VfPpkd-cnG4Wd.m5OsGf > div > div.VfPpkd-T0kwCb.IdSMxc > button.VfPpkd-LgbsSe.VfPpkd-LgbsSe-OWXEXe-k8QpJ.nCP5yc.AjY5Oe.LQeN7.kDryjd'
FYI. the following confirmation button selector worked for me today
confirmationButton: '#yDmH0d > div.VfPpkd-Sx9Kwc.cC1eCc.UDxLd.PzCPDd.V639qd.oEOLpc.A9Uzve.VfPpkd-Sx9Kwc-OWXEXe-FNFY6c > div.VfPpkd-wzTsW.O4g5Md.iWO5td > div > div.VfPpkd-cnG4Wd.m5OsGf > div > div.VfPpkd-T0kwCb.IdSMxc > button.VfPpkd-LgbsSe.VfPpkd-LgbsSe-OWXEXe-k8QpJ.nCP5yc.AjY5Oe.LQeN7.kDryjd'
Thank you. This change worked for me. Here is the full code with this fix: https://pastebin.com/5KKmmKMt
How about something more elegant like
buttons.confirmation_button = Array.from(document.querySelectorAll('button')).find(button => button.textContent.trim() === 'Move to trash');
English version of the site is already required so why not