MCPcopy Create free account
hub / github.com/hoothin/UserScripts / inputActive

Function inputActive

Picviewer CE+/dist.user.js:27372–27392  ·  view source on GitHub ↗
(doc)

Source from the content-addressed store, hash-verified

27370 }
27371
27372 function inputActive(doc) {
27373 let activeEl = getActiveElement(doc);
27374 if (activeEl &&
27375 ((/INPUT|TEXTAREA/i.test(activeEl.nodeName) &&
27376 activeEl.getAttribute("aria-readonly") != "true"
27377 ) ||
27378 activeEl.contentEditable == 'true'
27379 )
27380 ) {
27381 return true;
27382 } else {
27383 while (activeEl && activeEl.nodeName) {
27384 if (activeEl.contentEditable == 'true') return true;
27385 if (activeEl.nodeName.toUpperCase() == 'BODY') {
27386 break;
27387 }
27388 activeEl = activeEl.parentNode;
27389 }
27390 }
27391 return false;
27392 }
27393
27394 let keypressing = false;
27395 function keydown(event) {

Callers 1

keydownFunction · 0.70

Calls 1

getActiveElementFunction · 0.70

Tested by

no test coverage detected