Universal Dynamic URL Redirector

Redirect from specific URL to another while maintaining parameters, excluding mobile=yes

目前为 2023-12-11 提交的版本。查看 最新版本

  1. // ==UserScript==
  2. // @name Universal Dynamic URL Redirector
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.3
  5. // @description Redirect from specific URL to another while maintaining parameters, excluding mobile=yes
  6. // @author You
  7. // @match https://47.100.65.202/forum.php*
  8. // @grant none
  9. // @license MIT
  10. // ==/UserScript==
  11.  
  12. (function() {
  13. 'use strict';
  14.  
  15. var currentUrl = window.location.href;
  16. var newUrl = currentUrl.replace(/47\.100\.65\.202/, 'www.flyert.com');
  17. newUrl = newUrl.replace(/&mobile=yes/, ''); // Removes '&mobile=yes' if present
  18. window.location.href = newUrl;
  19. })();