()
| 474 | } |
| 475 | |
| 476 | protected async isResolvedFocused(): Promise<boolean> { |
| 477 | try { |
| 478 | return await this.evaluate(` |
| 479 | (() => { |
| 480 | const el = window.__resolved; |
| 481 | return !!el && (document.activeElement === el || (typeof el.matches === 'function' && el.matches(':focus'))); |
| 482 | })() |
| 483 | `) as boolean; |
| 484 | } catch { |
| 485 | return false; |
| 486 | } |
| 487 | } |
| 488 | |
| 489 | /** |
| 490 | * Run a DOM-domain CDP command against `window.__resolved`. |