Aprove Request Github

Script for aprove automatic requests in github

当前为 2023-06-26 提交的版本,查看 最新版本

  1. // ==UserScript==
  2. // @name Aprove Request Github
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Script for aprove automatic requests in github
  6. // @author Singularity Chris
  7. // @match https://github.com/*
  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. document.addEventListener('keydown', function(event) {
  16.  
  17. // Shorcut Ctrl + a
  18. if (event.ctrlKey && event.key === 'a') {
  19.  
  20. setTimeout(function() {
  21. // Guardar boton aprove
  22. const aproveButton = document.querySelector('a.btn.btn-primary.btn-sm.ml-2');
  23. aproveButton.click();
  24.  
  25. }, 1000); // 1000 es el tiempo en milisegundos (1.0 segundos)
  26.  
  27. setTimeout(function() {
  28. // Guardar boton aprove
  29. const reviewButton = document.querySelector('.js-review-changes');
  30. reviewButton.click();
  31. }, 1250); // 1250 es el tiempo en milisegundos (1.25 segundos)
  32.  
  33. setTimeout(function() {
  34. const radioInput = document.querySelector('input[name="pull_request_review[event]"][value="approve"]');
  35. radioInput.click();
  36. }, 1500); // 1500 es el tiempo en milisegundos (1.50 segundos)
  37.  
  38. setTimeout(function() {
  39. const spanElements = document.querySelectorAll('span.Button-label');
  40. for(let i = 0; i <= spanElements.length; i++) {
  41. if(spanElements[i].innerHTML == 'Submit review') {
  42. spanElements[i].click();
  43. }
  44. }
  45. }, 1750); // 1750 es el tiempo en milisegundos (1.75 segundos)
  46.  
  47.  
  48. } // If event click ctrl + l
  49. });
  50. // Your code here...
  51. })();

QingJ © 2025

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