(selector: string)
| 131 | * `getBg` returns the resolved value, which has the hostname and port prepended due to `computedStyle` call. |
| 132 | */ |
| 133 | export async function getCssRuleBg(selector: string): Promise<string> { |
| 134 | return page.evaluate((sel) => { |
| 135 | for (const sheet of document.styleSheets) { |
| 136 | try { |
| 137 | for (const rule of sheet.cssRules) { |
| 138 | if (rule instanceof CSSStyleRule && rule.selectorText === sel) { |
| 139 | return rule.style.backgroundImage |
| 140 | } |
| 141 | } |
| 142 | } catch (_e) {} |
| 143 | } |
| 144 | }, selector) |
| 145 | } |
| 146 | |
| 147 | export async function getBgColor( |
| 148 | el: string | ElementHandle | Locator, |
no outgoing calls
no test coverage detected