(selector: string, comment: string)
| 43 | const css = [banner]; |
| 44 | |
| 45 | function addStaticCSS(selector: string, comment: string) { |
| 46 | const staticStyle = document.querySelector(selector); |
| 47 | if (staticStyle && staticStyle.textContent) { |
| 48 | css.push(`/* ${comment} */`); |
| 49 | css.push(staticStyle.textContent); |
| 50 | css.push(''); |
| 51 | } |
| 52 | } |
| 53 | |
| 54 | addStaticCSS('.darkreader--fallback', 'Fallback Style'); |
| 55 | addStaticCSS('.darkreader--user-agent', 'User-Agent Style'); |