1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44
|
(function() { 'use strict'; window.addEventListener('load', () => { setTimeout(() => { const input = document.createElement('input'); [...document.querySelectorAll('.opblock-tag')].forEach(dom => { dom.addEventListener('click', (e) => { setTimeout(() => { const sub = dom.nextElementSibling; if (sub.tagName == 'NOSCRIPT') return; const urlDomList = sub.querySelectorAll('.opblock-summary') urlDomList.forEach(urlDom => { const path = urlDom.querySelector('.opblock-summary-path').innerText; const icon = document.createElement('span'); icon.innerText = 'copy' icon.style.padding = '0 4px'; icon.addEventListener('click', (e) => { e.stopPropagation(); document.body.appendChild(input); input.value = path; input.select(); document.execCommand('copy'); document.body.removeChild(input); }); urlDom.appendChild(icon); }) }, 0) }) }) }, 1000) }) })();
|