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

Function initKeyInputs

Picviewer CE+/dist.user.js:28464–28476  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

28462 });
28463
28464 function initKeyInputs() {
28465 if (!GM_config.frame || !GM_config.frame.contentDocument) return;
28466 let keyInputs = GM_config.frame.contentDocument.querySelectorAll('input.floatBar-key');
28467 [].forEach.call(keyInputs, input => {
28468 input.setAttribute('readOnly', 'readonly');
28469 input.addEventListener("keydown", e => {
28470 if (e.key === 'Escape' || e.key === 'Backspace') input.value = '';
28471 else input.value = e.key;
28472 e.stopPropagation();
28473 e.preventDefault();
28474 });
28475 });
28476 }
28477
28478 matchedRule = getMatchedRule();
28479 let editUrl=storage.getItem("editUrl");

Callers 1

openPrefsFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected