Skip to content

Instantly share code, notes, and snippets.

@mhkeller
Last active December 6, 2021 04:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mhkeller/31ab65b629e96f2bba4dc4c98d54ce22 to your computer and use it in GitHub Desktop.
Save mhkeller/31ab65b629e96f2bba4dc4c98d54ce22 to your computer and use it in GitHub Desktop.
Bookmarklet for injecting new css
javascript: (function() {
var newcss = `PUT NEW CSS HERE`;
var tag = document.createElement("style");
tag.type = "text/css";
document.getElementsByTagName("head")[0].appendChild(tag);
tag[(typeof document.body.style.WebkitAppearance == "string") ? "innerText" : "innerHTML"] = newcss
})();
@mhkeller
Copy link
Author

mhkeller commented Dec 6, 2021

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