MCPcopy Create free account
hub / github.com/ChromeDevTools/devtools-frontend / activeElement

Method activeElement

test/e2e/shared/page-wrapper.ts:447–463  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

445 }
446
447 async activeElement() {
448 await this.raf();
449
450 return await this.page.evaluateHandle(() => {
451 let activeElement = document.activeElement;
452
453 while (activeElement?.shadowRoot) {
454 activeElement = activeElement.shadowRoot.activeElement;
455 }
456
457 if (!activeElement) {
458 throw new Error('No active element found');
459 }
460
461 return activeElement;
462 });
463 }
464
465 async activeElementTextContent() {
466 const element = await this.activeElement();

Calls 1

rafMethod · 0.95

Tested by 2

editHeaderItemFunction · 0.64