Skip to content

Instantly share code, notes, and snippets.

@Dobby89
Created December 3, 2019 08:05
Show Gist options
  • Save Dobby89/bc63008aa57564e28bff5e162262dd5e to your computer and use it in GitHub Desktop.
Save Dobby89/bc63008aa57564e28bff5e162262dd5e to your computer and use it in GitHub Desktop.
Bookmarklets
https://caiorss.github.io/bookmarklet-maker/
(function(d, s, id){
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)){ return; }
js = d.createElement(s); js.id = id;
js.onload = function(){
// remote script has loaded
};
js.src = "//domain.com/index.js";
fjs.parentNode.insertBefore(js, fjs);
// Load styles
var head = d.getElementsByTagName('head')[0];
var link = d.createElement('link');
link.rel = 'stylesheet';
link.type = 'text/css';
link.href = '//domain.com/style.js';
link.media = 'all';
head.appendChild(link);
}(document, 'script', 'nameOfThing'));
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment