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

Function isKeyDownEffectiveTarget

Picviewer CE+/dist.user.js:27327–27346  ·  view source on GitHub ↗
(target)

Source from the content-addressed store, hash-verified

27325 }
27326
27327 function isKeyDownEffectiveTarget(target) {
27328 var localName = (target.shadowRoot ? (target.shadowRoot.activeElement || target) : target).localName;
27329
27330 // 确保光标不是定位在文字输入框或选择框
27331 if (localName == 'textarea' || localName == 'input' || localName == 'select'){
27332 return false;
27333 }
27334
27335 // 视频播放器
27336 if (localName == 'object' || localName == 'embed'){
27337 return false;
27338 }
27339
27340 // 百度贴吧回复输入的问题
27341 if (target.getAttribute('contenteditable') == 'true'){
27342 return false;
27343 }
27344
27345 return true;
27346 }
27347
27348 async function openGallery(){
27349 if(!gallery){

Callers 1

keydownFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected