-
-
Save xdanger/1c02597387f084f040eb35633db09a96 to your computer and use it in GitHub Desktop.
Inject jQuery into a page
This file contains 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
%%javascript | |
function injectJavaScript(url) { | |
var tag = document.createElement('script'); | |
tag.src = url; | |
tag.type = 'text/javascript'; | |
tag.async = 'true'; | |
var hookTag = document.getElementsByTagName('script')[0]; | |
hookTag.parentNode.insertBefore(tag, hookTag); | |
} | |
;(function() { | |
injectJavaScript('https://cdnjs.cloudflare.com/ajax/libs/require.js/2.3.6/require.min.js'); | |
injectJavaScript('https://cdnjs.cloudflare.com/ajax/libs/jquery/3.3.1/jquery.min.js'); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment