Greasy Fork is available in English.

PR page improvements

many things for teads github PRs

2024/07/05のページです。最新版はこちら

このスクリプトの質問や評価の投稿はこちら通報はこちらへお寄せください
  1. // ==UserScript==
  2. // @name PR page improvements
  3. // @namespace http://tampermonkey.net/
  4. // @version 2024-04-11
  5. // @description many things for teads github PRs
  6. // @author You
  7. // @match https://github.com/ebuzzing/*/pull/*
  8. // @icon https://www.google.com/s2/favicons?sz=64&domain=github.com
  9. // @grant none
  10. // @license MIT
  11. // ==/UserScript==
  12.  
  13. (function() {
  14. 'use strict';
  15.  
  16. // --------
  17. // -------- PR jobs no scroll, infinite height
  18. // --------
  19. // Add style to the document
  20. const style = document.createElement('style');
  21. style.textContent = '.branch-action-item.open>.merge-status-list.hide-closed-list { max-height: 1000vh !important; }';
  22. document.head.appendChild(style);
  23.  
  24. // Create a MutationObserver to monitor the DOM for changes
  25. const observer = new MutationObserver(mutations => {
  26. mutations.forEach(mutation => {
  27. if (mutation.addedNodes.length > 0) {
  28. // Check if any of the added nodes contain the elements we are interested in
  29.  
  30. // --------
  31. // -------- PR jobs links target blank
  32. // --------
  33. document.querySelectorAll('a.status-actions').forEach(e => {
  34. e.setAttribute('target', '_blank');
  35. });
  36.  
  37. // --------
  38. // -------- All sonarcloud links target blank
  39. // --------
  40. [...document.querySelectorAll('a')].filter(e => e.innerText === "sonarcloud").forEach(s => {[...s.parentElement.parentElement.parentElement.parentElement.parentElement.querySelectorAll('a')].forEach(link => link.setAttribute('target', '_blank'))})
  41.  
  42. }
  43. });
  44. });
  45.  
  46. // Configure the observer to watch for additions to the child list of the target node
  47. const config = { childList: true, subtree: true };
  48.  
  49. // Start observing the document body for changes
  50. observer.observe(document.body, config);
  51. })();