提取码自动填写

访问分享链接时自动填写提取码并提交

  1. // ==UserScript==
  2. // @name 提取码自动填写
  3. // @author billypon
  4. // @description 访问分享链接时自动填写提取码并提交
  5. // @version 1.0.6
  6. // @namespace http://www.canaansky.com/
  7. // @match *://pan.baidu.com/share/*
  8. // @match *://pan.baidu.com/s/*
  9. // @run-at document-idle
  10. // @grant none
  11. // ==/UserScript==
  12.  
  13. var code = location.hash.slice(1,5);
  14. if (!code)
  15. return;
  16. console.debug("code", code);
  17.  
  18. function fill(input, button) {
  19. var input = document.querySelector(input), button = document.querySelector(button);
  20. if (input && button) {
  21. console.debug("elements", input, button);
  22. input.value = code;
  23. button.click();
  24. }
  25. }
  26.  
  27. var domain = location.hostname.match(/\w+\.\w+$/)[0];
  28. console.debug("domain", domain);
  29. switch (domain) {
  30. case "baidu.com":
  31. fill(".pickpw input", ".pickpw .g-button");
  32. break;
  33. }

QingJ © 2025

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