Redirect Unity China to Unity3D

将 *.unity.cn 页面重定向到 unity3d.com

  1. // ==UserScript==
  2. // @name Redirect Unity China to Unity3D
  3. // @namespace http://creationwong.xyz
  4. // @version 1.1
  5. // @description 将 *.unity.cn 页面重定向到 unity3d.com
  6. // @author creationwong
  7. // @match https://*.unity.cn/*
  8. // @license EPL
  9. // ==/UserScript==
  10.  
  11. (function () {
  12. 'use strict';
  13.  
  14. const newUrl = 'https://unity3d.com'
  15. + window.location.pathname
  16. + window.location.search
  17. + window.location.hash;
  18.  
  19. // 创建提示条
  20. const notice = document.createElement('div');
  21. notice.style.position = 'fixed';
  22. notice.style.top = '0';
  23. notice.style.left = '0';
  24. notice.style.width = '100%';
  25. notice.style.backgroundColor = '#4CAF50';
  26. notice.style.color = '#fff';
  27. notice.style.textAlign = 'center';
  28. notice.style.padding = '10px 0';
  29. notice.style.zIndex = '9999';
  30. notice.style.fontFamily = 'Arial, sans-serif';
  31. notice.style.fontSize = '16px';
  32. notice.textContent = '正在跳转到 unity3d.com...';
  33.  
  34. document.body.prepend(notice);
  35.  
  36. setTimeout(() => {
  37. window.location.href = newUrl;
  38. }, 1000);
  39. })();

QingJ © 2025

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