Bypass AnonyViet

Automatically bypass intermediate pages and redirect to the destination on AnonyViet

  1. // ==UserScript==
  2. // @name Bypass AnonyViet
  3. // @name:vi Bỏ qua AnonyViet
  4. // @namespace http://tampermonkey.net/
  5. // @version 1.1
  6. // @description Automatically bypass intermediate pages and redirect to the destination on AnonyViet
  7. // @description:vi Tự động bỏ qua trang trung gian và chuyển hướng đến trang đích trên AnonyViet
  8. // @author Yuusei
  9. // @match https://anonyviet.com/tieptucdentrangmoi/*
  10. // @license MIT
  11. // @grant none
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16. // Waiting for the DOM to load
  17. function waitForElement(selector) {
  18. return new Promise(resolve => {
  19. if (document.querySelector(selector)) {
  20. return resolve(document.querySelector(selector));
  21. }
  22.  
  23. const observer = new MutationObserver(mutations => {
  24. if (document.querySelector(selector)) {
  25. observer.disconnect();
  26. resolve(document.querySelector(selector));
  27. }
  28. });
  29.  
  30. observer.observe(document.body, {
  31. childList: true,
  32. subtree: true
  33. });
  34. });
  35. }
  36.  
  37. // Main processing
  38. async function main() {
  39. // Try to get the link from the element with id="target-link" first
  40. const targetLink = await waitForElement('#target-link');
  41. if (targetLink) {
  42. const href = targetLink.getAttribute('href');
  43. if (href) {
  44. window.location.href = href;
  45. return;
  46. }
  47. }
  48.  
  49. // If there is no link, try to get it from the URL params
  50. const urlParams = new URLSearchParams(window.location.search);
  51. const targetUrl = urlParams.get('url');
  52. if (targetUrl) {
  53. window.location.href = decodeURIComponent(targetUrl);
  54. }
  55. }
  56.  
  57. main().catch(console.error);
  58. })();

QingJ © 2025

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