(styleText)
| 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 | })(); |