Skip to content

Instantly share code, notes, and snippets.

@fredr
Last active June 14, 2024 17:28
Show Gist options
  • Save fredr/6502027 to your computer and use it in GitHub Desktop.
Save fredr/6502027 to your computer and use it in GitHub Desktop.
A bookmarklet that will inject an external script in the browser. (minify, uri encode and add to the href prefixed with "javascript:" in your bookmark)
(function() {
var script = document.createElement('script');
script.async = 1;
script.src = '<url to script>';
document.getElementsByTagName('body')[0].appendChild(script);
})();
@GinjaNinja5197
Copy link

can i put userscripts into this

@ant-7802
Copy link

thanks this is helpful https://mrcoles.com/bookmarklet/ this can also help

@Zaidbaidadekalb
Copy link

you can use GM.js https://github.com/Zaidbaidadekalb/-G-M-Executor.js
its also a bookmarklet that will inject an external script in the browser but you can change the code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment