noRedirect

Prevent redirecting JS feature. Packed in user.js

  1. // ==UserScript==
  2. // @name noRedirect
  3. // @namespace https://gist.github.com/piqus/4ea4664519a83d7fb073
  4. // @version 0.1
  5. // @description Prevent redirecting JS feature. Packed in user.js
  6. // @match *
  7. // @copyright 2014+, Piotr Kubisa
  8. /// @link: http://stackoverflow.com/questions/5225964/jquery-disable-all-redirections-links-form-submissions-window-location-change
  9. // ==/UserScript==
  10.  
  11.  
  12. window.onbeforeunload = function(e){
  13. var e = e || window.event;
  14. // For IE and Firefox (prior to 4)
  15. if (e){
  16. e.returnValue = 'Do you want to leave this page?';
  17. }
  18. // For Safari and Chrome
  19. return "Do you want to leave this page?";
  20. };