Greasy Fork

Packname所在处显眼显示

显眼标出 "packag" and "package" 用黄色

当前为 2024-04-05 提交的版本,查看 最新版本

// ==UserScript==
// @name         Packname所在处显眼显示
// @namespace https://greasyfork.org/users/1284284
// @version      0.1
// @description  显眼标出 "packag" and "package" 用黄色
// @match        https://api.3839app.com/cdn/android/*
// @match        https://dl.yxhapi.com/android/box/game/v6.2/*
// @match        https://huodong.4399.cn/game///api/huodong/daily/*
// @grant        none
// ==/UserScript==

(function() {
    'use strict';

    const keywords = ['pkgName','pkg','packageName','packag', 'package'];    const elements = document.querySelectorAll('*');    for (let element of elements) {        if (element.textContent) {            for (let keyword of keywords) {                if (element.textContent.includes(keyword)) {                    const regex = new RegExp(`\\b${keyword}\\b`, 'gi');                    element.innerHTML = element.innerHTML.replace(regex, `<span style="background-color: yellow;">${keyword}</span>`);                }            }        }    }})();