Small improvements for users.
当前为
// ==UserScript==
// @name Endchan Plus
// @namespace https://greasyfork.org/en/scripts/380490-endchan-plus
// @version 0.2
// @description Small improvements for users.
// @author Doc
// @include https://endchan.xyz/*
// @grant none
// ==/UserScript==
var hover = document.createElement('img');
var vhover = document.createElement('video');
vhover.autoplay = true;
vhover.muted = true;
document.body.appendChild(vhover);
document.body.appendChild(hover);
var s = 'position:fixed;max-height:90vh;top:0px;right:0px;pointer-events:none;';
hover.style = s;
vhover.style = s;
document.addEventListener('mouseover', function (e) {
if (e.target.nodeName == 'IMG') {
if (e.target.parentNode.className == 'imgLink' && e.target.className != 'imgExpanded') {
hover.src = e.target.parentNode.href;
};
if (e.target.src.indexOf('video') != -1) {
vhover.src = e.target.src.replace('t_', '') + '.' + e.target.src.split('video')[1]
}
} else {
hover.src = '';
vhover.src = '';
}
});