LinkedIn Comments Deleter

Deletes ALL of your comments on Linkedin

目前为 2024-12-17 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name LinkedIn Comments Deleter
  3. // @namespace greaseyfork_linkedin_com_del
  4. // @version 2024-12-16.0
  5. // @description Deletes ALL of your comments on Linkedin
  6. // @author Henrique Bucher (henry@vitorian.com)
  7. // @include https://www.linkedin.com/in/*/recent-activity/comments/
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=linkedin.com
  9. // @grant GM_log
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. // WARNING:
  14. // THIS WILL IMMEDIATELY START DELETING ***ALL*** OF YOUR COMMENTS ON LINKEDIN
  15. // THE SCRIPT WILL RUN AS SOON AS YOU VISIT THE FOLLOWING PAGE:
  16. // https://www.linkedin.com/your_activity/recent-activity/comments
  17. // BE ABSOLUTELY SURE YOU WANT THIS!!!
  18.  
  19. (function() {
  20. 'use strict';
  21.  
  22. let MIN_CLICK_MS = 3000
  23. let MAX_CLICK_MS = 6000
  24. let MIN_RELOAD_MS = 5000
  25. let MAX_RELOAD_MS = 10000
  26.  
  27. function sleep(mintime,maxtime) {
  28. let ms = Math.floor(Math.random()*(maxtime-mintime) + mintime);
  29. return new Promise(resolve => setTimeout(resolve, ms));
  30. }
  31.  
  32. function remove_all() {
  33. let button_list = document.querySelectorAll('div.comment-options-trigger > div.artdeco-dropdown > button.artdeco-dropdown__trigger');
  34.  
  35. for (let i = 0;i < button_list.length;i++){
  36. let button = button_list[i];
  37. button.click();
  38. sleep(MIN_CLICK_MS, MAX_CLICK_MS);
  39.  
  40. // Click on the "Delete" option (2nd)
  41. let options = document.getElementsByClassName("comment-options-dropdown__option-text");
  42. options[2].click();
  43. sleep(MIN_CLICK_MS, MAX_CLICK_MS);
  44.  
  45. // Confirm the modal dialog
  46. let modal_options = document.querySelectorAll("div.artdeco-modal__actionbar > button.artdeco-button > span.artdeco-button__text");
  47. modal_options[1].click();
  48. sleep(MIN_CLICK_MS, MAX_CLICK_MS);
  49. }
  50. sleep(MIN_RELOAD_MS, MAX_RELOAD_MS);
  51. }
  52.  
  53. GM_log("-------------------- Linkedin Comment Delete Started" )
  54.  
  55. remove_all();
  56. sleep(MIN_RELOAD_MS, MAX_RELOAD_MS);
  57. location.reload();
  58.  
  59. })();
  60.  
  61.