rendered paste body // 光らせる function flashElement (elem) { try { let indicator = elem.ownerDocument.createElement('div'); let rect = elem.getBoundingClientRect(); indicator.id = 'nyantoro-element-indicator'; let style = 'background-color: blue; opacity: 0.5; z-index: 999;' + 'position: fixed; ' + 'top: ' + rect.top + 'px;' + 'height:' + elem.clientHeight + 'px;'+ 'left: ' + rect.left + 'px;' + 'width: ' + elem.clientWidth + 'px'; indicator.setAttribute('style', style); elem.appendChild(indicator); setTimeout(function () elem.removeChild(indicator), 500); } catch (e) { liberator.echoerr(e); } } function flashXulElement (elem) { try { let style = 'background-color: blue; opacity: 0.5; z-index: 999;'; //elem.setAttribute('style', style); elem.style.backgroundColor = 'blue'; //setTimeout(function () elem.removeChild(indicator), 500); } catch (e) { liberator.echoerr(e); } } function flashLater (elem) { //setTimeout(function () flashElement(elem), 1000); //elem.collapsed = true; setTimeout(function () elem.collapsed = true, 3000); setTimeout(function () elem.collapsed = false, 4000); } function flashActive (win) { //echoProp(win.document.activeElement); flashLater(win.document.activeElement); //liberator.echo(win.document.activeElement); } function echoProp (obj) { for (i in { clientLeft: true, clientTop: true, clientWidth: true, clientHeight: true, id: true, collapsed: true, }) { liberator.echo(i + ': ' + obj[i] + ', '); } }window.flashActive = flashActive;