wckfxhs

用于测试

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

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

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

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

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

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

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

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

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

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

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

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

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

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

// ==UserScript==
// @name         wckfxhs
// @namespace    http://tampermonkey.net/
// @version      0.1.2
// @description  用于测试
// @author       You
// @match        https://*/*
// @grant        unsafeWindow
// @require      https://cdn.staticfile.org/jquery/1.10.2/jquerdescirptiony.min.js
// @include      https://ark.xiaohongshu.com/app-order/dispatch/waybill/wait
// @license      MIT
// ==/UserScript==

// 等待网页完成加载
   (function () {
        'use strict';
        setTimeout(function () {
            var targetElement = document.querySelector('.table-op-row');
            console.log('targetElement', targetElement);
            if (targetElement) {
                var newButton = document.createElement('button');
                newButton.textContent = '打开小眼睛';
                newButton.style.marginLeft = '10px';
                newButton.classList.add('d-button');
                newButton.classList.add('d-button-default');
                newButton.classList.add('d-button-with-content');
                newButton.classList.add('--color-static');
                newButton.classList.add('bold');
                newButton.classList.add('--color-bg-primary');
                newButton.classList.add('--color-white');
                newButton.addEventListener('click', function () {
                    var elements = document.querySelectorAll('img[data-v-589d67da]');
                    for (var i = 0; i < elements.length; i++) {
                        var element = elements[i];
                        var clickEvent = new MouseEvent('click', {
                            bubbles: true,
                            cancelable: true,
                        });
                        element.dispatchEvent(clickEvent);
                    }
                });
                targetElement.appendChild(newButton);
            } else {
                console.error('Target element not found.');
            }
        }, 5000);
    })();