Last active
March 25, 2017 09:49
-
-
Save yanzhihong23/5bcaa0d0fd8ef949309dae6d44dbf652 to your computer and use it in GitHub Desktop.
Block jQuery from browser console
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(function($) { | |
// the magic | |
delete window.jQuery; | |
delete window.$; | |
/** | |
* global interceptor | |
* business logic is safe inside the closure | |
*/ | |
$(document).ajaxSend(function(event, jqxhr, settings) { | |
// do something | |
console.log('captured'); | |
}); | |
$(".trigger").click(function() { | |
$.get('url'); | |
}); | |
})(jQuery); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment