Skip to content

Instantly share code, notes, and snippets.

@8bu
Last active August 24, 2018 15:05
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save 8bu/94627e530044d8a54091c254c2a0f990 to your computer and use it in GitHub Desktop.
Save 8bu/94627e530044d8a54091c254c2a0f990 to your computer and use it in GitHub Desktop.
Inject Jquery to website through console
$("p, h1, h2, h3, h4, h5, span").each(function() {
$(this).on("mouseenter", function() {
$(this).css("background-color", "#F1A9A2");
$(this).on("mouseleave", function() {
$(this).css("background-color", "");
});
});
$(this).on("click", function() {
console.log($(this).text());
});
})
javascript: (function(e, s) {
e.src = s;
e.onload = function() {
jQuery.noConflict();
console.log('jQuery injected');
};
document.head.appendChild(e);
})(document.createElement('script'), '//code.jquery.com/jquery-latest.min.js')
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment