MCPcopy Create free account
hub / github.com/Justineo/github-hovercard / createStyle

Function createStyle

userscript/src/inject-styles.js:2–13  ·  view source on GitHub ↗
(styleText)

Source from the content-addressed store, hash-verified

1;(function () {
2 function createStyle(styleText) {
3 var style = document.createElement('style');
4
5 // <style> element must be appended into DOM before setting `cssText`
6 // otherwise IE8 will interpret the text in IE7 mode.
7 document.querySelector('head').appendChild(style);
8 if (style.styleSheet) {
9 style.styleSheet.cssText = styleText;
10 } else {
11 style.appendChild(document.createTextNode(styleText));
12 }
13 }
14
15 createStyle('__USER_SCRIPT_STYLES__');
16})();

Callers 1

inject-styles.jsFile · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected