Prevent Redirection

prevent redirection by LeetCode

  1. // ==UserScript==
  2. // @name Prevent Redirection
  3. // @namespace https://subc.rip
  4. // @version 2024-02-17
  5. // @description prevent redirection by LeetCode
  6. // @author subcrip
  7. // @match https://leetcode.cn/*
  8. // @match https://leetcode.com/*
  9. // @icon https://www.google.com/s2/favicons?sz=64&domain=leetcode.com
  10. // @grant none
  11. // @license MIT
  12. // ==/UserScript==
  13.  
  14. (function() {
  15. 'use strict';
  16.  
  17. const currRegion = window.location.hostname;
  18.  
  19. window.addEventListener('popstate', function(event) {
  20. if (window.location.hostname !== currRegion) {
  21. window.location.hostname = currRegion;
  22. }
  23. });
  24. })();

QingJ © 2025

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