Last active
February 16, 2024 13:32
-
-
Save midlan/5b9e786266bdca68b45ae88da92c7669 to your computer and use it in GitHub Desktop.
Bookmarklet to inject script by url to page, e.g. jquery.
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
javascript: (function() { | |
var url = prompt('URL of script to inject:', 'https://code.jquery.com/jquery-3.4.1.min.js'); | |
if (url) { | |
console.log('Script inject request URL:', url); | |
var script = document.createElement('script'); | |
script.src = url; | |
document.getElementsByTagName('head')[0].appendChild(script); | |
console.log('Injected script: ', script); | |
} | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment