Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save gonelf/0663b0db47492ce4fdd5c59df6ce367f to your computer and use it in GitHub Desktop.
Save gonelf/0663b0db47492ce4fdd5c59df6ce367f to your computer and use it in GitHub Desktop.
Bookmarklet to inject script by url to page, e.g. jquery.
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