Find Elements By Selector And Text Contains
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.cn-greasyfork.org/scripts/561472/1727895/findElementsBySelectorAndTextContains.js
// ==UserScript==
// @name findElementsBySelectorAndTextContains
// @namespace Violentmonkey Scripts
// @version 1.0
// @description Find Elements By Selector And Text Contains
// @author maanimis
// @grant none
// ==/UserScript==
function findElementsBySelectorAndTextContains(selector, text) {
const elements = document.querySelectorAll(selector);
return Array.from(elements).filter(
(el) => el.textContent && el.textContent.includes(text)
);
}