您需要先安装一个扩展,例如 篡改猴、Greasemonkey 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 暴力猴,之后才能安装此脚本。
您需要先安装一个扩展,例如 篡改猴 或 Userscripts ,之后才能安装此脚本。
您需要先安装一款用户脚本管理器扩展,例如 Tampermonkey,才能安装此脚本。
您需要先安装用户脚本管理器扩展后才能安装此脚本。
Automatically dismisses the "Auto DevOps" alert on GitLab
// ==UserScript== // @name Auto Dismiss GitLab Auto DevOps Alert // @namespace https://gitlab.com // @version 1.0 // @description Automatically dismisses the "Auto DevOps" alert on GitLab // @author Sam Artuso <[email protected]> // @match *://gitlab.com/* // @grant none // @license MIT // ==/UserScript== (function() { 'use strict'; function dismissAlert() { let button = document.querySelector('[aria-label="Dismiss Auto DevOps box"]'); if (button) { console.log('Auto DevOps alert found! Dismissing it...'); button.click(); } else { console.log('No Auto DevOps alert found.'); } } // Run the function after page load window.addEventListener('load', () => { setTimeout(dismissAlert, 2000); // Delay to allow GitLab to render elements }); // Also run periodically in case the alert appears later (SPA handling) let observer = new MutationObserver(() => dismissAlert()); observer.observe(document.body, { childList: true, subtree: true }); })();