// ==UserScript== // @name PVE IP // @namespace http://tampermonkey.net/ // @version 0.1 // @include https://*:8006/* // ==/UserScript== (function (i, s, o, g, r, c, a, m) { i['global_clipboard'] = r; i[r] = i[r] || function () { (i[r].q = i[r].q || []).push(arguments) }, i[r].l = 1 * new Date(); a = s.createElement(o), m = s.getElementsByTagName(o)[0]; a.async = 1; a.src = g; a.onload = c; m.parentNode.insertBefore(a, m); })(window, document, 'script', 'https://cdn.jsdelivr.net/npm/clipboard@2/dist/clipboard.min.js', 'ga', function onload() { var reg = /\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}/g; var itv = null; var list = []; function handleClick(t) { setTimeout(() => { t.style.color = 'green'; }, 1000); t.style.color = 'inherit'; return t.innerHTML.match(reg)[0]; } function applyClipboard() { var l = Array.from(document.querySelectorAll('label')).filter(i => i.textContent.match(reg))[0]; if (typeof l !== 'undefined') { if (list.indexOf(l) === -1) { list.push(l); l.style.color = 'green'; new ClipboardJS(l, { text: handleClick}); return; } } } itv = setInterval(applyClipboard, 500); });