// ==UserScript== // @name Replace Text with Image Link in Table // @namespace https://www.example.com // @include * // @grant none // ==/UserScript==

// Wait for all elements to load before running the script setTimeout(function() { // Find all td elements with class "Polaris-DataTable__Cell_yixs7 Polaris-DataTable__Cell--verticalAlignTop_1042b" var tds = document.querySelectorAll('td.Polaris-DataTable__Cell_yixs7.Polaris-DataTable__Cell--verticalAlignTop_1042b');

// Loop through all matching td elements
for (var i = 0; i < tds.length; i++) {
    var td = tds[i];
    
    // Find the first instance of 'ABC' in the td element
    var abcIndex = td.innerHTML.indexOf('ABC');
    if (abcIndex > -1) {
        // Replace 'ABC' with image link
        var newHTML = td.innerHTML.replace('ABC', 'https://www.sdd.com/sss/ABC.jpg');
        td.innerHTML = newHTML;
    }
}

}, 15000); // Wait for 15 seconds before running the script.

油猴脚本:自动替换网页表格中的文字为图片链接

原文地址: https://www.cveoy.top/t/topic/mQgP 著作权归作者所有。请勿转载和采集!

免费AI点我,无需注册和登录