publink-remove-dingtalk-boss-image

remove dingtalk boss image

  1. // ==UserScript==
  2. // @name publink-remove-dingtalk-boss-image
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.6
  5. // @description remove dingtalk boss image
  6. // @author huangbc
  7. // @include *://*
  8. // @license MIT
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=shb.ltd
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16.  
  17.  
  18. function remove() {
  19. // 目标 URL
  20. const targetUrl = "https://static.dingtalk.com/media/lADPDhmOzyk-JUfNAbLNAbI";
  21.  
  22. // 获取所有 img 元素
  23. const images = document.querySelectorAll('img');
  24.  
  25. // 遍历所有 img 元素
  26. images.forEach((img) => {
  27. // 检查 img 的 src 属性是否包含目标 URL
  28. if (img.src.includes(targetUrl)) {
  29. // 删除该 img 元素
  30. img.parentNode.remove();
  31. }
  32. });
  33. }
  34.  
  35. // 从 0 秒开始,每隔 100ms 执行一次 remove 函数
  36. let times = [0]
  37.  
  38. for (let i = 0; i < 1000; i++) {
  39. times.push(i * 100);
  40. }
  41.  
  42. times.forEach((time) => {
  43. setTimeout(remove, time);
  44. })
  45.  
  46. setInterval(remove, 2000);
  47.  
  48. remove();
  49.  
  50.  
  51. })();