码头快捷上线工具

干掉烦人的上线流程

  1. // ==UserScript==
  2. // @name 码头快捷上线工具
  3. // @namespace http://vear.vip/
  4. // @version 0.0.5
  5. // @description 干掉烦人的上线流程
  6. // @author 北仓拳王
  7. // @match https://wharf.alibaba-inc.com/*
  8. // @icon https://gw.alicdn.com/tfs/TB1utiXJfb2gK0jSZK9XXaEgFXa-200-200.png
  9. // @grant none
  10. // ==/UserScript==
  11.  
  12. function prependChild(parent, newChild) {
  13. if (parent.firstChild) {
  14. parent.insertBefore(newChild, parent.firstChild);
  15. } else {
  16. parent.appendChild(newChild);
  17. }
  18. return parent;
  19. }
  20.  
  21. function rightAll() {
  22. Array.from(document.getElementsByClassName("next-radio-wrapper"))
  23. .filter((ele, index) => index % 2 === 0)
  24. .forEach((ele) => {
  25. ele.click();
  26. });
  27. }
  28. const delay = (timeout) =>
  29. new Promise((resolve) => setTimeout(() => resolve(), timeout));
  30.  
  31. function autoNext() {
  32. let intervalId = setInterval(async () => {
  33. if (
  34. document.getElementsByClassName("ContentWidthGated--info--1VnIMug")
  35. .length == 1 ||
  36. Number(
  37. document
  38. .getElementsByClassName("ContentWidthGated--info--1VnIMug")[1]
  39. .innerText.split(":")[1]
  40. .substring(0, 1)
  41. ) > 5
  42. ) {
  43. document
  44. .getElementsByClassName("next-btn next-medium next-btn-primary")[6]
  45. .click();
  46. await delay(300);
  47. document
  48. .getElementsByClassName(
  49. "next-btn next-medium next-btn-primary next-dialog-btn"
  50. )[0]
  51. .click();
  52. }
  53. }, 3000);
  54. }
  55.  
  56. (function () {
  57. "use strict";
  58. // console.log("成功注入码头快捷上线工具脚本");
  59. setTimeout(async () => {
  60. console.log(
  61. `%c `,
  62. ` padding: 35px 200px;
  63. width: 90px;
  64. height: 90px;
  65. background-image: url(http://img.doutula.com/production/uploads/image/2020/04/10/20200410452864_AYwgHM.gif);
  66. background-size: contain;
  67. background-repeat: no-repeat;
  68. color: transparent;
  69. margin-bottom: 10px;`
  70. );
  71. console.log(
  72. `%c码头快捷上线工具%cby北仓拳王`,
  73. "background: #35495e; padding: 4px; border-radius: 3px 0 0 3px; color: #fff",
  74. "background: #41b883; padding: 4px; border-radius: 0 3px 3px 0; color: #fff"
  75. );
  76.  
  77. const content = document.querySelectorAll("header")[0].children[2];
  78.  
  79. const warp = document.createElement("div");
  80. warp.style.display = "flex";
  81. warp.style.justifyContent = "flex-end";
  82. warp.style.alignItems = "center";
  83. // warp.style.border = "1px solid red";
  84. // warp.style.width = "100%";
  85. // 全勾按钮
  86. const allRightBtn = document.createElement("button");
  87. allRightBtn.innerText = "一键 ✅";
  88. allRightBtn.className = "next-btn next-small next-btn-normal";
  89. allRightBtn.style.marginRight = "5px";
  90. allRightBtn.onclick = function () {
  91. document.getElementsByClassName('next-btn next-small next-btn-normal')[7].click()
  92. setTimeout(async () => {
  93. rightAll();
  94. await delay(200);
  95. document.getElementsByClassName('next-btn next-medium next-btn-primary next-dialog-btn')[0].click()
  96. }, 400)
  97. };
  98.  
  99. // 跳过按钮
  100. const nextBtn = document.createElement("button");
  101. nextBtn.innerText = "自动 ⏩";
  102. nextBtn.className = "next-btn next-small next-btn-normal";
  103. nextBtn.style.marginRight = "5px";
  104. nextBtn.onclick = function () {
  105. autoNext();
  106. };
  107.  
  108. warp.appendChild(allRightBtn);
  109. warp.appendChild(nextBtn);
  110. // content.appendChild(warp);
  111. prependChild(content, warp);
  112. }, 1200);
  113.  
  114. (()=> {
  115. const btnText = document.querySelectorAll('.next-btn-helper')[12].innerText;
  116. if (btnText === '审批中') {
  117. console.log('是在审批中');
  118. const approveTimer = setInterval(()=> {
  119. const text = document.querySelectorAll('.next-btn-helper')[12].innerText;
  120. if (text !== '审批中') {
  121. flicker();
  122. clearInterval(approveTimer);
  123. }
  124. }, 2000);
  125. }
  126.  
  127. function flicker() {
  128. const title = document.title;
  129. let count = 1;
  130. setInterval(()=> {
  131. document.title = count % 2 ? title : '审批完成啦';
  132. count++;
  133. }, 500)
  134. }
  135. })()
  136. })();

QingJ © 2025

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