Advertisement
disnhau

Untitled

Apr 5th, 2021
44
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. const sleep = (milliseconds) => {
  2. return new Promise(resolve => setTimeout(resolve, milliseconds))
  3. }
  4.  
  5. ts = () => {
  6. return Math.round((new Date()).getTime() / 1000);
  7. }
  8.  
  9. async function a() {
  10. let items = [];
  11.  
  12. document.querySelectorAll('.SpreadsheetTaskList .ProjectSpreadsheetGridRow-subtaskToggleButton').forEach(async function(item) {
  13. items.push(item);
  14. });
  15.  
  16.  
  17. for(var i=0; i<items.length; i++) {
  18. items[i].click();
  19. await sleep(600);
  20. }
  21. }
  22.  
  23. let u = window.location.href;
  24.  
  25. async function b() {
  26. a();
  27. while(1) {
  28. let u1 = window.location.href;
  29. if (u1 != u && u1.indexOf('list') != -1) {
  30. a();
  31. u = u1;
  32. }
  33. await sleep(1000);
  34. }
  35. } b();
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement