+ "pageAction": "eles.forEach(container => { let anchor = container.querySelector('a[data-role=\"thumb-link\"]'); if (!anchor) return; let trailerUrl = anchor.getAttribute('data-previewvideo'); if (!trailerUrl) return; if (getComputedStyle(anchor).position !== 'relative') anchor.style.position = 'relative'; let videoElem = null; anchor.addEventListener('mouseenter', () => { if (videoElem) return; videoElem = Object.assign(document.createElement('video'), { src: trailerUrl, loop: true, muted: true, autoplay: true, playsInline: true }); Object.assign(videoElem.style, { position: 'absolute', top: 0, left: 0, width: '100%', height: '100%', objectFit: 'cover', zIndex: 10, pointerEvents: 'none', backgroundColor: 'black' }); anchor.appendChild(videoElem); videoElem.play(); }); anchor.addEventListener('mouseleave', () => { if (!videoElem) return; videoElem.pause(); videoElem.remove(); videoElem = null; }); });"
0 commit comments