Forked from midlan/bookmarklet_inject_script_to_page.js
Created
March 1, 2019 05:25
-
-
Save LockeAG/a072590d8f93019fbfe322de65f85ff0 to your computer and use it in GitHub Desktop.
Code snippet to inject script to page, e.g. jquery. It can be used directly as bookmark in some browsers. (tested in chrome)
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() { | |
var url = prompt('URL of script to inject:'); | |
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