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 45 46 47 48
|
(function() { var btn = document.createElement('button'); btn.innerText = '取消失效视频收藏'; btn.setAttribute('class', 'deleteBtn'); var style = document.createElement('style'); style.innerText = `.deleteBtn{position:fixed;top:150px;right:15px;width:75px;height:55px;padding:3px 5px;border:1px solid #0d6efd;cursor:pointer;color:#0d6efd;font-size:14px;background-color:transparent;border-radius:5px;transition:color .15s ease-in-out,background-color .15s ease-in-out;z-index:9999999999999;}.deleteBtn:hover{background-color:#0d6efd;color:#fff;}`; document.head.appendChild(style); document.body.appendChild(btn); document.querySelector('.deleteBtn').addEventListener('click', function () { deleteV(); })
function deleteV() { var videoLis = document.querySelectorAll(".small-item") videoLis.forEach((vli) => { var titleInfo = vli.children[1].textContent if (titleInfo === '已失效视频') { vli.children[3].children[1].children[0].click() } }) } })();
|