PinAntDocsVersion

Pin docs version

  1. // ==UserScript==
  2. // @name PinAntDocsVersion
  3. // @namespace http://tampermonkey.net/
  4. // @version 0.1
  5. // @description Pin docs version
  6. // @author Formax
  7. // @match https://ant.design/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13. const MAIN_DOMAIN = 'ant.design';
  14. const targetUrl = '3x.ant.design';
  15. const hostName = window.location.hostname;
  16. if(hostName.startsWith(MAIN_DOMAIN)){
  17. const url = window.location.href;
  18. window.location.href = url.replace(MAIN_DOMAIN,targetUrl);
  19. }
  20. })();