Aprove Request Github

Script for aprove automatic requests in github

目前為 2023-06-20 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name Aprove Request Github
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  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. // Redireccion a pulls request
  21. window.location.href = "https://github.com/pulls/review-requested";
  22. setTimeout(function() {
  23. // Guardar pull request
  24. var clickPullRequest = document.querySelector('a.d-block.d-md-none.position-absolute.top-0.bottom-0.left-0.right-0');
  25. clickPullRequest.click();
  26. }, 500); // 500 es el tiempo en milisegundos (.5 segundos)
  27.  
  28. setTimeout(function() {
  29. // Guardar boton aprove
  30. const aproveButton = document.querySelector('a.btn.btn-primary.btn-sm.ml-2');
  31. aproveButton.click();
  32.  
  33. }, 1000); // 1000 es el tiempo en milisegundos (1.0 segundos)
  34.  
  35. setTimeout(function() {
  36. // Guardar boton aprove
  37. const reviewButton = document.querySelector('.js-review-changes');
  38. reviewButton.click();
  39. }, 1250); // 1250 es el tiempo en milisegundos (1.25 segundos)
  40.  
  41. setTimeout(function() {
  42. const radioInput = document.querySelector('input[name="pull_request_review[event]"][value="approve"]');
  43. radioInput.click();
  44. }, 1500); // 1500 es el tiempo en milisegundos (1.50 segundos)
  45.  
  46. setTimeout(function() {
  47. const spanElements = document.querySelectorAll('span.Button-label');
  48. for(let i = 0; i <= spanElements.length; i++) {
  49. if(spanElements[i].innerHTML == 'Submit review') {
  50. spanElements[i].click();
  51. }
  52. }
  53. }, 1750); // 1750 es el tiempo en milisegundos (1.75 segundos)
  54.  
  55.  
  56. } // If event click ctrl + l
  57. });
  58. // Your code here...
  59. })();

QingJ © 2025

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