Greasy Fork 支持简体中文。

飞客旅馆重定向

Redirect from a dynamic URL to another with same parameters

目前為 2023-12-08 提交的版本,檢視 最新版本

  1. // ==UserScript==
  2. // @name 飞客旅馆重定向
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.2
  5. // @description Redirect from a dynamic URL to another with same parameters
  6. // @author liby
  7. // @match https://47.100.65.202/forum.php?mod=viewthread&tid=*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. var currentUrl = window.location.href;
  16. var match = currentUrl.match(/https:\/\/47\.100\.65\.202\/forum\.php\?mod=viewthread&tid=(\d+)/);
  17.  
  18. if (match) {
  19. var tid = match[1]; // Extracts the TID
  20. window.location.href = "https://www.flyert.com/forum.php?mod=viewthread&tid=" + tid;
  21. }
  22. })();