小米应用商店直接下载APP

在小米应用商店中直接下载APP

  1. // ==UserScript==
  2. // @name 小米应用商店直接下载APP
  3. // @version 1.2
  4. // @description 在小米应用商店中直接下载APP
  5. // @author ChatGPT
  6. // @match https://m.app.mi.com/*
  7. // @match https://app.xiaomi.com/details?id=*
  8. // @grant none
  9. // @run-at document-start
  10. // @namespace https://gf.qytechs.cn/users/452911
  11. // ==/UserScript==
  12.  
  13. // 获取当前网址
  14. var currentUrl = window.location.href;
  15.  
  16. // 检查当前域名是否为 app.xiaomi.com
  17. if (currentUrl.includes("app.xiaomi.com")) {
  18. // 替换URL中的部分内容
  19. var replacedUrl = currentUrl.replace("https://app.xiaomi.com/details?id=", "https://m.app.mi.com/details?id=");
  20.  
  21. // 直接访问替换后的链接
  22. window.location.href = replacedUrl;
  23. }
  24. (function() {
  25. function executeFunction() {
  26. // 获取当前网页链接
  27. var currentUrl = window.location.href;
  28.  
  29. // 检查当前网页链接是否包含 detail&id=
  30. if (currentUrl.includes("detail&id=")) {
  31. // 提取 "detail&id=" 后面的字符
  32. var startIndex = currentUrl.indexOf("detail&id=") + 10;
  33. var endIndex = currentUrl.length;
  34.  
  35. // 截取需要拼接的部分字符串
  36. var detailId = currentUrl.substring(startIndex, endIndex);
  37.  
  38. // 拼接新的链接
  39. var newUrl = "https://m.app.mi.com/download/" + detailId;
  40.  
  41. // 直接访问拼接好的链接
  42. window.location.href = newUrl;
  43. }
  44. }
  45. executeFunction();
  46. // 绑定 touchend 事件
  47. document.addEventListener("touchend", function() {
  48. setTimeout(executeFunction, 200);
  49. });
  50. })();

QingJ © 2025

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