Skip to content

Instantly share code, notes, and snippets.

@thunderrun
Created December 4, 2020 06:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save thunderrun/b7a3c5097b8dd35a9fbda5eca70607dc to your computer and use it in GitHub Desktop.
Save thunderrun/b7a3c5097b8dd35a9fbda5eca70607dc to your computer and use it in GitHub Desktop.
删除QQ空间所有相册
const iframe = document.querySelector('iframe[id="tphoto"]').contentWindow;
const expands = iframe.document.querySelectorAll('.js-album-op-tip');
expands.forEach((node) => {
node.click();
});
const elements = iframe.document.querySelectorAll('.js-album-delete');
let index = 0;
const total = elements.length;
const interval = setInterval(() => {
elements[index].click();
if (index === total) {
clearInterval(interval);
}
setTimeout(() => {
const iframe2 = document.querySelector('iframe[id="share_photo"]').contentWindow;
const confirm = iframe2.document.querySelector('.bt_tip_hit');
confirm.click();
}, 1000);
index += 1;
}, 2000);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment