mirror of
https://github.com/the1812/Bilibili-Evolved.git
synced 2025-11-04 21:22:45 +08:00
Remove scroll into view for wide screen
This commit is contained in:
parent
6436ac8d95
commit
72a1337403
@ -1177,7 +1177,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.css"] = `.bilibili-player-video-danmaku-setting-wrap{display:none!important}`;
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}Observer.videoChange(()=>{if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){return}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings=Object.assign(e.danmakuSettings,{[t]:n.checked})})}}n();a()}})}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-layout.min.js"] = (()=>{return(e,o)=>{class t{setCookie(e,o){document.cookie=`${e}=${o};path=/;domain=.bilibili.com;max-age=31536000`}clearCookie(e){document.cookie=`${e}=;path=/;domain=.bilibili.com;max-age=0`}getValue(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${e}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1")}checkSettings(){return e.useDefaultPlayerLayout}checkCookies(){}useNewLayout(){}useOldLayout(){}setLayout(e){if(e){this.useNewLayout()}else{this.useOldLayout()}}}class s extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<0&&e.defaultPlayerLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultPlayerLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustvideo";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,1)}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,-1)}}class u extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<=0&&e.defaultBangumiLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultBangumiLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustpgcv";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,"0606")}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,0)}}const i=new s;addSettingsListener("defaultPlayerLayout",e=>{i.setLayout(e==="新版")});const a=new u;addSettingsListener("defaultBangumiLayout",e=>{a.setLayout(e==="新版")})}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click();document.querySelector("#bofqi").scrollIntoView({behavior:"smooth"})}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let o=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));o=(()=>i(false))}}async function a(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const a=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(a&&$("#bilibiliPlayer[class*=mode-]").length===0){a.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",o,{once:true})}}Observer.videoChange(a)}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click()}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let a=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));a=(()=>i(false))}}async function o(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const o=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(o&&$("#bilibiliPlayer[class*=mode-]").length===0){o.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",a,{once:true})}}Observer.videoChange(o)}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-video-quality.min.js"] = (()=>{return(e,a)=>{const t=[{name:"1080P60",value:116},{name:"1080P+",value:112},{name:"1080P",value:80},{name:"720P60",value:74},{name:"720P",value:64},{name:"480P",value:32},{name:"360P",value:15},{name:"自动",value:0}];async function i(){const a=await SpinQuery.any(()=>$(".bilibili-player-video-quality-menu .bui-select-list>li.bui-select-item"));if(!a){return}const i=(e,a)=>a-e;const[n]=a.toArray().map(e=>parseInt(e.getAttribute("data-value"))).sort(i);const[l]=t.filter(a=>a.name===e.defaultVideoQuality).map(e=>e.value).sort(i);const[r]=t.map(e=>e.value).filter(e=>e<=Math.min(l,n)).sort(i);const u=await SpinQuery.select(()=>document.querySelector("video"));function s(){a.each((e,a)=>{if(parseInt(a.getAttribute("data-value"))===r){a.click()}});this.removeEventListener("play",s)}u.addEventListener("play",s)}if(Observer.videoChange){Observer.videoChange(i)}else{Observer.childList("#bofqi",()=>i())}}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-video-speed.min.js"] = (()=>{return(e,a)=>{const i=a=>{const i=parseFloat(e.defaultVideoSpeed);a.playbackRate=i;SpinQuery.condition(()=>a,()=>a.playbackRate!==i,()=>a.playbackRate=i)};Observer.videoChange(()=>{const e=dq(".bilibili-player-video video");if(!e){return}i(e)})}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/double-click-fullscreen.min.js"] = (()=>{return(i,e)=>{(async()=>{const e=["https://www.bilibili.com/bangumi/","https://www.bilibili.com/video/"];if(!e.some(i=>document.URL.startsWith(i))){return}if(i.touchVideoPlayer&&i.touchVideoPlayerDoubleTapControl){Toast.info("在开启了<span>播放器触摸支持-启用双击控制</span>后, <span>双击全屏</span>功能将无效.","提示");i.doubleClickFullscreen=false;return}await SpinQuery.unsafeJquery();const l=await SpinQuery.condition(()=>dq(".bilibili-player-area"),i=>i!==null&&unsafeWindow.$(".bilibili-player-video").data("events"));if(l===null){return}const n="double-click-fullscreen";if(!l.classList.contains(n)){l.classList.add(n);const e=unsafeWindow.$(".bilibili-player-video");const t=i.doubleClickFullscreenPreventSingleClick?e.data("events").click[0].handler:()=>{};const c=new DoubleClickEvent(()=>dq(".bilibili-player-video-btn-fullscreen").click(),i=>t(i));if(i.doubleClickFullscreenPreventSingleClick){e.unbind("click")}c.bind(e[0])}})()}})();
|
||||
|
||||
@ -1177,7 +1177,7 @@ offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/m
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.css"] = `.bilibili-player-video-danmaku-setting-wrap{display:none!important}`;
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}Observer.videoChange(()=>{if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){return}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings=Object.assign(e.danmakuSettings,{[t]:n.checked})})}}n();a()}})}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-layout.min.js"] = (()=>{return(e,o)=>{class t{setCookie(e,o){document.cookie=`${e}=${o};path=/;domain=.bilibili.com;max-age=31536000`}clearCookie(e){document.cookie=`${e}=;path=/;domain=.bilibili.com;max-age=0`}getValue(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${e}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1")}checkSettings(){return e.useDefaultPlayerLayout}checkCookies(){}useNewLayout(){}useOldLayout(){}setLayout(e){if(e){this.useNewLayout()}else{this.useOldLayout()}}}class s extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<0&&e.defaultPlayerLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultPlayerLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustvideo";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,1)}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,-1)}}class u extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<=0&&e.defaultBangumiLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultBangumiLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustpgcv";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,"0606")}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,0)}}const i=new s;addSettingsListener("defaultPlayerLayout",e=>{i.setLayout(e==="新版")});const a=new u;addSettingsListener("defaultBangumiLayout",e=>{a.setLayout(e==="新版")})}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click();document.querySelector("#bofqi").scrollIntoView({behavior:"smooth"})}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let o=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));o=(()=>i(false))}}async function a(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const a=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(a&&$("#bilibiliPlayer[class*=mode-]").length===0){a.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",o,{once:true})}}Observer.videoChange(a)}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click()}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let a=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));a=(()=>i(false))}}async function o(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const o=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(o&&$("#bilibiliPlayer[class*=mode-]").length===0){o.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",a,{once:true})}}Observer.videoChange(o)}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-video-quality.min.js"] = (()=>{return(e,a)=>{const t=[{name:"1080P60",value:116},{name:"1080P+",value:112},{name:"1080P",value:80},{name:"720P60",value:74},{name:"720P",value:64},{name:"480P",value:32},{name:"360P",value:15},{name:"自动",value:0}];async function i(){const a=await SpinQuery.any(()=>$(".bilibili-player-video-quality-menu .bui-select-list>li.bui-select-item"));if(!a){return}const i=(e,a)=>a-e;const[n]=a.toArray().map(e=>parseInt(e.getAttribute("data-value"))).sort(i);const[l]=t.filter(a=>a.name===e.defaultVideoQuality).map(e=>e.value).sort(i);const[r]=t.map(e=>e.value).filter(e=>e<=Math.min(l,n)).sort(i);const u=await SpinQuery.select(()=>document.querySelector("video"));function s(){a.each((e,a)=>{if(parseInt(a.getAttribute("data-value"))===r){a.click()}});this.removeEventListener("play",s)}u.addEventListener("play",s)}if(Observer.videoChange){Observer.videoChange(i)}else{Observer.childList("#bofqi",()=>i())}}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-video-speed.min.js"] = (()=>{return(e,a)=>{const i=a=>{const i=parseFloat(e.defaultVideoSpeed);a.playbackRate=i;SpinQuery.condition(()=>a,()=>a.playbackRate!==i,()=>a.playbackRate=i)};Observer.videoChange(()=>{const e=dq(".bilibili-player-video video");if(!e){return}i(e)})}})();
|
||||
offlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/double-click-fullscreen.min.js"] = (()=>{return(i,e)=>{(async()=>{const e=["https://www.bilibili.com/bangumi/","https://www.bilibili.com/video/"];if(!e.some(i=>document.URL.startsWith(i))){return}if(i.touchVideoPlayer&&i.touchVideoPlayerDoubleTapControl){Toast.info("在开启了<span>播放器触摸支持-启用双击控制</span>后, <span>双击全屏</span>功能将无效.","提示");i.doubleClickFullscreen=false;return}await SpinQuery.unsafeJquery();const l=await SpinQuery.condition(()=>dq(".bilibili-player-area"),i=>i!==null&&unsafeWindow.$(".bilibili-player-video").data("events"));if(l===null){return}const n="double-click-fullscreen";if(!l.classList.contains(n)){l.classList.add(n);const e=unsafeWindow.$(".bilibili-player-video");const t=i.doubleClickFullscreenPreventSingleClick?e.data("events").click[0].handler:()=>{};const c=new DoubleClickEvent(()=>dq(".bilibili-player-video-btn-fullscreen").click(),i=>t(i));if(i.doubleClickFullscreenPreventSingleClick){e.unbind("click")}c.bind(e[0])}})()}})();
|
||||
|
||||
@ -1176,7 +1176,7 @@ onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/m
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/default-danmaku-settings.min.css"] = `.bilibili-player-video-danmaku-setting-wrap{display:none!important}`;
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}Observer.videoChange(()=>{if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){return}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings=Object.assign(e.danmakuSettings,{[t]:n.checked})})}}n();a()}})}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/default-player-layout.min.js"] = (()=>{return(e,o)=>{class t{setCookie(e,o){document.cookie=`${e}=${o};path=/;domain=.bilibili.com;max-age=31536000`}clearCookie(e){document.cookie=`${e}=;path=/;domain=.bilibili.com;max-age=0`}getValue(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${e}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1")}checkSettings(){return e.useDefaultPlayerLayout}checkCookies(){}useNewLayout(){}useOldLayout(){}setLayout(e){if(e){this.useNewLayout()}else{this.useOldLayout()}}}class s extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<0&&e.defaultPlayerLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultPlayerLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustvideo";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,1)}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,-1)}}class u extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<=0&&e.defaultBangumiLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultBangumiLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustpgcv";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,"0606")}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,0)}}const i=new s;addSettingsListener("defaultPlayerLayout",e=>{i.setLayout(e==="新版")});const a=new u;addSettingsListener("defaultBangumiLayout",e=>{a.setLayout(e==="新版")})}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click();document.querySelector("#bofqi").scrollIntoView({behavior:"smooth"})}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let o=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));o=(()=>i(false))}}async function a(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const a=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(a&&$("#bilibiliPlayer[class*=mode-]").length===0){a.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",o,{once:true})}}Observer.videoChange(a)}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click()}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let a=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));a=(()=>i(false))}}async function o(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const o=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(o&&$("#bilibiliPlayer[class*=mode-]").length===0){o.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",a,{once:true})}}Observer.videoChange(o)}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/default-video-quality.min.js"] = (()=>{return(e,a)=>{const t=[{name:"1080P60",value:116},{name:"1080P+",value:112},{name:"1080P",value:80},{name:"720P60",value:74},{name:"720P",value:64},{name:"480P",value:32},{name:"360P",value:15},{name:"自动",value:0}];async function i(){const a=await SpinQuery.any(()=>$(".bilibili-player-video-quality-menu .bui-select-list>li.bui-select-item"));if(!a){return}const i=(e,a)=>a-e;const[n]=a.toArray().map(e=>parseInt(e.getAttribute("data-value"))).sort(i);const[l]=t.filter(a=>a.name===e.defaultVideoQuality).map(e=>e.value).sort(i);const[r]=t.map(e=>e.value).filter(e=>e<=Math.min(l,n)).sort(i);const u=await SpinQuery.select(()=>document.querySelector("video"));function s(){a.each((e,a)=>{if(parseInt(a.getAttribute("data-value"))===r){a.click()}});this.removeEventListener("play",s)}u.addEventListener("play",s)}if(Observer.videoChange){Observer.videoChange(i)}else{Observer.childList("#bofqi",()=>i())}}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/default-video-speed.min.js"] = (()=>{return(e,a)=>{const i=a=>{const i=parseFloat(e.defaultVideoSpeed);a.playbackRate=i;SpinQuery.condition(()=>a,()=>a.playbackRate!==i,()=>a.playbackRate=i)};Observer.videoChange(()=>{const e=dq(".bilibili-player-video video");if(!e){return}i(e)})}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/preview/min/double-click-fullscreen.min.js"] = (()=>{return(i,e)=>{(async()=>{const e=["https://www.bilibili.com/bangumi/","https://www.bilibili.com/video/"];if(!e.some(i=>document.URL.startsWith(i))){return}if(i.touchVideoPlayer&&i.touchVideoPlayerDoubleTapControl){Toast.info("在开启了<span>播放器触摸支持-启用双击控制</span>后, <span>双击全屏</span>功能将无效.","提示");i.doubleClickFullscreen=false;return}await SpinQuery.unsafeJquery();const l=await SpinQuery.condition(()=>dq(".bilibili-player-area"),i=>i!==null&&unsafeWindow.$(".bilibili-player-video").data("events"));if(l===null){return}const n="double-click-fullscreen";if(!l.classList.contains(n)){l.classList.add(n);const e=unsafeWindow.$(".bilibili-player-video");const t=i.doubleClickFullscreenPreventSingleClick?e.data("events").click[0].handler:()=>{};const c=new DoubleClickEvent(()=>dq(".bilibili-player-video-btn-fullscreen").click(),i=>t(i));if(i.doubleClickFullscreenPreventSingleClick){e.unbind("click")}c.bind(e[0])}})()}})();
|
||||
|
||||
@ -1176,7 +1176,7 @@ onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/mi
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.css"] = `.bilibili-player-video-danmaku-setting-wrap{display:none!important}`;
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-danmaku-settings.min.js"] = (()=>{return(e,t)=>{async function i(e,t){const i=await SpinQuery.select(()=>document.querySelector(e));if(!i){return}i.checked=t;raiseEvent(i,"change")}Observer.videoChange(()=>{if(!e.enableDanmaku){i(".bilibili-player-video-danmaku-switch>input",false)}if(e.rememberDanmakuSettings){const i={subtitlesPreserve:".bilibili-player-video-danmaku-setting-left-preventshade input",smartMask:".bilibili-player-video-danmaku-setting-left-danmaku-mask input"};async function n(){const n=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-danmaku-setting"));if(!n){return}await loadLazyPanel(".bilibili-player-video-danmaku-setting");setTimeout(()=>t.removeStyle("defaultDanmakuSettingsStyle"),300);for(const[t,n]of Object.entries(e.danmakuSettings)){const e=await SpinQuery.select(()=>document.querySelector(i[t]));if(e!==null&&e.checked!==undefined&&e.checked!==n){e.click()}}}async function a(){for(const t in e.danmakuSettings){const n=await SpinQuery.select(()=>document.querySelector(i[t]));if(!n){return}n.addEventListener("click",()=>{e.danmakuSettings=Object.assign(e.danmakuSettings,{[t]:n.checked})})}}n();a()}})}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-layout.min.js"] = (()=>{return(e,o)=>{class t{setCookie(e,o){document.cookie=`${e}=${o};path=/;domain=.bilibili.com;max-age=31536000`}clearCookie(e){document.cookie=`${e}=;path=/;domain=.bilibili.com;max-age=0`}getValue(e){return document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${e}\\s*\\=\\s*([^;]*).*$)|^.*$`),"$1")}checkSettings(){return e.useDefaultPlayerLayout}checkCookies(){}useNewLayout(){}useOldLayout(){}setLayout(e){if(e){this.useNewLayout()}else{this.useOldLayout()}}}class s extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<0&&e.defaultPlayerLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultPlayerLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustvideo";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,1)}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,-1)}}class u extends t{checkCookies(){super.checkCookies();const o=this.getValue(this.cookieKey);if(o===""||parseInt(o)<=0&&e.defaultBangumiLayout!=="旧版"){console.log(`default/old -> new`);this.useNewLayout()}else if(e.defaultBangumiLayout!=="新版"){console.log(`new -> old`);this.useOldLayout()}}constructor(){super();this.cookieKey="stardustpgcv";this.checkCookies()}useNewLayout(){super.useNewLayout();this.setCookie(this.cookieKey,"0606")}useOldLayout(){super.useOldLayout();this.setCookie(this.cookieKey,0)}}const i=new s;addSettingsListener("defaultPlayerLayout",e=>{i.setLayout(e==="新版")});const a=new u;addSettingsListener("defaultBangumiLayout",e=>{a.setLayout(e==="新版")})}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click();document.querySelector("#bofqi").scrollIntoView({behavior:"smooth"})}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let o=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));o=(()=>i(false))}}async function a(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const a=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(a&&$("#bilibiliPlayer[class*=mode-]").length===0){a.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",o,{once:true})}}Observer.videoChange(a)}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-player-mode.min.js"] = (()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click()}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let a=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));a=(()=>i(false))}}async function o(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const o=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(o&&$("#bilibiliPlayer[class*=mode-]").length===0){o.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",a,{once:true})}}Observer.videoChange(o)}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-video-quality.min.js"] = (()=>{return(e,a)=>{const t=[{name:"1080P60",value:116},{name:"1080P+",value:112},{name:"1080P",value:80},{name:"720P60",value:74},{name:"720P",value:64},{name:"480P",value:32},{name:"360P",value:15},{name:"自动",value:0}];async function i(){const a=await SpinQuery.any(()=>$(".bilibili-player-video-quality-menu .bui-select-list>li.bui-select-item"));if(!a){return}const i=(e,a)=>a-e;const[n]=a.toArray().map(e=>parseInt(e.getAttribute("data-value"))).sort(i);const[l]=t.filter(a=>a.name===e.defaultVideoQuality).map(e=>e.value).sort(i);const[r]=t.map(e=>e.value).filter(e=>e<=Math.min(l,n)).sort(i);const u=await SpinQuery.select(()=>document.querySelector("video"));function s(){a.each((e,a)=>{if(parseInt(a.getAttribute("data-value"))===r){a.click()}});this.removeEventListener("play",s)}u.addEventListener("play",s)}if(Observer.videoChange){Observer.videoChange(i)}else{Observer.childList("#bofqi",()=>i())}}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/default-video-speed.min.js"] = (()=>{return(e,a)=>{const i=a=>{const i=parseFloat(e.defaultVideoSpeed);a.playbackRate=i;SpinQuery.condition(()=>a,()=>a.playbackRate!==i,()=>a.playbackRate=i)};Observer.videoChange(()=>{const e=dq(".bilibili-player-video video");if(!e){return}i(e)})}})();
|
||||
onlineData["https://raw.githubusercontent.com/the1812/Bilibili-Evolved/master/min/double-click-fullscreen.min.js"] = (()=>{return(i,e)=>{(async()=>{const e=["https://www.bilibili.com/bangumi/","https://www.bilibili.com/video/"];if(!e.some(i=>document.URL.startsWith(i))){return}if(i.touchVideoPlayer&&i.touchVideoPlayerDoubleTapControl){Toast.info("在开启了<span>播放器触摸支持-启用双击控制</span>后, <span>双击全屏</span>功能将无效.","提示");i.doubleClickFullscreen=false;return}await SpinQuery.unsafeJquery();const l=await SpinQuery.condition(()=>dq(".bilibili-player-area"),i=>i!==null&&unsafeWindow.$(".bilibili-player-video").data("events"));if(l===null){return}const n="double-click-fullscreen";if(!l.classList.contains(n)){l.classList.add(n);const e=unsafeWindow.$(".bilibili-player-video");const t=i.doubleClickFullscreenPreventSingleClick?e.data("events").click[0].handler:()=>{};const c=new DoubleClickEvent(()=>dq(".bilibili-player-video-btn-fullscreen").click(),i=>t(i));if(i.doubleClickFullscreenPreventSingleClick){e.unbind("click")}c.bind(e[0])}})()}})();
|
||||
|
||||
@ -58,7 +58,7 @@
|
||||
"default-danmaku-settings.min.css": "D9942B184FEDA7B08CFA0C34920E97D7A83B81762DCBF757642EBB60F95FF25D",
|
||||
"default-danmaku-settings.min.js": "9DBC9AC9B5A3B59EBCC6F04D36527B523D66203AC5FE7C2AD5DB46FFB84F9382",
|
||||
"default-player-layout.min.js": "C6CE64216569A006566ADD7FC69451897612F46CC9641B8B15E0A13D5B1F2455",
|
||||
"default-player-mode.min.js": "6A699382CE6C036B1510DB53AD21D4E98472140E8470BD38BD94B4D249C57FF2",
|
||||
"default-player-mode.min.js": "244264CF975A8266ABB239C24E5CFEE0E3C918340267571244EE2CDC893D7167",
|
||||
"default-video-quality.min.js": "D423D80B3151ACA49D8F769054E0F839DA2367E7F7C0590EFD60F71B4A6BEADB",
|
||||
"default-video-speed.min.js": "34E3D2BC8BD5BBC2534EDE6D7B02DE6D5F4A01879641A9E128B4C24124759D77",
|
||||
"double-click-fullscreen.min.js": "09C035FC7E281ABB042A4200F69757AB093079DBCC9939BE8C53C23EE2EDE41C",
|
||||
|
||||
BIN
min/bundle.zip
BIN
min/bundle.zip
Binary file not shown.
2
min/default-player-mode.min.js
vendored
2
min/default-player-mode.min.js
vendored
@ -1 +1 @@
|
||||
(()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click();document.querySelector("#bofqi").scrollIntoView({behavior:"smooth"})}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let o=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));o=(()=>i(false))}}async function a(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const a=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(a&&$("#bilibiliPlayer[class*=mode-]").length===0){a.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",o,{once:true})}}Observer.videoChange(a)}})();
|
||||
(()=>{return(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const n=[{name:"常规",action:()=>{}},{name:"宽屏",action:()=>{document.querySelector(".bilibili-player-video-btn-widescreen").click()}},{name:"网页全屏",action:()=>{document.querySelector(".bilibili-player-video-web-fullscreen").click()}},{name:"全屏",action:async()=>{const e=await SpinQuery.condition(()=>document.querySelector(".bilibili-player-video video"),e=>{return e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()});if(e===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}document.querySelector(".bilibili-player-video-btn-fullscreen").click()}}];let t=()=>{};let a=()=>{};async function l(){if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await SpinQuery.any(()=>unsafeWindow.$(".bilibili-player-video-btn-setting"));if(!e){return}e.mouseover().mouseout();const i=async e=>{const i=await SpinQuery.select(()=>document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));i.checked=e;raiseEvent(i,"change")};t=(()=>i(true));a=(()=>i(false))}}async function o(){await l();await SpinQuery.condition(()=>$(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),e=>e.length===3&&$("video").length>0&&$("video").prop("duration"));const i=document.querySelector("video");if(!i){return}const o=n.find(i=>i.name===e.defaultPlayerMode);{const n=()=>{if(o&&$("#bilibiliPlayer[class*=mode-]").length===0){o.action()}};if(e.applyPlayerModeOnPlay&&!e.autoPlay){i.addEventListener("play",n,{once:true})}else{n()}if(!e.autoPlay){i.addEventListener("play",t,{once:true})}else{t()}i.addEventListener("ended",a,{once:true})}}Observer.videoChange(o)}})();
|
||||
@ -1,120 +1,111 @@
|
||||
if (typeof isEmbeddedPlayer !== "undefined" && isEmbeddedPlayer()) {
|
||||
return;
|
||||
return;
|
||||
}
|
||||
const playerModes = [
|
||||
{
|
||||
name: "常规",
|
||||
action: () => { },
|
||||
{
|
||||
name: "常规",
|
||||
action: () => { },
|
||||
},
|
||||
{
|
||||
name: "宽屏",
|
||||
action: () => {
|
||||
document.querySelector(".bilibili-player-video-btn-widescreen").click();
|
||||
// document.querySelector("#bofqi").scrollIntoView({ behavior: "smooth" });
|
||||
},
|
||||
{
|
||||
name: "宽屏",
|
||||
action: () =>
|
||||
{
|
||||
document.querySelector(".bilibili-player-video-btn-widescreen").click();
|
||||
document.querySelector("#bofqi").scrollIntoView({ behavior: "smooth" });
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "网页全屏",
|
||||
action: () => {
|
||||
document.querySelector(".bilibili-player-video-web-fullscreen").click();
|
||||
},
|
||||
{
|
||||
name: "网页全屏",
|
||||
action: () =>
|
||||
{
|
||||
document.querySelector(".bilibili-player-video-web-fullscreen").click();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "全屏",
|
||||
action: async () =>
|
||||
{
|
||||
const video = await SpinQuery.condition(
|
||||
() => document.querySelector(".bilibili-player-video video"),
|
||||
it =>
|
||||
{
|
||||
return it !== null && it.readyState === 4
|
||||
&& document.readyState === "complete" && document.hasFocus();
|
||||
});
|
||||
if (video === null)
|
||||
{
|
||||
console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");
|
||||
return;
|
||||
}
|
||||
document.querySelector(".bilibili-player-video-btn-fullscreen").click();
|
||||
},
|
||||
},
|
||||
{
|
||||
name: "全屏",
|
||||
action: async () => {
|
||||
const video = await SpinQuery.condition(
|
||||
() => document.querySelector(".bilibili-player-video video"),
|
||||
it => {
|
||||
return it !== null && it.readyState === 4
|
||||
&& document.readyState === "complete" && document.hasFocus();
|
||||
});
|
||||
if (video === null) {
|
||||
console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");
|
||||
return;
|
||||
}
|
||||
document.querySelector(".bilibili-player-video-btn-fullscreen").click();
|
||||
},
|
||||
},
|
||||
];
|
||||
let lightOff = () => { };
|
||||
let lightOn = () => { };
|
||||
async function initLights ()
|
||||
{
|
||||
if (settings.autoLightOff) {
|
||||
await SpinQuery.unsafeJquery();
|
||||
const settingsButton = await SpinQuery.any(() => unsafeWindow.$(".bilibili-player-video-btn-setting"));
|
||||
if (!settingsButton) {
|
||||
return;
|
||||
}
|
||||
settingsButton.mouseover().mouseout();
|
||||
const setLight = async lightOff =>
|
||||
{
|
||||
const checkbox = await SpinQuery.select(
|
||||
() => document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));
|
||||
checkbox.checked = lightOff;
|
||||
raiseEvent(checkbox, "change");
|
||||
};
|
||||
lightOff = () => setLight(true);
|
||||
lightOn = () => setLight(false);
|
||||
async function initLights () {
|
||||
if (settings.autoLightOff) {
|
||||
await SpinQuery.unsafeJquery();
|
||||
const settingsButton = await SpinQuery.any(() => unsafeWindow.$(".bilibili-player-video-btn-setting"));
|
||||
if (!settingsButton) {
|
||||
return;
|
||||
}
|
||||
settingsButton.mouseover().mouseout();
|
||||
const setLight = async lightOff => {
|
||||
const checkbox = await SpinQuery.select(
|
||||
() => document.querySelector(".bilibili-player-video-btn-setting-panel-others-content-lightoff .bui-checkbox-input"));
|
||||
checkbox.checked = lightOff;
|
||||
raiseEvent(checkbox, "change");
|
||||
};
|
||||
lightOff = () => setLight(true);
|
||||
lightOn = () => setLight(false);
|
||||
}
|
||||
}
|
||||
async function main ()
|
||||
{
|
||||
await initLights();
|
||||
await SpinQuery.condition(
|
||||
() => $(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),
|
||||
it => it.length === 3 && $("video").length > 0 && $("video").prop("duration"));
|
||||
async function main () {
|
||||
await initLights();
|
||||
await SpinQuery.condition(
|
||||
() => $(".bilibili-player-video,.bilibili-player-video-btn-start,.bilibili-player-area"),
|
||||
it => it.length === 3 && $("video").length > 0 && $("video").prop("duration"));
|
||||
|
||||
const video = document.querySelector("video");
|
||||
if (!video) {
|
||||
return;
|
||||
const video = document.querySelector("video");
|
||||
if (!video) {
|
||||
return;
|
||||
}
|
||||
const info = playerModes.find(it => it.name === settings.defaultPlayerMode);
|
||||
// if (info.name === "全屏")
|
||||
// {
|
||||
// const unsafe$ = await SpinQuery.unsafeJquery();
|
||||
// const playButton = document.querySelector(".bilibili-player-video-btn-start");
|
||||
// const playerButtonClick = () =>
|
||||
// {
|
||||
// const events = unsafe$(".bilibili-player-video-btn-fullscreen").data("events");
|
||||
// if (events.click && events.click[0] && events.click[0].handler)
|
||||
// {
|
||||
// const handler = unsafe$(".bilibili-player-video-btn-fullscreen").data("events").click[0].handler;
|
||||
// console.log(handler);
|
||||
// handler();
|
||||
// }
|
||||
|
||||
// playButton.removeEventListener("click", playerButtonClick);
|
||||
// };
|
||||
// playButton.addEventListener("click", playerButtonClick);
|
||||
// }
|
||||
// else
|
||||
{
|
||||
const onplay = () => {
|
||||
if (info && $("#bilibiliPlayer[class*=mode-]").length === 0) {
|
||||
info.action();
|
||||
}
|
||||
};
|
||||
if (settings.applyPlayerModeOnPlay && !settings.autoPlay) {
|
||||
video.addEventListener("play", onplay, { once: true });
|
||||
}
|
||||
const info = playerModes.find(it => it.name === settings.defaultPlayerMode);
|
||||
// if (info.name === "全屏")
|
||||
// {
|
||||
// const unsafe$ = await SpinQuery.unsafeJquery();
|
||||
// const playButton = document.querySelector(".bilibili-player-video-btn-start");
|
||||
// const playerButtonClick = () =>
|
||||
// {
|
||||
// const events = unsafe$(".bilibili-player-video-btn-fullscreen").data("events");
|
||||
// if (events.click && events.click[0] && events.click[0].handler)
|
||||
// {
|
||||
// const handler = unsafe$(".bilibili-player-video-btn-fullscreen").data("events").click[0].handler;
|
||||
// console.log(handler);
|
||||
// handler();
|
||||
// }
|
||||
|
||||
// playButton.removeEventListener("click", playerButtonClick);
|
||||
// };
|
||||
// playButton.addEventListener("click", playerButtonClick);
|
||||
// }
|
||||
// else
|
||||
{
|
||||
const onplay = () =>
|
||||
{
|
||||
if (info && $("#bilibiliPlayer[class*=mode-]").length === 0) {
|
||||
info.action();
|
||||
}
|
||||
};
|
||||
if (settings.applyPlayerModeOnPlay && !settings.autoPlay) {
|
||||
video.addEventListener("play", onplay, { once: true });
|
||||
}
|
||||
else {
|
||||
onplay();
|
||||
}
|
||||
|
||||
if (!settings.autoPlay) {
|
||||
video.addEventListener("play", lightOff, { once: true });
|
||||
}
|
||||
else {
|
||||
lightOff();
|
||||
}
|
||||
video.addEventListener("ended", lightOn, { once: true });
|
||||
else {
|
||||
onplay();
|
||||
}
|
||||
|
||||
if (!settings.autoPlay) {
|
||||
video.addEventListener("play", lightOff, { once: true });
|
||||
}
|
||||
else {
|
||||
lightOff();
|
||||
}
|
||||
video.addEventListener("ended", lightOn, { once: true });
|
||||
}
|
||||
}
|
||||
Observer.videoChange(main);
|
||||
Loading…
Reference in New Issue
Block a user