Hide GitLab "Migrate from Jenkins" Widget

Hides the GitLab "Migrate from Jenkins" widget on the pipelines page.

  1. // ==UserScript==
  2. // @name Hide GitLab "Migrate from Jenkins" Widget
  3. // @namespace Violentmonkey Scripts
  4. // @match https://gitlab.*/*/merge_requests/*
  5. // @grant none
  6. // @version 1.0.0
  7. // @author joshmcorreia
  8. // @license MIT
  9. // @description Hides the GitLab "Migrate from Jenkins" widget on the pipelines page.
  10. // ==/UserScript==
  11.  
  12. // GitHub repo can be found at https://github.com/joshmcorreia/userscript_hide_gitlab_migrate_from_jenkins
  13.  
  14. const pipeline_suggest_selector = ".mr-pipeline-suggest";
  15.  
  16. function remove_migrate_widget() {
  17. var pipeline_suggest_element = document.querySelector(pipeline_suggest_selector);
  18. pipeline_suggest_element.remove();
  19. }
  20.  
  21. (new MutationObserver(check)).observe(document, {childList: true, subtree: true});
  22.  
  23. function check(changes, observer) {
  24. if(document.querySelector(pipeline_suggest_selector)) {
  25. observer.disconnect();
  26. remove_migrate_widget();
  27. }
  28. }

QingJ © 2025

镜像随时可能失效,请加Q群300939539或关注我们的公众号极客氢云获取最新地址