Bilibili-Evolved/min/activity-image-saver.min.js

1 line
747 B
JavaScript

(()=>{return(t,e)=>{(async()=>{if(!document.URL.startsWith("https://t.bilibili.com")&&!document.URL.startsWith("space.bilibili.com")){return}const t=t=>{const e=t.querySelector(".image-viewer");if(e===null){console.log(t)}else{e.addEventListener("contextmenu",()=>{setTimeout(()=>{const t=dq(".pop-message .toast-text");if(t&&t.innerHTML.includes("作者设置了禁止保存")){Toast.success(`<img src="${e.src}" width="200">`,"解除动态存图限制")}},200)})}};[...document.body.children].filter(t=>t.classList.contains("photo-imager-container")).forEach(t);Observer.childList(document.body,e=>{e.forEach(e=>{const s=[...e.addedNodes].filter(t=>t instanceof Element&&t.classList.contains("photo-imager-container"));s.forEach(t)})})})()}})();