您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically scroll to the specified Trello-board list
// ==UserScript== // @name Scroll to Trello list // @description Automatically scroll to the specified Trello-board list // @author Vassyutovich Ilya (https://github.com/VassyutovichIlya) // @homepageURL https://github.com/VassyutovichIlya/user-scripts // @license MIT // @version 0.1.0 // @grant none // @include https://trello.com/* // @namespace https://greasyfork.org/users/629857 // ==/UserScript== const listNameParameterName = "scrollToList"; const scriptExecutionTimeoutSeconds = 10; const uriParams = new URLSearchParams(window.location.search); const listName = uriParams.get(listNameParameterName); if (listName == null) { return; } let executionTimedOut = false; const executionTimeoutTimer = setTimeout( () => executionTimedOut = true, scriptExecutionTimeoutSeconds * 1000 ); const mutator = async (_, observer) => { if (executionTimedOut) { clearTimeout(executionTimeoutTimer); observer.disconnect(); return; } const trelloRootElement = document.getElementById("trello-root"); if (trelloRootElement == null) { return; } const trelloContentElement = document.getElementById("content"); if (trelloContentElement == null) { return; } const trelloBoardElement = document.getElementById("board"); if (trelloBoardElement == null) { return; } const listsTextAreas = Array.from( document .querySelectorAll("div .list-header textarea")); const foundList = listsTextAreas.find(textArea => textArea.value === listName); if (foundList === undefined) { return; } observer.disconnect(); const scrollOptions = { "inline": "center" }; foundList.scrollIntoView(scrollOptions); } const mutationObserver = new MutationObserver(mutator); mutationObserver.observe(document, { childList: true, subtree: true });