Ignore go to (Socialmediagirls)

21/02/2025, 13:01:16

  1. // ==UserScript==
  2. // @name Ignore go to (Socialmediagirls)
  3. // @namespace https://gf.qytechs.cn/users/821661
  4. // @match https://forums.socialmediagirls.com/*
  5. // @grant none
  6. // @version 1.0
  7. // @run-at document-start
  8. // @author hdyzen
  9. // @description 21/02/2025, 13:01:16
  10. // @license GPL-3.0-only
  11. // ==/UserScript==
  12.  
  13. function initObserver() {
  14. const handleMutations = mutations => {
  15. for (const mutation of mutations) {
  16. for (const node of mutation.addedNodes) {
  17. if (node.nodeName === "A" && node.href.includes("/goto/link-confirmation?url=")) {
  18. node.href = getUrl(node.search);
  19. }
  20. }
  21. }
  22. };
  23.  
  24. const observer = new MutationObserver(handleMutations);
  25.  
  26. observer.observe(document.body || document.documentElement, {
  27. childList: true,
  28. subtree: true,
  29. });
  30.  
  31. disObserver(observer);
  32. }
  33. initObserver();
  34.  
  35. function disObserver(observer) {
  36. document.addEventListener("DOMContentLoaded", e => {
  37. observer.disconnect();
  38. console.log("Observer disconnected");
  39. });
  40. }
  41.  
  42. function getUrl(search) {
  43. const params = new URLSearchParams(search);
  44. const url = params.get("url");
  45.  
  46. return atob(url);
  47. }

QingJ © 2025

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