Anti Redirect V1.1

Prevents other Tampermonkey scripts from redirecting you to other pages

  1. // ==UserScript==
  2. // @name Anti Redirect V1.1
  3. // @namespace http://tampermonkey.net/
  4. // @version 1.1
  5. // @description Prevents other Tampermonkey scripts from redirecting you to other pages
  6. // @author zuxity
  7. // @match *://*/*
  8. // @grant none
  9. // ==/UserScript==
  10.  
  11. (function() {
  12. 'use strict';
  13.  
  14. var originalAssign = window.location.assign;
  15.  
  16. window.location.assign = function(url) {
  17. if (url !== window.location.href) {
  18. console.log("Prevented redirect to: " + url);
  19. return;
  20. }
  21. originalAssign.call(window.location, url);
  22. };
  23. })();