(str: string)
| 36 | } |
| 37 | |
| 38 | function getStyleTagByString(str: string): HTMLStyleElement | undefined { |
| 39 | return Array.from(document.head!.querySelectorAll('style')).find(tag => { |
| 40 | const rules = tag.sheet ? Array.from((tag.sheet as CSSStyleSheet).cssRules) : []; |
| 41 | return !!rules.find(rule => rule.cssText.includes(str)); |
| 42 | }); |
| 43 | } |
| 44 | }); |
| 45 | }); |