在酷安 APP 中打开

修复从 Coolapk 网页调起 APP 客户端

  1. // ==UserScript==
  2. // @name:en-US Coolapk open in app
  3. // @name 在酷安 APP 中打开
  4. // @namespace coolapk
  5. // @version 0.0.4
  6. // @description:en-US Fix Open Coolapk APP from Web
  7. // @description 修复从 Coolapk 网页调起 APP 客户端
  8. // @license MIT
  9. // @author wherewhere
  10. // @match *://coolapk.com/*
  11. // @match *://*.coolapk.com/*
  12. // @icon https://static.coolapk.com/static/web/v8/img/under_logo.png
  13. // @grant unsafeWindow
  14. // ==/UserScript==
  15.  
  16. (function () {
  17. function toApp() {
  18. open("coolmarket:/" + location.pathname);
  19. }
  20.  
  21. const script = document.createElement('script');
  22. script.type = "text/javascript";
  23. script.textContent = toApp;
  24. const element = document.head || document.body || document.documentElement;
  25. element.appendChild(script);
  26.  
  27. const href = "coolmarket:/" + location.pathname;
  28. const opens = document.getElementsByClassName("app-open");
  29. for (let i = 0; i < opens.length; i++) {
  30. const open = opens[i];
  31. if (open instanceof HTMLAnchorElement) {
  32. open.href = href;
  33. open.removeAttribute("onclick");
  34. }
  35. }
  36. })();

QingJ © 2025

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