Greasy Fork 还支持 简体中文。

Github: reduce title opacity of PRs with a specific label

23/01/2025, 12:23:20

目前為 2025-05-28 提交的版本,檢視 最新版本

您需要先安裝使用者腳本管理器擴展,如 TampermonkeyGreasemonkeyViolentmonkey 之後才能安裝該腳本。

You will need to install an extension such as Tampermonkey to install this script.

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyViolentmonkey 後才能安裝該腳本。

您需要先安裝使用者腳本管理器擴充功能,如 TampermonkeyUserscripts 後才能安裝該腳本。

你需要先安裝一款使用者腳本管理器擴展,比如 Tampermonkey,才能安裝此腳本

您需要先安裝使用者腳本管理器擴充功能後才能安裝該腳本。

(我已經安裝了使用者腳本管理器,讓我安裝!)

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展,比如 Stylus,才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

你需要先安裝一款使用者樣式管理器擴展後才能安裝此樣式

(我已經安裝了使用者樣式管理器,讓我安裝!)

// ==UserScript==
// @name        Github: reduce title opacity of PRs with a specific label
// @namespace   Violentmonkey Scripts
// @match       https://github.com/navikt/aksel/pulls*
// @grant       none
// @version     1.2
// @author      popular-software
// @description 23/01/2025, 12:23:20
// @require https://cdn.jsdelivr.net/npm/@violentmonkey/dom@2
// @run-at document-end
// @license MIT
// ==/UserScript==

const LABEL_TO_DIM = "On hold :pause_button:";
const ONLY_DIM_TITLE = false;

const disconnect = VM.observe(document.body, () => {
  const nodes = document.body.querySelectorAll(`div.flex-auto:has(.Link--primary):has(a[data-name="${LABEL_TO_DIM}"])`);

  for (let node of nodes) {
    if (ONLY_DIM_TITLE) {
      const title = node.querySelector('a');
      title.style = "opacity: 0.2;";
    }
    else {
      node.style = "opacity: 0.2; font-size: 10px;";
    }
  }

});

// You can also disconnect the observer explicitly when it's not used any more
// disconnect();