Bilibili-Evolved/min/record-live-danmaku.min.js
2020-02-22 11:45:31 +08:00

1 line
688 B
JavaScript

(()=>{return(e,n)=>{const t=()=>{return Boolean(document.URL.match(/live\.bilibili\.com\/(\d)+/))};const d=()=>{const e=dq(`#record-live-danmaku`);let t;e.addEventListener("click",async()=>{if(!dq(".live-danmaku-recorder")){const e=await n.importAsync("record-live-danmaku.vue");t=(new(Vue.extend(e))).$mount();const d=t.$el;document.body.insertAdjacentElement("beforeend",d);t.opened=true}else{t.opened=!t.opened}dq(".gui-settings-mask").click()})};return{widget:{content:`\n<button class="gui-settings-flat-button" id="record-live-danmaku">\n<i class="mdi mdi-24px mdi-record-rec" style="transform: scale(1.3)"></i>\n<span>记录弹幕</span>\n</button>\n`,condition:t,success:d}}}})();