您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Greasy Fork is available in English.
A library containing several functions i use often in my other scripts
当前为
此脚本不应直接安装。它是供其他脚本使用的外部库,要使用该库请加入元指令 // @require https://update.greasyfork.icu/scripts/478390/1271150/TetteLib.js
// ==UserScript== // @name TetteLib // @namespace http://tampermonkey.net/ // @version 0.1 // @description A library containing several functions i use often in my other scripts // @author TetteDev // @match *://*/* // @grant none // ==/UserScript== function waitForElement(selector) { return new Promise((resolve, reject) => { const el = document.querySelector(selector); if (el) {resolve(el);} new MutationObserver((mutationRecords, observer) => { // Query for elements matching the specified selector Array.from(document.querySelectorAll(selector)).forEach((element) => { resolve(element); //Once we have resolved we don't need the observer anymore. observer.disconnect(); }); }) .observe(document.documentElement, { childList: true, subtree: true }); }); } function traverseParentsUntil(startElement, predicateUntil) { if (!startElement) return null; if (!predicateUntil || typeof predicateUntil !== "function") return null; if (!startElement.parentElement) return predicateUntil(startElement) ? startElement : null; while (startElement.parentElement) { if (predicateUntil(startElement.parentElement)) return startElement.parentElement; else startElement = startElement.parentElement; } return null; } function traverseChildrenUntil(startElement, predicateUntil) { if (!startElement) return null; if (!predicateUntil || typeof predicateUntil !== "function") return null; if (!startElement.firstChild) return predicateUntil(startElement) ? startElement : null; while (startElement.firstChild) { if (predicateUntil(startElement.firstChild)) return startElement.firstChild; else startElement = startElement.firstChild; } return null; }