Created
August 24, 2015 19:56
-
-
Save Benzi/42f4c6f6afa0abeb605b to your computer and use it in GitHub Desktop.
You can use this to inject CSS on a page. The example shows how to use a custom badge on plug.dj
This file contains hidden or 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
| // Edit the url to point to your custom badge | |
| // Edit the data-cid to include your user ID | |
| var css = '[data-cid^="3851534-"] .badge-box .bdg {background: url("https://ssl.benzi.io/code/qluster/images/badges/eyes.png")!important;}', | |
| head = document.head || document.getElementsByTagName('head')[0], | |
| style = document.createElement('style'); | |
| style.type = 'text/css'; | |
| if (style.styleSheet){ | |
| style.styleSheet.cssText = css; | |
| } else { | |
| style.appendChild(document.createTextNode(css)); | |
| } | |
| head.appendChild(style); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment