您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
removes the max height of the merge status list in Github PRs to display all the checks without scrolling.
当前为
- // ==UserScript==
- // @name Full Height GitHub PR Status List
- // @namespace http://tampermonkey.net/
- // @version 0.1
- // @description removes the max height of the merge status list in Github PRs to display all the checks without scrolling.
- // @author Othman Shareef (othmanosx@gmail.com)
- // @match https://github.com/*
- // @icon https://github.githubassets.com/favicons/favicon.svg
- // @grant none
- // @license MIT
- // ==/UserScript==
- (function () {
- 'use strict';
- const elementSelector = '.merge-status-list';
- const timers = new Map();
- const waitForSelector = (selector = '', options = { timeout: 1000 }) => {
- return new Promise((resolve, reject) => {
- // Create a key from the selector and the optional id
- const key = selector;
- // Clear the existing timer for the key (if any)
- const existingTimer = timers.get(key);
- if (existingTimer) {
- clearInterval(existingTimer);
- }
- const startTime = Date.now();
- const timer = setInterval(() => {
- try {
- const element = document.querySelector(selector);
- if (element) {
- clearInterval(timer);
- timers.delete(key);
- resolve(element);
- } else if (Date.now() - startTime >= options.timeout) {
- clearInterval(timer);
- timers.delete(key);
- reject(new Error('Timeout ' + key));
- }
- } catch (error) {
- clearInterval(timer);
- timers.delete(key);
- reject(new Error('Invalid selector: ' + selector));
- }
- }, 100);
- // Store the new timer
- timers.set(key, timer);
- });
- };
- const removeMaxHeight = async () => {
- try {
- await waitForSelector(elementSelector);
- const existingCopyBtn = document.querySelector(elementSelector);
- existingCopyBtn.style.maxHeight = 'none';
- } catch (error) {
- console.error(error);
- }
- };
- const observer = new MutationObserver(removeMaxHeight);
- observer.observe(document.body, {
- childList: true,
- subtree: true,
- });
- })();