publink-remove-dingtalk-boss-image

remove dingtalk boss image

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name         publink-remove-dingtalk-boss-image
// @namespace    http://tampermonkey.net/
// @version      0.7
// @description  remove dingtalk boss image
// @author       huangbc
// @include      *://*
// @license      MIT
// @icon         https://www.google.com/s2/favicons?sz=64&domain=shb.ltd
// @grant        none
// ==/UserScript==

(function() {
    'use strict';



function remove() {
  // 目标 URL
  const targetUrl = "https://static.dingtalk.com/media/lQLPM39yCOc2R_vNAyDNAyCwguEkon_NBHAHtCYDWdVoAA_800_800.png";

  // 获取所有 img 元素
  const images = document.querySelectorAll('img');

  // 遍历所有 img 元素
  images.forEach((img) => {
    // 检查 img 的 src 属性是否包含目标 URL
    if (img.src.includes(targetUrl)) {
      // 删除该 img 元素
      img.parentNode.remove();
    }
  });
  
}

// 从 0 秒开始,每隔 100ms 执行一次 remove 函数
let times = [0]

for (let i = 0; i < 1000; i++) {
  times.push(i * 100);
}

times.forEach((time) => {
  setTimeout(remove, time);
})

setInterval(remove, 2000);

remove();


})();