Merge pull request #2331 from the1812/preview

Update to v1.12.19
This commit is contained in:
Grant Howard 2021-09-27 22:56:20 +08:00 committed by GitHub
commit 9f4e62f509
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
92 changed files with 1285 additions and 567 deletions

View File

@ -68,6 +68,7 @@
"repo",
"repost",
"reposts",
"squirtle",
"superchat",
"tabindex",
"truetype",

View File

@ -26,7 +26,7 @@
**注意事项**
- 近期番剧区改版, 大部分视频功能都不支持番剧.
- 港澳台等地区限定内容一概不支持.
- 如果你只是来下载视频的, 不需要其他功能, 建议找个专门支持下载的软件/插件. 本脚本的下载视频如果下载失败我可懒得管.
- 如果你只是来下载视频的, 不需要其他功能, 建议找个专门支持下载的软件/插件. 本脚本的下载视频就是凑合用用的, 如果下载失败我可懒得管.
- 做好觉悟, 脚本开启后不能使用弹幕点赞和举报, 全景视频不能用鼠标拖拽视角(只能用键盘操作), 对性能也有较大影响.
- 某些破坏性的大更新会使旧版脚本**完全**无法运行, 请及时检查更新.
- 使用 aria2 RPC 时脚本管理器可能会提示"脚本试图访问跨域资源", 请选择"始终允许".

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -19,6 +19,27 @@
| 时间 | 用户名 | 单号后4位 | 金额 |
| ------------------- | ------------- | --------- | ------ |
| 2021.09.25 13:56:04 | T*n | 3051 | ¥2.55 |
| 2021.09.24 12:03:07 | ** | 7134 | ¥1.66 |
| 2021.09.23 15:46:45 | *涛 | 6217 | ¥1.00 |
| 2021.09.19 23:29:23 | *M | 5595 | ¥5.00 |
| 2021.09.16 22:38:31 | *俊 | 9954 | ¥10.00 |
| 2021.09.12 15:53:40 | 1*2 | 2582 | ¥5.00 |
| 2021.09.12 05:04:22 | Damokles | 0826 | ¥10.00 |
| 2021.09.11 13:49:10 | X*X | 9088 | ¥5.00 |
| 2021.09.11 04:03:50 | 匿名 | 5617 | ¥8.88 |
| 2021.09.08 11:01:34 | *锐 | 2023 | ¥1.00 |
| 2021.09.06 23:37:57 | 匿名 | 7988 | ¥5.00 |
| 2021.09.01 00:15:50 | *沅 | 3822 | ¥2.00 |
| 2021.09.01 00:09:40 | *申 | 7942 | ¥10.00 |
| 2021.08.31 16:02:14 | ChanJohann | 6165 | ¥5.00 |
| 2021.08.30 19:05:11 | superuser | 7591 | ¥10.00 |
| 2021.08.28 23:12:02 | *经 | 4613 | ¥2.00 |
| 2021.08.27 07:54:22 | *喲 | 2626 | ¥1.00 |
| 2021.08.26 16:00:53 | *毅 | 5904 | ¥10.00 |
| 2021.08.23 12:24:30 | *锋 | 5739 | ¥1.50 |
| 2021.08.23 09:49:45 | *原 | 7547 | ¥5.00 |
| 2021.08.22 23:03:13 | *涛 | 4972 | ¥66.00 |
| 2021.08.17 09:37:58 | 匿名 | 0602 | ¥10.00 |
| 2021.08.16 20:42:21 | 匿名 | 6994 | ¥1.00 |
| 2021.08.16 20:40:53 | 匿名 | 8715 | ¥5.00 |

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>(e,t)=>{const r=async()=>{if(dq(".international-home")){const e=await SpinQuery.condition((()=>unsafeWindow["__INITIAL_STATE__"]),(e=>e!==undefined));return dqa(".first-screen .home-slide .item").slice(0,5).map(((t,r)=>{const i=t.querySelector("a").getAttribute("data-loc-id");return{url:e.locsData[i][r].url,title:t.querySelector(".title").textContent.trim(),isAd:Boolean(t.querySelector(".gg-icon,.bypb-icon")),imageUrl:t.querySelector("img").getAttribute("src").replace(/@.+$/,"")}}))}else{const e=dq(".chief-recommend-module .panel");const t=e.querySelector(".pic");const r=e.querySelectorAll(".title > a");return[...t.querySelectorAll("li")].map(((e,t)=>{const i=r[t];return{url:i.getAttribute("href"),title:i.innerText.trim(),isAd:Boolean(i.querySelector(".gg-pic")),imageUrl:e.querySelector("img").getAttribute("src").replace(/@.+$/,"")}}))}};return{export:{getBlackboards:r}}})();
(()=>(s,t)=>{const o=async()=>{const s=4694;const t=`https://api.bilibili.com/x/web-show/res/locs?pf=0&ids=${s}`;const{code:o,message:a,data:e}=await Ajax.getJson(t);if(o!==0){throw new Error(`获取活动卡片失败: ${a}`)}const r=e[s];return r.map((s=>({url:s.url,title:s.name,isAd:s.is_ad_loc,imageUrl:s.pic})))};return{export:{getBlackboards:o}}})();

View File

@ -1 +1 @@
(()=>(a,r)=>{const i=`<div class=blackboards><div class=header><div class=title>活动</div><a class=more href=https://www.bilibili.com/blackboard/x/act_list/ target=_blank><icon type=mdi icon=dots-horizontal></icon>更多</a></div><input class="hidden-input blackboard-radio"type=radio name=blackboard v-for="(b, i) of blackboards":checked="i === 0":id="'blackboard' + i":data-index=i :key=i><div class=blackboard-cards><a class=blackboard-card target=_blank v-for="(b, i) of blackboards":key=i :href=b.url :title=b.title><dpi-img :src=b.imageUrl :alt=b.title :size="{width: 500, height: 250}":root=cardsContainer></dpi-img><div class=title>{{b.title}}</div></a></div><div class=jump-dots><label v-for="(b, i) of blackboards":for="'blackboard' + i":key=i><div class=jump-dot></div></label></div></div>`;r.applyStyleFromText(`.simple-home .blackboards{position:relative;display:grid;grid-template-areas:"header header" "cards cards";grid-template-columns:8px 1fr;grid-template-rows:1fr 250px;row-gap:16px;column-gap:16px;align-self:start}.simple-home .blackboards .jump-dots{position:absolute;top:50%;left:8px;transform:translateY(-50%);grid-area:cards;align-self:center;justify-self:center}.simple-home .blackboards .jump-dots label{display:block}.simple-home .blackboards .jump-dots label:not(:last-child){margin-bottom:6px}.simple-home .blackboards .jump-dots .jump-dot{background-color:#8884;border:1px solid #8888;box-sizing:border-box;width:8px;height:20px;border-radius:8px;cursor:pointer}.simple-home .blackboards .blackboard-cards{grid-area:cards;--blackboard-width:568.5px;--blackboard-height:250px;width:var(--blackboard-width);height:var(--blackboard-height);border-radius:16px;overflow:hidden}.simple-home .blackboards .blackboard-cards .blackboard-card{width:100%;height:100%;position:relative;display:block;transition:.8s cubic-bezier(.44,.29,.13,1)}.simple-home .blackboards .blackboard-cards .blackboard-card img{width:100%;height:100%;object-fit:fill;display:block;border-radius:12px}.simple-home .blackboards .blackboard-cards .blackboard-card .title{position:absolute;bottom:8px;left:50%;transform:translateX(-50%);padding:4px 16px;color:#fff;background-color:#000a;font-size:14px;font-weight:700;border-radius:14px;white-space:nowrap;opacity:0}.simple-home .blackboards .blackboard-cards .blackboard-card:hover .title{opacity:1}`,"blackboard-style");return{export:Object.assign({template:i},{components:{Icon:()=>r.importAsync("icon.vue"),"dpi-img":()=>r.importAsync("dpi-img.vue")},data(){return{blackboards:[],interval:0}},destroyed(){if(this.interval){clearInterval(this.interval)}},computed:{cardsContainer(){return this.$el.querySelector(".blackboard-cards")}},async mounted(){const{getBlackboards:a}=await r.importAsync("blackboard");this.blackboards=(await a()).filter((a=>!a.isAd));const i=dq(".blackboards");this.interval=setInterval((()=>{if(!document.hasFocus()||i.matches(".blackboards:hover")){return}const a=parseInt(dq(`.blackboard-radio:checked`).getAttribute("data-index"));let r;if(a===this.blackboards.length-1){r=0}else{r=a+1}dq(`.blackboard-radio[data-index='${r}']`).checked=true}),5e3)}})}})();
(()=>(a,r)=>{const i=`<div class=blackboards><div class=header><div class=title>活动</div><a class=more href=https://www.bilibili.com/blackboard/x/act_list/ target=_blank><icon type=mdi icon=dots-horizontal></icon>更多</a></div><input class="hidden-input blackboard-radio"type=radio name=blackboard v-for="(b, i) of blackboards":checked="i === 0":id="'blackboard' + i":data-index=i :key=i><div class=blackboard-cards><a class=blackboard-card target=_blank v-for="(b, i) of blackboards":key=i :href=b.url :title=b.title><dpi-img :src=b.imageUrl :alt=b.title :size="{width: 500, height: 250}":root=cardsContainer></dpi-img><div class=title :title=b.title>{{b.title}}</div></a></div><div class=jump-dots><label v-for="(b, i) of blackboards":for="'blackboard' + i":key=i><div class=jump-dot></div></label></div></div>`;r.applyStyleFromText(`.simple-home .blackboards{position:relative;display:grid;grid-template-areas:"header header" "cards cards";grid-template-columns:8px 1fr;grid-template-rows:1fr 250px;row-gap:16px;column-gap:16px;align-self:start}.simple-home .blackboards .jump-dots{position:absolute;left:50%;bottom:0;transform:translateX(-50%);grid-area:cards;align-self:center;justify-self:center;display:flex;align-items:center}.simple-home .blackboards .jump-dots label{display:block;padding:8px 6px;cursor:pointer}.simple-home .blackboards .jump-dots .jump-dot{background-color:#8884;box-sizing:border-box;width:20px;height:8px;border-radius:8px}.simple-home .blackboards .blackboard-cards{display:flex;grid-area:cards;--blackboard-width:350px;--blackboard-height:250px;--image-height:197px;width:var(--blackboard-width);height:var(--blackboard-height);border-radius:16px;overflow:hidden;background-color:#fff;box-shadow:0 4px 8px 0 #0001}body.dark .simple-home .blackboards .blackboard-cards{background-color:#282828}.simple-home .blackboards .blackboard-cards .blackboard-card{flex:0 0 auto;width:100%;height:100%;position:relative;display:block;transition:.8s cubic-bezier(.44,.29,.13,1)}.simple-home .blackboards .blackboard-cards .blackboard-card img{width:100%;height:var(--image-height);object-fit:fill;display:block;border-radius:12px;transition-duration:inherit}.simple-home .blackboards .blackboard-cards .blackboard-card .title{position:absolute;bottom:24px;left:50%;transform:translateX(-50%);padding:0 16px;font-size:14px;font-weight:700;border-radius:14px;max-width:var(--blackboard-width);box-sizing:border-box;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}`,"blackboard-style");return{export:Object.assign({template:i},{components:{Icon:()=>r.importAsync("icon.vue"),"dpi-img":()=>r.importAsync("dpi-img.vue")},data(){return{blackboards:[],interval:0}},destroyed(){if(this.interval){clearInterval(this.interval)}},computed:{cardsContainer(){return this.$el.querySelector(".blackboard-cards")}},async mounted(){const{getBlackboards:a}=await r.importAsync("blackboard");this.blackboards=(await a()).filter((a=>!a.isAd));const i=dq(".blackboards");this.interval=setInterval((()=>{if(!document.hasFocus()||i.matches(".blackboards:hover")){return}const a=parseInt(dq(`.blackboard-radio:checked`).getAttribute("data-index"));let r;if(a===this.blackboards.length-1){r=0}else{r=a+1}dq(`.blackboard-radio[data-index='${r}']`).checked=true}),5e3)}})}})();

View File

@ -15,12 +15,12 @@
"auto-draw.min.js": "303469718E41C156C763AE085FC62B42AEFD654B7E6083DAF111C5D5EE4CA619",
"auto-play.min.js": "67A4735A629EC325009C8F79838FC1A852AB9AF15DFF8A2B60F0F0943DC3A4A9",
"auto-play-control.min.js": "2133E452091800D15F858CB9C26CE5D6AD3A9B46020EE669C39077843039B358",
"bangumi-timeline.vue.min.js": "BDC87EB6BE6C5D12DC6E9C75813E5BB2174C4A2D43A657F55874B31A533BAD9C",
"bangumi-timeline.vue.min.js": "C24D3F9D45C57ED653F085BA3A9E9B67296F4E1D1E16215D9C5206DB2D48A48C",
"batch-download.min.js": "044D6945486C5C7E76B8E6C2F98973F4D7C554BE0A09DB2055C9030B284C1B78",
"batch-warning.min.js": "15A2134D855D9098B9485AA8023B5D98838F67D18FAB414B0C1FCD32F9BD05DD",
"biliplus-redirect.min.js": "EEFF7EE484A8D214E8FA110694E99F8BB62BD7263D1458DC83E7047F4CD6B9D4",
"blackboard.min.js": "1B48B1630D016D3F91B4804FBB73E299696E2BCDB3498FF1191B5A86B48CF9DE",
"blackboard.vue.min.js": "4B5AA62C98113E4280DE14B970C1DD60DE73CE40AD6A808FAE891F9ACC9311CF",
"blackboard.min.js": "09E24A83A4B0AFDC1AFC22CD48E3DB443B557B432C147A9B8E64635983200CB7",
"blackboard.vue.min.js": "3AA5E607BBB54CC8302741EFDBB03D43CBEEA1DC045A17E9F72C524862033CB2",
"blur-video-control.min.css": "B72FA7AD198ED1C9A9620A83881441F96F9FF3083ED12203A324B9753A7CCFFD",
"blur-video-control.min.js": "F5C4C5E45BEB5BB671788FB72677FE121D6834C775912D7B1BCFE4A4EAFA599A",
"bpx-player-adaptor.min.js": "CCB4037F9925C7605AB54BE1FD7A9E48BE2493FEE1633E40AE79DF520AAAF3F6",
@ -33,7 +33,7 @@
"collapse-live-side-bar.min.js": "9B4296F88C32FD081E4FD0DD48B4353C243A423446CF1CA047EB3B574D597F80",
"column-image-exporter.min.js": "C8FA96C64E21D0195D95F1B7A5E67EFFC778DD46E2FCB4ACBE69C48E76B5E046",
"combo-like.min.js": "E32FE23747479132F90C3D66CA6EB78031B4F7388F77CC56668E41B3F05FE954",
"comment.min.css": "B713BFCF8A251A65B502C1B522E00DD1D7B085C8F475FD23235F34172B16A9C8",
"comment.min.css": "8D8B635B1020DDCCCF748F34B4EEC60CBB409166C53F70800836960B40D0BD05",
"comment.min.js": "1634EEADF5BF2A29E6D39AFDA17804AB2442CDA3BCB0B4D9DBAA6F6E7E965F72",
"comment-apis.min.js": "D0E6EF724B5C068AD55EE9F740090A782447CE373080848FCA24879FC56E5E8B",
"comment-dark.min.css": "E980508E86203743C36FEE4F7149BFF53961ECBC4EC140E8C162D18D395B940A",
@ -44,9 +44,9 @@
"copy-feeds-link.min.js": "36D7C804F088A6C6905CD91C5F9D2D58E20634C7E0814AE03740CCEC790F6BB4",
"custom-control-background.min.css": "1981FD2BF3B17ECF33F98D5DEDAF0D32ACBE9532A51FDB70822286991AB98EF3",
"custom-control-background.min.js": "483F57DDD56F5B3A77C9CB35EB7CA191BF34CB6B3EEF5E12A4C10A42ADE563A2",
"custom-navbar.min.css": "66B12A504E09B5CBAD985668A09887322210A9525279EFF0611290CCDE518ED2",
"custom-navbar.min.css": "3ADECA5A15ABD723ADE914BECC5D351A2ACA672A1C02CEA89C3F6AB0044B8A87",
"custom-navbar.min.html": "1F95ABCE9F19727CAF3B48C40E517EA4C2F602E9C2A73BD822B56BF91AB3F631",
"custom-navbar.min.js": "2A7B441224DE0D9C91A787EE99629D8F59919CB3050FE0B0E246758E1DAE2878",
"custom-navbar.min.js": "F82FC5A3A7A794A0F77433DDA5AFADD9B4C72CE97073EC707EF146F040D504E7",
"custom-navbar-activities.min.js": "A7AB41C75EFEF45F3186D5A110629FA98F16C552E3B6F58BA0A735CB86E58547",
"custom-navbar-blank.min.js": "E8F08DA7CD2C67F9D064B959A64CFC6658103DBCBE2B9B58D978A1742E02D829",
"custom-navbar-category.min.js": "F5E2A5D316D372BF43769D20095C4700A3A3E5F63CE3607F17030AF0784F1D34",
@ -58,7 +58,7 @@
"custom-navbar-logo.min.js": "CE70A2E60EBDB145FC07D97A1DDABD1077DAA66CE83574B97788216D788BA4C5",
"custom-navbar-messages.min.js": "17F42493B555476F3F1E4A6BF0E3AD0F0B4D8742F235B0FF60BD450AAA97588E",
"custom-navbar-rank.min.js": "3661DA6EB1485C71FCDC6BA50EF432252AB7019C9398031D4243C679183466E1",
"custom-navbar-search-box.min.js": "93FC05E77233A288D78200DE2824E9766D8D7DC9EFC2A5E724B095C3253E7288",
"custom-navbar-search-box.min.js": "E1813FD6A9B597A1E906C91DF4377006227ED50C6ADB1CF411A1779AE0C4F73B",
"custom-navbar-settings.min.js": "B41F2AF7AF10B968472DCF2539E9C530F4117D7D3811378D2DE163536CF31E51",
"custom-navbar-simple-link.min.js": "51E2FDD06832E585E86884890D1DC6321A802D43332D7E7B5758A20BC1AB1E03",
"custom-navbar-subscriptions.min.js": "D99A25DE4ABB104FA95166F51EB4FEE9DFDC4AE162CF189ECBCF99CA2E5E0E6C",
@ -69,9 +69,9 @@
"danmaku-converter.min.js": "C54666E9910A927B54051EAB7C3DB6F93C1F6010A47614A619AFD7487C3F7183",
"danmaku-segment.min.js": "43CC3236AFABA89BD0AE24D640809BE333772824E3994541AFC3CDDD9F881613",
"danmaku-send-bar.min.css": "F309FC17E7657BAA676D446458750D8069051617B44DD3D1457B4A9C519B2ED1",
"danmaku-send-bar.min.js": "3F635F4209092B6BA41865A945496861F4B1E0D9F2D31ABB5C021967B1B9FA19",
"dark.min.css": "0406EDF1A0549F6CD7B43D891CE373F395870950DB3E4719234138C3ACE2317C",
"dark.user.css": "209259CD8781584CF3B392C67F22DA273E7F15E15FF3113E075E552C98324FBC",
"danmaku-send-bar.min.js": "7F694676C4A4EA608C02981C2ABC27945270CC89C89F2F1FB66FD01327DD9066",
"dark.min.css": "6BAECA6516337A697B614422A6619D1E018B5A67B2170C9C3A6EB042D4947715",
"dark.user.css": "50E546B4C7419DC7D89EAE1CE419653F0F7E4C605FDACED8D23BDC5E926EB6C9",
"dark-color-scheme.min.js": "7C89C14ACEE44CCE2E402A63768A3B53251B4B1D82675DD85532AABB8F2082FA",
"dark-important.min.css": "29FAC0857FB4BDF4EAD24582D4984471E80FC83EF9BD9A108B17D5AC5617DE75",
"dark-navbar.min.css": "7FAD547E326B768904B3739C978DF86FFDDD5E5064FB8F490710D197CCC3018B",
@ -82,7 +82,7 @@
"default-danmaku-settings.min.js": "901EA05F842932F436F0ABEAC99802D286575F9033CE078AA246FD1453B98998",
"default-live-quality.min.js": "3DE4EC96DE1CB7F187E61B7045EC14EBBF74B1853A990B4FE32372F27D47F4E4",
"default-player-layout.min.js": "2F018C09DCCB9D0DD671ED4868A1EAC365D63CC51618EE076598C6624E3BEA7E",
"default-player-mode.min.js": "97798995F580FC6869CA7AD2A6134EEEC1FCCF4AEA69B7234642D6BF4F1A17DF",
"default-player-mode.min.js": "76BBFE1C953134B744ADB70038C0EAA0DD53291B1879555A7513CBDB4411365D",
"default-video-quality.min.js": "20C0F41F683D685CCD22BD91F0EB4C2227146DD5586EB65388EE8FA97F46F7D2",
"default-video-speed.min.js": "720B588D410C267C1EE411927C9FC9FBBAE693A6938134416962E7B5A0682D25",
"disable-danmaku-highlights.min.js": "1F8C7267B7015ABB737D2457FCCC2E48CC31364E63ACF330770D61B152C9ABC6",
@ -98,7 +98,7 @@
"download-video.min.css": "ABED6E1EE0F75AE64E1698FEF98CE9DF94EBDC707AABE4C305108CA73156C7A5",
"download-video.min.html": "BBF00C1AE2C6C0FE534F72C9C7D513AB1039E2390C1E5742D452296F52AAA4F3",
"download-video.min.js": "FC561BFA1B57590209892BDC4AB982F09A7D7B99E91D7A25BDD7316014243E9D",
"dpi-img.vue.min.js": "791188F92FC0FD6257F26F27379A6B4EF3447C04355A6B6EA8B330008A238FCD",
"dpi-img.vue.min.js": "006E641C11D51051F13BDE630DBC57E4F9FA58E3F106D6D073FBB7A100E9D222",
"expand-danmaku.min.js": "1D855006799D56AF09697EB8F6488303DB05811E8F3C84298AC08A4FE3A4CFA1",
"expand-description.min.css": "4B8023CD9C6AFFD65A8FB33F3735480AF1151DC1F3E2AC551442266268A6F873",
"expand-description.min.js": "528ED5892BDDE16EAA4F60BD962FCC7A70E0E4E322ED3F798AFC6D72D6C3C99B",
@ -132,13 +132,13 @@
"full-tweets-title.min.js": "5A32D349D6DDD4F1DE73175D9A0AFE520B316F73A852B2BBE6A0436C8D8CBBB2",
"gbk.min.js": "0EDFCB94F519365A8CCA9BF3AECE57DC6DB273EF3F41545095B8F03625782F0D",
"get-number.min.js": "E644267B8A2DCEF2577BB9270F5C738BCE89C1C128071EBD3645903A930E08E0",
"gui-settings.min.css": "1B1D6F4FFE7E3FEB26CB0FD5F19A3EF2F6C9AD7356F2D56660E75DE1061DE201",
"gui-settings.min.html": "ED34D4DF52333541FDF96C47091924E6016655E8DF82D75871E3B99D70F46AC5",
"gui-settings.min.js": "3AF95BAF62666E0C2FE990FB6F15A3A4B459F42F49E04FFF06848CFFEC350B12",
"gui-settings.min.css": "54ABFAE9B7A91CB8D7D2A6D3FAB844C256DFC2286710D592E85FB9A8479823F2",
"gui-settings.min.html": "93F0A4FA7D83E5E9E71F919D5C26D8413BCDCA51AED0DA4C3D821B3ABACEBB02",
"gui-settings.min.js": "7E18926B9A9F0BDFDFD8755EAF237951195DA849835A6C266F15E3A5A191EB40",
"haruna-scale.min.js": "2410662D47006D2AC49FE43DEB85F8D2C1B6F6D353DD767C2F11F7802A81F605",
"hide-bangumi-reviews.min.js": "0E8D100A27D523008041BAF95B7809855B505F4C02D4EE32CC62917528E46DBE",
"hide-bangumi-sponsors.min.js": "61CF35F5F1DDD9BA068196E4D02C8F206178D58A6DFD43DE5024A7AE50A2029D",
"hide-banner.min.css": "68D798C7FE5D4C94B6BA1FB0075EFDFA285EAF1B04D4F54A8D37B031B560994B",
"hide-banner.min.css": "FB801F7DD61622B0DFD1AD48AC6B3A5CC649D6A949E677423D957D7BC9FCE762",
"hide-banner.min.js": "1FC0511F83C87E07F2BDE94A10D7AB2F7067E77AC93261D563BB699BECFB035D",
"hide-category.min.css": "2EB4AB96C9EA12E91910AB3F1EAAFD76CFED77890CF2138232388415E1418C46",
"hide-category.min.js": "343424E56C09D06ECC9CEFEF79B8F780B7E1D9082F1878CF3D35ADD33FA294D6",
@ -148,13 +148,13 @@
"hide-related-videos.min.js": "B0FF19C6080EB7C3D64C3BFF91FDF68D70FEC4E5445717175E74245A2DEABBB9",
"hide-top-search.min.js": "36FF3FCBEC3ABB61E2458AA94C0B9F59224AE38A483B354FB17C671190592892",
"home-hidden.min.css": "BF0142F2C96EE72EBC76D5D4909A5CE5BA382C142F19E5E54248A177D9585E99",
"home-hidden.min.js": "5326DE89A99FA3913A89DF7713DACDBB41E3BD89FD46BCDA322535949373FDF3",
"home-hidden.min.js": "71B082DFC0EF6C1996FAD37699A4F4F4AF64B7AB691167F5462B2ED13F82206B",
"home-video.vue.min.js": "ACD3918903369692BF0AA0ADBE3E77B8D6B942EA1DAAB7138B362D263E9DC1F4",
"horizontal-scroll.min.js": "BCD68AB83706669D24A782219F3D45EA0AF0A9C0317309CB003924444452519C",
"i18n.de-DE.min.js": "540CD614C274A80578B8F759B437675ECFEB6C16DF62BA0E39AB113F26C9852F",
"i18n.en-US.min.js": "481D6038EC4EEEE518217B03E32850A339F9D7BC4E55EC471BA5C26B2464D6B1",
"i18n.ja-JP.min.js": "8270B398C684EE98459C3C73BC9B2BB8D28E8F2E2E9833AA788C82DA20659830",
"i18n.min.css": "FAA94965C122C7F1DE6DC82C298E50FACE1C8C37256605BD7B3FD4AB56037BCB",
"i18n.min.css": "E8D2E9E5231CE9C1AB581FC0C0341057C095B65E635B0B81DF426841AD0E8A47",
"i18n.min.js": "369DC13D72758D1DF42387931D7E0165F22CF05EBB8DC24F800EF463472A1600",
"i18n.zh-TW.min.js": "803F67270809E3258E2B302ADE542B12EF222C83EDC67FB8C68301C5F4E3A1CC",
"icon.vue.min.js": "15324A41E910361F9A245D6B3EB16019075EE460287570CBEA0F12AC71E1F158",
@ -166,8 +166,8 @@
"index.min.html": "94B83D9EBB9005C1286A7E0759A7683932F8DADA20D07E5E9D8FF867B04D4B95",
"key-binding-presets.min.js": "550BC7B2441DFE4744B54A161207EA4B5DB949AB7B3C377C66F549E710D8CE22",
"key-bindings.min.js": "88736417D177F7F6173D087441220979B76C63A510BE75E09DF4B27D4DEBFB57",
"keymap.min.css": "B66149AAE8D4267E413A26F0577C4FCE4C0D13ECBB9B573916FDA8E58099C939",
"keymap.min.js": "CE9AB2A4D39F14858C5A29942FB46CD4C65A522660C40D04E3EE45C6A5598B88",
"keymap.min.css": "331DE00E7A7A9B7727CA7F4A1411158477A8EE5EE38E596DEEE9B6ADB4C0B321",
"keymap.min.js": "7767C27DE7A8BE8B784D94A876D1CBF3CAC7D209AF8687AE211601C94522B143",
"live-control-bar.min.js": "5AA182EB22062DEB54D727E7B42F6DA8535F982DA303963BA9AD4BE19889467A",
"live-pip.min.js": "2112A21139895537DCD4DDA6EC2719B31D312E8C34BBBA690D388FB24200C5D9",
"live-socket.min.js": "8AB690D1979FB64E7BA6126417700C0DD96C0E5C43712543590753B8344996C8",
@ -187,13 +187,14 @@
"no-banner.min.css": "DA096F94E7FA26992F3F71245E704D69A1C222D0ADA6F1990FA5D948507CE15F",
"no-live-autoplay.min.js": "31917BE96EE9B8F8AC7E5FA17465AC8873ED7BB48AC3A44F4374E79C85363B70",
"no-mini-video-autoplay.min.js": "D0738ED56C685C3B02F39C0D1A0694ACE71A07397A59C6FE37CD9BC496592462",
"notify-new-version.min.js": "D922DCE08CFD1729BB778885E5EFB905FBE23A2878437AE2E9CF2263C22E196B",
"online-info-row.vue.min.js": "48D42BADAD3F52BAFE20E2810567ED404A82DA78C8B7ECEB97C0D3E76CC61138",
"notify-new-version.min.js": "08A418212A8078EE83864E3AED782D597DE8E41AA2E4DD4B7D6FBBF83696B627",
"online-info-row.vue.min.js": "A1BE0481CEE968FE2239B05B9473751B4E9931BE5EF40D677E46B3C0ED43C974",
"outer-watchlater.min.css": "BB56A80224F7B37869C17C976C301623C47BBCCDB18F7E009A4F97B6C685C0DC",
"outer-watchlater.min.js": "5FC13134BBC69E8A1061A33D4BE6ED24508A8093D569B1CF33680AF2DE1BF86E",
"override-navbar.min.css": "E5AA612841281169CA367A238FB934F807900A385CE2298B7352FF3CA4623757",
"override-navbar.min.js": "0FF50371A02F47EE384515544EB87D34CEE2DB449B9B864B5627A9645F921DAB",
"pako-inflate.min.js": "1B89766B342D4A561B0CF7D5A68B2900B6D1772E507EEB1AF56FA7CABE40BCEC",
"player-agent.min.js": "FCD128055BD5414ED97B49E44000D6EE74C1FA181582C1BD7E433BAD5F1B05C0",
"player-context-menu.min.js": "D84439ABC219CBCDF4C431DAA73E799265485F3C5C07AE57F9A251C7CF967E4A",
"player-focus.min.js": "9A290D6749E68A4A88563983413A296BFA9B5C18B978F9CF80799196AEC0F9EE",
"player-on-top.min.js": "0D9AA8561E97A6FFCEABDA206B6A57EB87C1B3EF5D0D53EDABA3ED5EFB0DF687",
@ -202,13 +203,13 @@
"quality-errors.min.js": "A691A407FC4F80C6B2D243CBFADC636FCFFC4DC35B9E305AEF4184AD3ECFC56B",
"quick-favorite.min.css": "7829AE09EC0F9057C3970CDF4CEADC76A86269C1DA714E7BC64E6D783621076B",
"quick-favorite.min.js": "0E9F058A2843A0D7F860E78E157FAA1A3DA8E63F5E12C2A35D4BFC48E62D284C",
"rank-list.vue.min.js": "EC5DDEE0798F779687676E7FDE251FB29A7A0079EACA1994DD73A802C742055F",
"rank-list.vue.min.js": "A47750316E45D61F2AA56FDDD08F1D2D715BA103B42C4000D0C348020998737F",
"record-live-danmaku.min.js": "CF1C55683CB20688FAA39B9150144F5C907D8150BF42C1AD2729FB44AB06A604",
"record-live-danmaku.vue.min.js": "CFBB560D1C9C1D3510A4217E141FEDD4A7F227F3825859BB7F729544A1B86DAC",
"remember-video-speed.min.js": "207AB95275A06977CE46AE37C5892FB7823A696C67DC40B4B13EAE82DED330C6",
"remove-guide-popup.min.js": "801E2EAA47B55CBBF8DF2570781A76C411BB3EA3A8C3A87BB0A8369FF9E6D9EB",
"remove-promotions.min.css": "DE7F28B81D660117F5C515D6F6360CD63F1CAF31AF06DE8BEF492FD3552C4B60",
"remove-promotions.min.js": "AE5C33D42077619647218BF635B7EBF371966C0245641856E18CD0F4039D225A",
"remove-promotions.min.css": "0BF20D07A075A2F6F2B59A3234B53FCBDC87D4A3640707B604B187D681100758",
"remove-promotions.min.js": "A59D69F284C865B414B63B855EE25EC6614E1205C38267BC76E3C034A1C1751D",
"remove-top-mask.min.js": "AD087C766DF146FDF8DCFF5F98950DBFAA4A43E3848FEEA0EC8D3A0A5CD276EA",
"remove-video-popup.min.js": "97E6C386E85D79BFA9FA86422F06FB7723DED0AA25F27A7F94BCFB222AF7865E",
"remove-vote-popup.min.js": "00FB123A3E41AC0EB8D35F1C37E2E6A38C87E6DFD8666488E3A37E8B6B12BABF",
@ -229,23 +230,23 @@
"settings-tooltip.loader.min.js": "477DE4B69F477D67BCBC72CE33C91986EB2A5620D6F2D1D8367BBC388C5E3E5C",
"settings-tooltip.min.css": "031B4E11744977C54496A3DB0FAB794401DC1FED2E53D9F729DA4218CD98E8D5",
"settings-tooltip.min.js": "C7F9A79EB623BF58CB81DE4A9E74FC6C2EDB2613403EFE6D09B36FB460159A13",
"settings-tooltip.zh-CN.min.js": "0B4B075F32E0ED6E5A73232D318FDFA8DD207B94EDF4ABC3EB636708583FC2DA",
"settings-tooltip.zh-CN.min.js": "21CD103B470AC97288304D4471D733E43BD89E82A2D2A6CD4CF70F4D448293D9",
"show-cover-before-play.min.css": "E4050D66F8014029270CB5A4DEFDE2F847B095BA9ED4274BFED3E131B737B06D",
"show-cover-before-play.min.js": "5614929DD8CEB3B11D184F037235D91B741AD167B08A4F5B7341C6A50A0838FF",
"show-cover-before-play.min.js": "59A0FB3D33643BAA3E11813ABF290B26F286CC4FF19EE0089A90DFE3FE768BCF",
"show-dead-video-title.min.js": "5B968442E71F947F70C57C9FDA083935200CBA9B1038131F1587E70A2B723798",
"simple-home.vue.min.js": "A1036F3AF1D4BB1BBADAC642691D18D158C47FC409BE64B9CB978E32D9E5DCAF",
"simple-home.vue.min.js": "EFF4A221F6A94B3AA6FEACF840699B691017B771E532C17963194C21C11DD488",
"simple-home-bangumi-category.vue.min.js": "5E0DBCA5694737CA6FFFEABB28B3FA29716C62355D8FBF14D86C4810BCF53E91",
"simple-home-categories.vue.min.js": "1A61EE248042E90865DDD1C23FA3981E551285EF7FC50FB8BA4944582659562E",
"simple-home-feeds.vue.min.js": "5CF5FC40DB715756234B234D955EF8D4B2C127779F8BFA3038141D7EBE68C1D3",
"simple-home-categories.vue.min.js": "D80410884A163ACAF39C71640B21F69FA0330290ECCFD53A9591FBC777D07684",
"simple-home-feeds.vue.min.js": "5217FE9FCE4C7434BED5FFCEE352935E572F6D950379D4FBF01E4F2AEB9BF8DD",
"simple-home-normal-category.vue.min.js": "354311133748055CB493D2668F8467D5E69B2607CC1F86F09EF8E7C097FAA344",
"simplify-home.min.css": "A4D6FDE358B047A88ADF6D7F16207C383439EB1A635F8AF5D8CA7E7A29A59306",
"simplify-home.min.css": "80191DE93D093D6F10A49145F39C14211120F2ED1C73F7CA40D63760EFFA3C73",
"simplify-home.min.js": "1E19F28B357C24B9B7F53ADC782DD6D4EEED6751EA879984D967C5FB4C925A9D",
"simplify-home.vue.min.js": "94BA1874DBB0D5448F3DD12EB822F1AF6AB6C053D5C17F85A54A8DEE07999BF7",
"simplify-liveroom.min.css": "81C475E785347471D10AA6C16A5D74FDAB4BAAE25CEA93247A0B6BF258973D23",
"simplify-home.vue.min.js": "2C5AA3B459FF43C040D490AC2A121B56B118722DD6CC299A0EC033657A84F838",
"simplify-liveroom.min.css": "270C1FEFD6DDDF65959752C6092761477149E74561C9D40927EADC1657CE6515",
"simplify-liveroom.min.js": "5D3D3D008C7E5D79E6E08F31D0CFB183A2F90E2749AE31BE1CA75B52D63A1A6B",
"skip-charge-list.min.css": "D3C988CE131CEBFAC8A60360529C83EC4AE1B9EA122F9A6924F19963E25A4FE9",
"skip-charge-list.min.js": "3F89374310F5F7BD66E782C629FEE09FA9E5E15076F17075E871F0E984656157",
"slideshow-cards.vue.min.js": "DCA8626ECE417FCC7792D6A1CEBE3BA3BF86D2CF0E88244239B2320D54A3DAD2",
"slideshow-cards.vue.min.js": "A787FF3B86C074173CECF4E58630D1F20AE249F7C15B07EC22F371D0FD423B7E",
"slip.min.js": "407C046F6F04D990F4EFD59AB1A26FC995D8BE277CEA9E50C4621136D46D5875",
"subtitle-converter.min.js": "DFE6DC4471D1119B486811BB3D07336EEA90E92D90A67646D5CA2CC1CB43F833",
"superchat-translate.min.css": "F4874FE716A750AE0D21DA44393F286E5AABFFA949476E2FA06CDBE2748CF095",
@ -259,14 +260,14 @@
"touch-navbar.min.js": "A97A7E536A45DE1DF3F7CC174CF95D855FA6034FB9F7D98B818A7363BADDFE48",
"touch-player.min.css": "63AB17E935430EDB022DF196F6FFC22AE9F29976A764D56E781FAD4D936CF320",
"touch-player.min.js": "FDFCB93C336C5FA9C8EE133B8F7CC697DBAD5803BBBDC3D7651802ED4E0A4FC4",
"trending-videos.min.js": "9676C06A5EB98CF9F399CEA04A17E59A31CD40DC710683EA564E82F690ABCB76",
"trending-videos.vue.min.js": "2BC48041D09F31A1CFB86EB1110CBD3894FD805882739F81C43929848E82B68B",
"trending-videos.min.js": "48C91D2D5589C2AA7EA112A21F3DEBF012ABAD8C0654396A4039684A52703745",
"trending-videos.vue.min.js": "6B72D00C8A04F1B32A5BA0950FBDBFE51BD1F0597DED29B012DB11058BBA8C52",
"tweets.min.css": "9015C1F165C91B9205ABBE4E8A3B5FA83DB1EB4B5CF2442846AF61E44FF178A8",
"unfold-feeds.min.js": "586FFB95BF24CA22E68ACE4CC4ABF25F5A2CE84C70D657D0CD62E666C4589B5B",
"url-params-clean.min.js": "AAE0C3DEE0886E0E7B0D5CB117A4103D634358F92626498C03E22F756CE137F8",
"v-checkbox.vue.min.js": "D630823220562A011DDF7164A8D12E775548C6B81907EB6525B3211B822590B1",
"v-dropdown.vue.min.js": "3D1D4DC0D8DD06C58C88A530A04DC1D5BEE6690119709B809CD3FA24C8C51C83",
"video-card.vue.min.js": "E6BD1BA3DA663BF9A2D569570CDB320A24CA2C305F587D04B3CE60136BF7924F",
"video-card.vue.min.js": "D2B6151ABD2010C05A5AFE9C9B32124C0D2A263E8386043E4F585E75FF0AD4F9",
"video-card-info.min.js": "D0738ED56C685C3B02F39C0D1A0694ACE71A07397A59C6FE37CD9BC496592462",
"video-danmaku.min.js": "225DDECB97C854DC57A857BB7AABE9C490D7EA464C81A4C67780E1684AC30CB1",
"video-dash.min.js": "B731A15492D933AF1CDFBD9EAE09D9264D2B4BCAAE3F5FD2C522ADABD6F1F44B",
@ -274,7 +275,7 @@
"video-info.min.js": "A81B4F409A75D818DF23C41A3F2D95E77BD0520DB6C03712F0FE30EAECDF4FBE",
"video-list.vue.min.js": "D4764DC983B24BB9F5089E0D4AB5CEB89275F181A5ED75364CAEB1DFC44B2726",
"video-speed-common.min.js": "1F8A81026E35390558C8D11EBCDC5455319D83B65EF16F54FD2AD4335E40CFD6",
"video-speed-controller.min.js": "6E96628C42F92F4C32766D5268EFECF455628000084D277AAEF70F5BE37F91AE",
"video-speed-controller.min.js": "07DEB5145EEF3C1899CA865E2458C94BF3B4AC9CDDBE542EDD03B0E10D0535D0",
"video-story.min.js": "DC3811422EE8696E12408E3CA6AD2E3D7068AAC1B0E3577A40C5613BAD5C6467",
"view-cover.min.js": "436B4D6408F375E822BA12CE31FF82CA7ECDF565A2D74AD26FF39DDA342C2C13",
"volume-overdrive.min.js": "10FDFBC393D785195039FD7A66E5E5D3E62BC0E7AC142DC8074CA84A226A48EE",

Binary file not shown.

2
min/comment.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>(e,t)=>{(async()=>{const{waitForControlBar:e}=await t.importAsync("live-control-bar");let n=false;let a;const l="danmaku-send-bar";e({init:()=>{t.applyStyle("danmakuSendBarStyle")},callback:async e=>{const t=dq(e,".left-area");const s=await SpinQuery.select(".chat-input-ctnr .chat-input");const r=await SpinQuery.select(".chat-input-ctnr ~ .bottom-actions .bl-button--primary");if([t,s,r].some((e=>e===null))){console.warn("[danmakuSendBar] ref elements not found",t===null,s===null,r===null);return}if(dq(e,`.${l}`)){return}if(!a){const e=Vue.extend({template:`\n<div class="${l}">\n<input\n type="text"\n placeholder="发个弹幕呗~"\n :value="value"\n @keydown.enter="send()"\n @input="updateValue($event.target.value)"\n maxlength="30"\n />\n</div>\n`,data(){return{value:s.value}},mounted(){s.addEventListener("input",this.listenChange);s.addEventListener("change",this.listenChange);if(!n){const e=Object.getOwnPropertyDescriptors(HTMLTextAreaElement.prototype).value;Object.defineProperty(s,"value",{...e,set(t){e.set.call(this,t);raiseEvent(s,"input")}});n=true}},beforeDestroy(){s.removeEventListener("input",this.listenChange);s.removeEventListener("change",this.listenChange)},methods:{updateValue(e){s.value=e;raiseEvent(s,"input")},send(){if(!r.disabled){this.value="";r.click()}},listenChange(e){this.value=e.target.value}}});a=(new e).$mount().$el}t.insertAdjacentElement("afterend",a)}})})();return{reload:()=>document.body.classList.remove("danmaku-send-bar-unloaded"),unload:()=>document.body.classList.add("danmaku-send-bar-unloaded")}})();
(()=>(e,t)=>{(async()=>{const{waitForControlBar:e}=await t.importAsync("live-control-bar");let n=false;let a;const l="danmaku-send-bar";e({init:()=>{t.applyStyle("danmakuSendBarStyle")},callback:async e=>{const t=dq(e,".left-area");const r=await SpinQuery.select(".control-panel-ctnr .chat-input-ctnr .chat-input");const s=await SpinQuery.select(".control-panel-ctnr .chat-input-ctnr ~ .bottom-actions .bl-button--primary");if([t,r,s].some((e=>e===null))){console.warn("[danmakuSendBar] ref elements not found",t===null,r===null,s===null);return}if(dq(e,`.${l}`)){return}if(!a){const e=Vue.extend({template:`\n<div class="${l}">\n<input\n type="text"\n placeholder="发个弹幕呗~"\n :value="value"\n @keydown.enter="send()"\n @input="updateValue($event.target.value)"\n maxlength="30"\n />\n</div>\n`,data(){return{value:r.value}},mounted(){r.addEventListener("input",this.listenChange);r.addEventListener("change",this.listenChange);if(!n){const e=Object.getOwnPropertyDescriptors(HTMLTextAreaElement.prototype).value;Object.defineProperty(r,"value",{...e,set(t){e.set.call(this,t);raiseEvent(r,"input")}});n=true}},beforeDestroy(){r.removeEventListener("input",this.listenChange);r.removeEventListener("change",this.listenChange)},methods:{updateValue(e){r.value=e;raiseEvent(r,"input")},send(){if(!s.disabled){this.value="";s.click()}},listenChange(e){this.value=e.target.value}}});a=(new e).$mount().$el}t.insertAdjacentElement("afterend",a)}})})();return{reload:()=>document.body.classList.remove("danmaku-send-bar-unloaded"),unload:()=>document.body.classList.add("danmaku-send-bar-unloaded")}})();

2
min/dark.min.css vendored

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>(e,i)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const t=[{name:"常规",action:()=>{}},{name:"宽屏",action:async()=>{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=>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 n=()=>{};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(".bilibili-player-video-btn-setting-right-others-content-lightoff .bui-checkbox-input");i.checked=e;raiseEvent(i,"change")};n=()=>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=dq("video");if(!i){return}const o=t.find((i=>i.name===e.defaultPlayerMode));{const t=()=>{if(o&&$("#bilibiliPlayer[class*=mode-]").length===0){o.action()}};const l=_.get(JSON.parse(localStorage.getItem("bilibili_player_settings")),"video_status.autoplay",false);if(e.applyPlayerModeOnPlay&&!l){i.addEventListener("play",t,{once:true})}else{t()}if(l){n()}i.addEventListener("ended",a);i.addEventListener("pause",a);i.addEventListener("play",n)}}Observer.videoChange(o)})();
(()=>(e,t)=>{if(typeof isEmbeddedPlayer!=="undefined"&&isEmbeddedPlayer()){return}const a=[{name:"常规",action:()=>{}},{name:"宽屏",action:async()=>{const{playerAgent:e}=await t.importAsync("player-agent");await e.widescreen()}},{name:"网页全屏",action:async()=>{const{playerAgent:e}=await t.importAsync("player-agent");await e.webFullscreen()}},{name:"全屏",action:async()=>{const{playerAgent:e}=await t.importAsync("player-agent");const a=await SpinQuery.condition((()=>document.querySelector(e.query.video.element.selector)),(e=>e!==null&&e.readyState===4&&document.readyState==="complete"&&document.hasFocus()));if(a===null){console.warn("[默认播放器模式] 未能应用全屏模式, 等待超时.");return}await e.fullscreen()}}];let n=()=>{};let i=()=>{};async function r(){const{playerAgent:a}=await t.importAsync("player-agent");if(e.autoLightOff){await SpinQuery.unsafeJquery();const e=await a.query.control.buttons.settings();if(!e){return}e.mouseover().mouseout();const t=async e=>{const t=await SpinQuery.select(".bilibili-player-video-btn-setting-right-others-content-lightoff .bui-checkbox-input");t.checked=e;raiseEvent(t,"change")};n=()=>t(true);i=()=>t(false)}}async function o(){await r();const{playerReady:o}=await t.importAsync("player-ready");const{playerAgent:s}=await t.importAsync("player-agent");await o();const c=await s.query.video.element();if(!c){return}const l=a.find((t=>t.name===e.defaultPlayerMode));const y=async()=>{const e=await s.query.bilibiliPlayer();const t=e.getAttribute("data-screen");const a=!e.className.includes("mode-")&&(t===null||t==="normal");if(l&&a){l.action()}};const u=_.get(JSON.parse(localStorage.getItem("bilibili_player_settings")),"video_status.autoplay",false);if(e.applyPlayerModeOnPlay&&!u){c.addEventListener("play",y,{once:true})}else{y()}if(u){n()}c.addEventListener("ended",i);c.addEventListener("pause",i);c.addEventListener("play",n)}Observer.videoChange(o)})();

View File

@ -1 +1 @@
(()=>(t,e)=>{const s=`<img :width=width :height=height :srcset=srcset :src=actualSrc :class="{placeholder: isPlaceholderActive}":style={filter}>`;return{export:Object.assign({template:s},{props:{size:[Object,Number],src:String,blur:Number,root:HTMLElement,rootMargin:String,threshold:Number,placeholderImage:Boolean},data(){return{srcset:null,actualSrc:null,isPlaceholderActive:false}},watch:{size(){this.sourceChange()},src(){this.sourceChange()}},methods:{sourceChange(){if(this.actualSrc===null||this.srcset===null){return}this.calcSrc()},calcSrc(){const t=!this.src||!this.size;this.isPlaceholderActive=t&&this.placeholderImage;if(t){this.srcset=null;if(this.placeholderImage){this.actualSrc=`https://s1.hdslb.com/bfs/static/blive/live-web-center/static/img/no-cover.1ebe4d5.jpg`}else{this.actualSrc=null}return}let e=this.src;if(e.startsWith("http:")){e=e.replace("http:","https:")}if(e.includes("//static.hdslb.com/images/member/noface.gif")){this.srcset=e;this.actualSrc=e;return}this.srcset=getDpiSourceSet(e,this.size);this.actualSrc=e}},mounted(){const t={root:this.root,rootMargin:this.rootMargin||"200px",threshold:this.threshold};const e=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){this.calcSrc();e.disconnect()}}))}),t);e.observe(this.$el)},computed:{width(){if(typeof this.size==="object"&&"width"in this.size){return this.size.width}return null},height(){if(typeof this.size==="object"&&"height"in this.size){return this.size.height}return null},filter(){const t=[];if(this.blur){t.push(`blur(${this.blur}px)`)}return t.join(" ")}}})}})();
(()=>(t,e)=>{const s=`<img :width=width :height=height :srcset=srcset :src=actualSrc :class="{placeholder: isPlaceholderActive}":style={filter}>`;return{export:Object.assign({template:s},{props:{size:[Object,Number],src:String,blur:Number,root:HTMLElement,rootMargin:String,threshold:Number,placeholderImage:Boolean},data(){return{srcset:null,actualSrc:EmptyImageUrl,isPlaceholderActive:false}},watch:{size(){this.sourceChange()},src(){this.sourceChange()}},methods:{sourceChange(){if(this.actualSrc===null||this.srcset===null){return}this.calcSrc()},calcSrc(){const t=!this.src||!this.size;this.isPlaceholderActive=t&&this.placeholderImage;if(t){this.srcset=null;if(this.placeholderImage){this.actualSrc=`https://s1.hdslb.com/bfs/static/blive/live-web-center/static/img/no-cover.1ebe4d5.jpg`}else{this.actualSrc=EmptyImageUrl}return}let e=this.src;if(e.startsWith("http:")){e=e.replace("http:","https:")}if(e.includes("//static.hdslb.com/images/member/noface.gif")){this.srcset=e;this.actualSrc=e;return}this.srcset=getDpiSourceSet(e,this.size);this.actualSrc=e}},mounted(){const t={root:this.root,rootMargin:this.rootMargin||"200px",threshold:this.threshold};const e=new IntersectionObserver((t=>{t.forEach((t=>{if(t.isIntersecting){this.calcSrc();e.disconnect()}}))}),t);e.observe(this.$el)},computed:{width(){if(typeof this.size==="object"&&"width"in this.size){return this.size.width}return null},height(){if(typeof this.size==="object"&&"height"in this.size){return this.size.height}return null},filter(){const t=[];if(this.blur){t.push(`blur(${this.blur}px)`)}return t.join(" ")}}})}})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
#banner_link,.custom-navbar .blur-layer,.z-top-container.has-banner>.header{display:none!important}.b-header-mask-wrp .b-header-mask-bg,div.blur-bg{opacity:0!important}.international-header .bili-banner,.international-home .bili-banner{visibility:hidden!important;height:50px!important;min-height:unset!important}
#banner_link,.bili-header__banner,.custom-navbar .blur-layer,.z-top-container.has-banner>.header{display:none!important}.b-header-mask-wrp .b-header-mask-bg,div.blur-bg{opacity:0!important}.international-header .bili-banner,.international-home .bili-banner{visibility:hidden!important;height:50px!important;min-height:unset!important}

View File

@ -1 +1 @@
(()=>(e,n)=>{const i=()=>{if(document.URL==="https://www.bilibili.com/"){return!e.simplifyHome}return document.URL.includes("https://www.bilibili.com/")};const t=[{name:"categories",displayName:"分区栏",style:`\n .bili-header-m>.bili-wrapper {\n visibility: hidden !important;\n height: 18px !important;\n }\n .primary-menu-itnl {\n visibility: hidden !important;\n height: 24px !important;\n padding: 0 !important;\n }\n`},{name:"trends",displayName:"活动/热门视频",style:`\n .first-screen #reportFirst1 { display: none !important; }\n .first-screen .space-between {\n margin-bottom: 0 !important;\n }\n .rcmd-box-wrap { display: none !important; }\n`},{name:"online",displayName:"在线列表",style:`\n .first-screen #reportFirst2 { display: none !important; }\n`},{name:"ext-box",displayName:"电竞赛事",style:`\n .first-screen #reportFirst3 { display: none !important; } `},{name:"special",displayName:"特别推荐",style:`\n #bili_report_spe_rec { display: none !important; }\n`},{name:"contact",displayName:"联系方式",style:`\n .international-footer { display: none !important; }\n`},{name:"elevator",displayName:"右侧分区导航",style:`\n .storey-box .elevator { display: none !important; }\n`}];const s=i=>{if(!e.homeHiddenItems.includes(i.name)){if(i.style){var t;(t=dq(`#home-hidden-style-${i.name}`))===null||t===void 0?void 0:t.remove()}else{document.body.classList.remove(`home-hidden-${i.name}`)}}else{if(i.style){n.applyImportantStyleFromText(i.style,`home-hidden-style-${i.name}`)}else{document.body.classList.add(`home-hidden-${i.name}`)}}};(async()=>{if(!i()){return}const e=(await SpinQuery.condition((()=>dqa(".proxy-box > div")),(e=>e.length>0||document.URL!=="https://www.bilibili.com/"))).map((e=>{var n,i,t;return{name:e.id.replace(/^bili_/,""),displayName:(n=(i=e.querySelector("header .name"))===null||i===void 0?void 0:(t=i.textContent)===null||t===void 0?void 0:t.trim())!==null&&n!==void 0?n:"未知分区"}}));t.push(...e);t.forEach(s);const o=e.map((({name:e})=>`\nbody.home-hidden-${e} .storey-box .proxy-box #bili_${e} {\n display: none !important;\n}\n`.trim())).join("\n");const d=n.import("homeHiddenStyle");n.applyImportantStyleFromText(o+d,"home-hidden-style")})();return{widget:{condition:i,content:`\n<div class="gui-settings-flat-button" style="position: relative" id="home-hidden">\n<i class="mdi mdi-24px mdi-settings"></i>\n<span>首页过滤</span>\n<div class="home-hidden-settings popup">\n<div v-for="item in items" @click="toggle(item)" :key="item.name" class="home-hidden-settings-item" :class="{ 'home-hidden': hiddenItems.includes(item.name) }">\n<i class="mdi mdi-18px mdi-eye"></i>\n<i class="mdi mdi-18px mdi-eye-off"></i>\n {{ item.displayName }}\n</div>\n</div>\n</div>\n`,success:async()=>{const n=dq("#home-hidden");new Vue({el:dq(n,".popup"),data(){return{items:t,hiddenItems:[...e.homeHiddenItems]}},watch:{hiddenItems(n){e.homeHiddenItems=[...n]}},mounted(){const e=this.$el;n.addEventListener("click",(n=>{if(n.target===e||e.contains(n.target)){return}e.classList.toggle("opened")}))},methods:{async toggle(e){const n=this.hiddenItems;const i=n.indexOf(e.name);if(i!==-1){n.splice(i,1)}else{n.push(e.name)}await this.$nextTick();s(e)}}})}}}})();
(()=>(e,n)=>{const i=()=>{if(document.URL==="https://www.bilibili.com/"){return!e.simplifyHome}return document.URL.includes("https://www.bilibili.com/")};const t=[{name:"categories",displayName:"分区栏",style:`\n .bili-header-m>.bili-wrapper {\n visibility: hidden !important;\n height: 18px !important;\n }\n .primary-menu-itnl {\n visibility: hidden !important;\n height: 24px !important;\n padding: 0 !important;\n }\n .bili-header__channel {\n height: 12px !important;\n }\n .bili-header__channel > * {\n display: none !important;\n }\n`},{name:"trends",displayName:"活动/热门视频",style:`\n .first-screen #reportFirst1 { display: none !important; }\n .first-screen .space-between {\n margin-bottom: 0 !important;\n }\n .bili-layout .bili-grid:first-child,\n .rcmd-box-wrap {\n display: none !important;\n }\n`},{name:"online",displayName:"在线列表(旧版)",style:`\n .first-screen #reportFirst2 { display: none !important; }\n`},{name:"ext-box",displayName:"赛事(旧版)",style:`\n .first-screen #reportFirst3 { display: none !important; } `},{name:"special",displayName:"特别推荐(旧版)",style:`\n #bili_report_spe_rec { display: none !important; }\n`},{name:"contact",displayName:"联系方式",style:`\n .bili-footer .b-footer-wrap,\n .international-footer {\n display: none !important;\n }\n`},{name:"elevator",displayName:"右侧分区导航(旧版)",style:`\n .storey-box .elevator { display: none !important; }\n`}];const o=i=>{if(!e.homeHiddenItems.includes(i.name)){if(i.style){var t;(t=dq(`#home-hidden-style-${i.name}`))===null||t===void 0?void 0:t.remove()}else{document.body.classList.remove(`home-hidden-${i.name}`)}}else{if(i.style){n.applyImportantStyleFromText(i.style,`home-hidden-style-${i.name}`)}else{document.body.classList.add(`home-hidden-${i.name}`)}}};(async()=>{if(!i()){return}const e=(async()=>{const e=getCookieValue("i-wanna-go-back")==="-1";const n=document.URL!=="https://www.bilibili.com/";if(!e){var i;const e=await SpinQuery.condition((()=>dqa(".proxy-box > div")),(e=>e.length>0||n));return(i=e===null||e===void 0?void 0:e.map((e=>{var n,i,t;return{name:e.id.replace(/^bili_/,""),displayName:(n=(i=e.querySelector("header .name"))===null||i===void 0?void 0:(t=i.textContent)===null||t===void 0?void 0:t.trim())!==null&&n!==void 0?n:"未知分区"}})))!==null&&i!==void 0?i:[]}else{var t;const e=["推广"];const i=await SpinQuery.condition((()=>dqa(".bili-grid .the-world")),(e=>e.length>3||n));console.log(i);const o=e=>{let n=e;while(n.parentElement){if(n.classList.contains("bili-grid")){return n}n=n.parentElement}return null};return(t=i===null||i===void 0?void 0:i.filter((n=>!e.includes(n.id))).map((e=>{const n=o(e);const i=e.id;if(n){n.dataset.area=i;return{name:i,displayName:i}}return null})).filter((e=>e!==null)))!==null&&t!==void 0?t:[]}})();const a=await e;t.push(...a);t.forEach(o);const s=a.map((({name:e})=>`\nbody.home-hidden-${e} .bili-layout .bili-grid[data-area="${e}"],\nbody.home-hidden-${e} .storey-box .proxy-box #bili_${e} {\n display: none !important;\n}\n`.trim())).join("\n");const d=n.import("homeHiddenStyle");n.applyImportantStyleFromText(s+d,"home-hidden-style")})();return{widget:{condition:i,content:`\n<div class="gui-settings-flat-button" style="position: relative" id="home-hidden">\n<i class="mdi mdi-24px mdi-settings"></i>\n<span>首页过滤</span>\n<div class="home-hidden-settings popup">\n<div v-for="item in items" @click="toggle(item)" :key="item.name" class="home-hidden-settings-item" :class="{ 'home-hidden': hiddenItems.includes(item.name) }">\n<i class="mdi mdi-18px mdi-eye"></i>\n<i class="mdi mdi-18px mdi-eye-off"></i>\n {{ item.displayName }}\n</div>\n</div>\n</div>\n`,success:async()=>{const n=dq("#home-hidden");new Vue({el:dq(n,".popup"),data(){return{items:t,hiddenItems:[...e.homeHiddenItems]}},watch:{hiddenItems(n){e.homeHiddenItems=[...n]}},mounted(){const e=this.$el;n.addEventListener("click",(n=>{if(n.target===e||e.contains(n.target)){return}e.classList.toggle("opened")}))},methods:{async toggle(e){const n=this.hiddenItems;const i=n.indexOf(e.name);if(i!==-1){n.splice(i,1)}else{n.push(e.name)}await this.$nextTick();o(e)}}})}}}})();

2
min/i18n.min.css vendored

File diff suppressed because one or more lines are too long

2
min/keymap.min.css vendored
View File

@ -1 +1 @@
.keymap-tip-container{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:8px 16px;background-color:#000a;color:#fff;pointer-events:none;opacity:0;z-index:100;display:flex;align-items:center;font-size:14pt;border-radius:4px;transition:.2s ease-out}.keymap-tip-container.show{opacity:1}.keymap-tip-container i{line-height:1;margin-right:8px;font-size:18pt}.bilibili-player .bilibili-player-area .bilibili-player-video-wrap .bilibili-player-volumeHint{background-color:#000a;color:#fff}.bilibili-player .bilibili-player-area .bilibili-player-video-wrap .bilibili-player-volumeHint-icon{line-height:1}
.keymap-tip-container{position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);padding:8px 16px;background-color:#000a;color:#fff;pointer-events:none;opacity:0;z-index:150;display:flex;align-items:center;font-size:14pt;border-radius:4px;transition:.2s ease-out}.keymap-tip-container.show{opacity:1}.keymap-tip-container i{line-height:1;margin-right:8px;font-size:18pt}.bilibili-player .bilibili-player-area .bilibili-player-video-wrap .bilibili-player-volumeHint{background-color:#000a;color:#fff}.bilibili-player .bilibili-player-area .bilibili-player-video-wrap .bilibili-player-volumeHint-icon{line-height:1}

2
min/keymap.min.js vendored

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>(e,t)=>{const n={less:-1,equal:0,greater:1,incomparable:NaN};class s{constructor(e){if(!/^[\d\.]+$/.test(e)){throw new Error("Invalid version string")}this.parts=e.split(".").map((e=>parseInt(e)));this.versionString=e}compareTo(e){for(let t=0;t<this.parts.length;++t){if(e.parts.length===t){return n.greater}if(this.parts[t]===e.parts[t]){continue}if(this.parts[t]>e.parts[t]){return n.greater}return n.less}if(this.parts.length!==e.parts.length){return n.less}return n.equal}greaterThan(e){return this.compareTo(e)===n.greater}lessThan(e){return this.compareTo(e)===n.less}equals(e){return this.compareTo(e)===n.equal}}let r;async function i(){if(typeof offlineData!=="undefined"||isIframe()){return false}if(e.lastNewVersionCheck!==undefined){const t=Number(new Date);const n=t-e.lastNewVersionCheck;if(n<e.newVersionCheckInterval){return false}}try{const t=GM.info.script.name.match(/Bilibili Evolved \((.*)\)/);const n=t?"."+t[1].replace(/ /g,"-").toLowerCase():"";const i=n===".preview";r=`https://cdn.jsdelivr.net/gh/the1812/Bilibili-Evolved@${i?"preview":"master"}/bilibili-evolved${n}.user.js`;let a;try{const e=await Ajax.monkey({url:r});a=e.match(/@version[ ]*([\d\.]+)/)[1]}catch(e){a=await Ajax.monkey({url:Resource.cdnRoot||Resource.root+"version.txt"})}const o=new s(a);const l=new s(e.currentVersion);const c=o.greaterThan(l);if(c){const e=`新版本<span>${o.versionString}</span>已发布. <a id="new-version-link" class="link" href="${r}">安装</a><a class="link" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/releases">查看</a>`;const t=Toast.info(e,"检查更新");SpinQuery.select("#new-version-link").then((e=>e.addEventListener("click",(()=>{t&&t.dismiss()}))))}return c}catch(e){return false}finally{e.lastNewVersionCheck=Number(new Date)}}const a=i();return{widget:{content:`\n<button class="gui-settings-flat-button" id="new-version-update">\n<a href="${r}" style="display:none"></a>\n<i class="icon-update"></i>\n<span>安装更新</span>\n</button>\n<button class="gui-settings-flat-button" id="new-version-info">\n<a target="blank" style="display:none" href="https://github.com/the1812/Bilibili-Evolved/releases"></a>\n<i class="icon-info"></i>\n<span>查看更新</span>\n</button>\n`,condition:()=>a,success:()=>{document.querySelector("#new-version-update").addEventListener("click",(e=>{if(e.target.nodeName.toLowerCase()!=="a"){document.querySelector("#new-version-update a").click()}}));document.querySelector("#new-version-info").addEventListener("click",(e=>{if(e.target.nodeName.toLowerCase()!=="a"){document.querySelector("#new-version-info a").click()}}))}}}})();
(()=>(e,t)=>{const n={less:-1,equal:0,greater:1,incomparable:NaN};class s{constructor(e){if(!/^[\d\.]+$/.test(e)){throw new Error("Invalid version string")}this.parts=e.split(".").map((e=>parseInt(e)));this.versionString=e}compareTo(e){for(let t=0;t<this.parts.length;++t){if(e.parts.length===t){return n.greater}if(this.parts[t]===e.parts[t]){continue}if(this.parts[t]>e.parts[t]){return n.greater}return n.less}if(this.parts.length!==e.parts.length){return n.less}return n.equal}greaterThan(e){return this.compareTo(e)===n.greater}lessThan(e){return this.compareTo(e)===n.less}equals(e){return this.compareTo(e)===n.equal}}let i;async function r(){if(typeof offlineData!=="undefined"||isIframe()){return false}if(e.lastNewVersionCheck!==undefined){const t=Number(new Date);const n=t-e.lastNewVersionCheck;if(n<e.newVersionCheckInterval){return false}}try{const t=GM.info.script.name.match(/Bilibili Evolved \((.*)\)/);const n=t?"."+t[1].replace(/ /g,"-").toLowerCase():"";const r=n===".preview";i=`https://cdn.jsdelivr.net/gh/the1812/Bilibili-Evolved@${r?"preview":"master"}/bilibili-evolved${n}.user.js`;let a;try{const e=await Ajax.monkey({url:i});a=e.match(/@version[ ]*([\d\.]+)/)[1]}catch(e){a=await Ajax.monkey({url:Resource.cdnRoot||Resource.root+"version.txt"})}const o=new s(a);if(o.parts[0]>=2&&!e.noNotifyV2){const t=`新版本<span>${o.versionString}</span>已发布, 请前往项目的<a class="link" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/releases">更新日志</a>或者<a class="link" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/discussions">讨论区</a>了解如何安装和使用. <a class="link" href="javascript:void(0)" id="no-notify-v2">不再提示</a>`;const n=Toast.info(t,"检查更新");SpinQuery.select("#no-notify-v2").then((t=>t.addEventListener("click",(()=>{e.noNotifyV2=true;n&&n.dismiss()}))));return false}const l=new s(e.currentVersion);const c=o.greaterThan(l);if(c){const e=`新版本<span>${o.versionString}</span>已发布. <a id="new-version-link" class="link" href="${i}">安装</a><a class="link" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/releases">查看</a>`;const t=Toast.info(e,"检查更新");SpinQuery.select("#new-version-link").then((e=>e.addEventListener("click",(()=>{t&&t.dismiss()}))))}return c}catch(e){return false}finally{e.lastNewVersionCheck=Number(new Date)}}const a=r();return{widget:{content:`\n<button class="gui-settings-flat-button" id="new-version-update">\n<a href="${i}" style="display:none"></a>\n<i class="icon-update"></i>\n<span>安装更新</span>\n</button>\n<button class="gui-settings-flat-button" id="new-version-info">\n<a target="blank" style="display:none" href="https://github.com/the1812/Bilibili-Evolved/releases"></a>\n<i class="icon-info"></i>\n<span>查看更新</span>\n</button>\n`,condition:()=>a,success:()=>{document.querySelector("#new-version-update").addEventListener("click",(e=>{if(e.target.nodeName.toLowerCase()!=="a"){document.querySelector("#new-version-update a").click()}}));document.querySelector("#new-version-info").addEventListener("click",(e=>{if(e.target.nodeName.toLowerCase()!=="a"){document.querySelector("#new-version-info a").click()}}))}}}})();

File diff suppressed because one or more lines are too long

1
min/player-agent.min.js vendored Normal file

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
#home_popularize .adpos,#home_popularize .l-con,#reportFirst2 .extension,#slide_ad,.ad-report,.bili-header-m .nav-menu .nav-con .nav-item .text-red,.bilibili-player-promote-wrap,.bypb-window .operate-card,.gg-floor-module,.gg-window .operate-card,.home-app-download,.home-content .ad-panel,.international-home .banner-card,.mascot,.mobile-link-l,.rank-container .cm-module,.recommend-list .rec-list>:not(.video-page-card),.v-wrap .vcd,.video-page-game-card,.video-page-special-card,body.remove-game-match-module #reportFirst3,body.remove-game-match-module .bili-wrapper>.home-match,body:not(.preserve-event-banner) .activity-m{display:none!important}.recommend-list .rec-list>:not(.video-page-card)+.video-page-card{padding-top:0!important}#home_popularize{position:relative!important}.gg-window .online,.popularize-module .online{position:absolute!important;top:50%!important;right:.5%!important;transform:translateY(-100%)!important}.gg-window .online{right:0!important;padding:0 16px!important}#reportFirst2{position:relative;margin-bottom:4px}.blocked{width:440px;height:220px;display:flex;color:#888;background-color:#8882;font-size:24pt;font-weight:700;align-items:center;justify-content:space-evenly}.blocked.new{width:100%;height:100%;background-color:#eee}body.dark .blocked.new{background-color:#333}body.compact .blocked{width:480px;height:240px}
#home_popularize .adpos,#home_popularize .l-con,#reportFirst2 .extension,#slide_ad,.ad-report,.bili-header-m .nav-menu .nav-con .nav-item .text-red,.bilibili-player-promote-wrap,.bypb-window .operate-card,.eva-banner,.eva-extension-area,.gg-floor-module,.gg-window .operate-card,.home-app-download,.home-content .ad-panel,.international-home .banner-card,.mascot,.mobile-link-l,.rank-container .cm-module,.recommend-list .rec-list>:not(.video-page-card),.v-wrap .vcd,.video-page-game-card,.video-page-special-card,body.remove-game-match-module #reportFirst3,body.remove-game-match-module .bili-wrapper>.home-match,body:not(.preserve-event-banner) .activity-m{display:none!important}.recommend-list .rec-list>:not(.video-page-card)+.video-page-card{padding-top:0!important}#home_popularize{position:relative!important}.gg-window .online,.popularize-module .online{position:absolute!important;top:50%!important;right:.5%!important;transform:translateY(-100%)!important}.gg-window .online{right:0!important;padding:0 16px!important}#reportFirst2{position:relative;margin-bottom:4px}.blocked{width:440px;height:220px;display:flex;color:#888;background-color:#8882;font-size:24pt;font-weight:700;align-items:center;justify-content:space-evenly}.blocked.new{width:100%;height:100%;background-color:#eee}body.dark .blocked.new{background-color:#333}body.compact .blocked{width:480px;height:240px}

View File

@ -1 +1 @@
(()=>(e,n)=>{if(document.URL.replace(window.location.search,"")==="https://www.bilibili.com/"){SpinQuery.any((()=>dqa(".gg-pic")),(n=>{n.forEach((n=>{const t=n.parentElement;t.style.display="none";const l=[...t.parentElement.childNodes].indexOf(t)+1;const i=t.parentElement.parentElement.querySelector(`.pic li:nth-child(${l})`);if(i){i.style.display="flex";const n=i.querySelector("a:not(.more-text)");n.insertAdjacentHTML("afterend",`\n<div class="blocked">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`);n.style.visibility="hidden";i.querySelector("a.more-text").style.display="none";i.querySelector("img").style.display="none"}}))}));SpinQuery.select(".focus-carousel.home-slide").then((n=>{if(!n){return}[...n.querySelectorAll(".gg-icon,.bypb-icon")].map((e=>e.parentElement.parentElement)).forEach((n=>{n.style.display="none";n.insertAdjacentHTML("afterend",`\n<div class="blocked new">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`)}))}))}addSettingsListener("preserveEventBanner",(e=>{document.body.classList.toggle("preserve-event-banner",e)}),true)})();
(()=>(e,n)=>{if(document.URL.replace(window.location.search,"")==="https://www.bilibili.com/"){SpinQuery.select(".eva-extension-area").then((e=>{e.parentElement.style.margin="12px"}));SpinQuery.any((()=>dqa(".gg-pic")),(n=>{n.forEach((n=>{const t=n.parentElement;t.style.display="none";const l=[...t.parentElement.childNodes].indexOf(t)+1;const i=t.parentElement.parentElement.querySelector(`.pic li:nth-child(${l})`);if(i){i.style.display="flex";const n=i.querySelector("a:not(.more-text)");n.insertAdjacentHTML("afterend",`\n<div class="blocked">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`);n.style.visibility="hidden";i.querySelector("a.more-text").style.display="none";i.querySelector("img").style.display="none"}}))}));SpinQuery.select(".focus-carousel.home-slide").then((n=>{if(!n){return}[...n.querySelectorAll(".gg-icon,.bypb-icon")].map((e=>e.parentElement.parentElement)).forEach((n=>{n.style.display="none";n.insertAdjacentHTML("afterend",`\n<div class="blocked new">${e.showBlockedAdsTip?"🚫已屏蔽广告":""}</div>\n`)}))}))}addSettingsListener("preserveEventBanner",(e=>{document.body.classList.toggle("preserve-event-banner",e)}),true)})();

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>(e,o)=>{const t={include:["//www.bilibili.com/video/","//www.bilibili.com/bangumi/"]};const n="showCoverBeforePlayStyle";let r;const i=()=>{if(t.include.every((e=>!document.URL.includes(e)))){return}o.applyStyle(n);const e=()=>document.body.style.removeProperty("--cover-url");const i=HTMLVideoElement.prototype.play;HTMLVideoElement.prototype.play=function(...o){e();return i.call(this,...o)};const l=async()=>{const e=await SpinQuery.select((()=>unsafeWindow.aid));if(!e){console.warn("[播放前显示封面] 未找到av号");return}const{cid:t}=unsafeWindow;if(t===r||!t){return}r=t;const{VideoInfo:n}=await o.importAsync("video-info");const i=new n(e);await i.fetchInfo();document.body.style.setProperty("--cover-url",`url('${i.coverUrl}')`)};Observer.videoChange(l)};i();return{reload:()=>o.applyStyle(n),unload:()=>o.removeStyle(n)}})();
(()=>(e,o)=>{const n={include:["//www.bilibili.com/video/","//www.bilibili.com/bangumi/"]};const t="showCoverBeforePlayStyle";let i;const r=()=>{if(n.include.every((e=>!document.URL.includes(e)))){return}o.applyStyle(t);const e=()=>document.body.style.removeProperty("--cover-url");const r=unsafeWindow.__ENABLE_WASM_PLAYER__||dq("bwp-video");const c=r?BwpElement.prototype:HTMLVideoElement.prototype;const l=c.play;c.play=function(...o){e();return l.call(this,...o)};const s=async()=>{const e=await SpinQuery.select((()=>unsafeWindow.aid));if(!e){console.warn("[播放前显示封面] 未找到av号");return}const{cid:n}=unsafeWindow;if(n===i||!n){return}i=n;const{VideoInfo:t}=await o.importAsync("video-info");const r=new t(e);await r.fetchInfo();document.body.style.setProperty("--cover-url",`url('${r.coverUrl}')`)};Observer.videoChange(s)};r();return{reload:()=>o.applyStyle(t),unload:()=>o.removeStyle(t)}})();

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>(e,t)=>{const a=`<div class=feeds><div class=header><div class=tabs><div class=title>动态</div><div class=tab v-for="tab in tabs":key=tab.type @click=changeTab(tab) :class="{active: currentTab === tab}"><div class=tab-name>{{tab.name}}</div></div></div><div class=grow></div><a class=online target=_blank href=https://www.bilibili.com/video/online.html>在线列表</a><div class=grow></div><div class=page><div class=prev-page @click=scroll(-1)><icon type=extended icon=left-arrow></icon></div><div class=next-page @click=scroll(1)><icon type=extended icon=right-arrow></icon></div></div><a class=more href=//t.bilibili.com/ target=_blank><icon type=home icon=activity></icon>全部动态</a></div><div class=contents ref=contents><div class=card-wrapper v-for="card in feedCards":key=card.id><video-card :data=card orientation=vertical></video-card></div><div class=empty v-if="feedCards.length === 0">没有动态哦(´・_・\`)</div></div></div>`;t.applyStyleFromText(`.simple-home.snap .feeds .contents{scroll-snap-type:x mandatory}.simple-home .feeds{justify-self:start;display:flex;flex-direction:column}.simple-home .feeds .header,.simple-home .feeds .sub-header{grid-area:unset;margin-bottom:16px;padding:0 8px}.simple-home .feeds .header .page,.simple-home .feeds .sub-header .page{margin-right:8px;display:flex;align-items:center}.simple-home .feeds .header .page>*,.simple-home .feeds .sub-header .page>*{display:flex;align-items:center;justify-content:center;padding:4px;background-color:#8882;border-radius:50%;margin-left:8px;cursor:pointer}.simple-home .feeds .header .page>:hover,.simple-home .feeds .sub-header .page>:hover{background-color:#8884}.simple-home .feeds .header .page .prev-page .be-icon,.simple-home .feeds .sub-header .page .prev-page .be-icon{transform:translateX(-1px)}.simple-home .feeds .header .page .next-page .be-icon,.simple-home .feeds .sub-header .page .next-page .be-icon{transform:translateX(1px)}.simple-home .feeds .header .tab:nth-child(2),.simple-home .feeds .sub-header .tab:nth-child(2){margin-left:32px}.simple-home .feeds .header .grow,.simple-home .feeds .sub-header .grow{flex-grow:1}.simple-home .feeds .header .online,.simple-home .feeds .sub-header .online{padding:8px 16px;height:32px;border-radius:16px;background-color:#8882;color:inherit;font-size:12px;display:flex;align-items:center;box-sizing:border-box}.simple-home .feeds .contents{display:flex;overflow:auto;--card-width:200px;--card-height:250px;--card-count:4;width:calc((var(--card-width) + 16px) * var(--card-count));padding-bottom:16px;scrollbar-width:none!important;min-height:calc(var(--card-height) + 16px)}@media screen and (max-width:900px){.simple-home .feeds .contents{--card-count:3}}@media screen and (min-width:1100px){.simple-home .feeds .contents{--card-count:3}}@media screen and (min-width:1300px){.simple-home .feeds .contents{--card-count:4}}@media screen and (min-width:1550px){.simple-home .feeds .contents{--card-count:5}}@media screen and (min-width:1850px){.simple-home .feeds .contents{--card-count:6}}.simple-home .feeds .contents::-webkit-scrollbar{width:0!important;height:0!important}.simple-home .feeds .contents .card-wrapper{padding:0 8px;scroll-snap-align:start;flex-shrink:0}.simple-home .feeds .contents .empty{display:flex;align-items:center;justify-content:center;width:100%;font-size:16px}`,"simple-home-feeds-style");const s=[{name:"视频",type:"video",url:"https://t.bilibili.com/?tab=8"},{name:"番剧",type:"bangumi",url:"https://t.bilibili.com/?tab=512"}];return{export:Object.assign({template:a},{components:{VideoCard:()=>t.importAsync("video-card.vue"),Icon:()=>t.importAsync("icon.vue")},data(){return{online:"--",tabs:s,currentTab:s[0],feedCards:[]}},watch:{currentTab(e){this.updateFeedCards(e)}},methods:{async updateFeedCards(e){const{getVideoFeeds:a}=await t.importAsync("feeds-apis");this.feedCards=await a(e.type)},changeTab(e){if(this.currentTab===e){open(e.url,"_blank")}else{this.currentTab=e}},scroll(e){const t=this.$refs.contents;const a=getComputedStyle(t);const s=parseFloat(a.getPropertyValue("--card-count"));const i=parseFloat(a.getPropertyValue("--card-width"));const d=16;const n=s*(i+d);t.scrollBy(e*n,0)}},async mounted(){this.updateFeedCards(this.currentTab);let e;addSettingsListener("simpleHomeWheelScroll",(async a=>{if(a){const a=this.$refs.contents;const{enableHorizontalScroll:s}=await t.importAsync("horizontal-scroll");e=s(a)}else{e&&e()}}),true)}})}})();
(()=>(e,t)=>{const s=`<div class=feeds><div class=header><div class=tabs><div class=title>动态</div><div class=tab v-for="tab in tabs":key=tab.type @click=changeTab(tab) :class="{active: currentTab === tab}"><div class=tab-name>{{tab.name}}</div></div></div><div class=grow></div><a class=online target=_blank href=https://www.bilibili.com/video/online.html>在线列表</a><div class=grow></div><div class=page><div class=prev-page @click=scroll(-1)><icon type=extended icon=left-arrow></icon></div><div class=next-page @click=scroll(1)><icon type=extended icon=right-arrow></icon></div></div><a class=more href=//t.bilibili.com/ target=_blank><icon type=home icon=activity></icon>全部动态</a></div><div class="contents edge-gradient"ref=contents @scroll=checkScrollPosition :class="{ 'is-bottom': isBottom }"><div class=card-wrapper v-for="card in feedCards":key=card.id><video-card :data=card orientation=vertical></video-card></div><div class=empty v-if="feedCards.length === 0">没有动态哦(´・_・\`)</div></div></div>`;t.applyStyleFromText(`.simple-home.snap .feeds .contents{scroll-snap-type:x mandatory}.simple-home .feeds{justify-self:start;display:flex;flex-direction:column}.simple-home .feeds .header,.simple-home .feeds .sub-header{grid-area:unset;margin-bottom:16px;padding:0 8px}.simple-home .feeds .header .page,.simple-home .feeds .sub-header .page{margin-right:8px;display:flex;align-items:center}.simple-home .feeds .header .page>*,.simple-home .feeds .sub-header .page>*{display:flex;align-items:center;justify-content:center;padding:4px;background-color:#8882;border-radius:50%;margin-left:8px;cursor:pointer}.simple-home .feeds .header .page>:hover,.simple-home .feeds .sub-header .page>:hover{background-color:#8884}.simple-home .feeds .header .page .prev-page .be-icon,.simple-home .feeds .sub-header .page .prev-page .be-icon{transform:translateX(-1px)}.simple-home .feeds .header .page .next-page .be-icon,.simple-home .feeds .sub-header .page .next-page .be-icon{transform:translateX(1px)}.simple-home .feeds .header .tab:nth-child(2),.simple-home .feeds .sub-header .tab:nth-child(2){margin-left:32px}.simple-home .feeds .header .grow,.simple-home .feeds .sub-header .grow{flex-grow:1}.simple-home .feeds .header .online,.simple-home .feeds .sub-header .online{padding:8px 16px;height:32px;border-radius:16px;background-color:#8882;color:inherit;font-size:12px;display:flex;align-items:center;box-sizing:border-box}.simple-home .feeds .contents{display:flex;overflow:auto;--card-width:200px;--card-height:250px;--card-count:4;width:calc((var(--card-width) + 16px) * var(--card-count));scrollbar-width:none!important;min-height:calc(var(--card-height) + 16px)}@media screen and (max-width:900px){.simple-home .feeds .contents{--card-count:3}}@media screen and (min-width:1100px){.simple-home .feeds .contents{--card-count:3}}@media screen and (min-width:1300px){.simple-home .feeds .contents{--card-count:4}}@media screen and (min-width:1550px){.simple-home .feeds .contents{--card-count:5}}@media screen and (min-width:1850px){.simple-home .feeds .contents{--card-count:6}}.simple-home .feeds .contents::-webkit-scrollbar{width:0!important;height:0!important}.simple-home .feeds .contents .card-wrapper{padding:0 8px;scroll-snap-align:start;flex-shrink:0}.simple-home .feeds .contents .empty{display:flex;align-items:center;justify-content:center;width:100%;font-size:16px}`,"simple-home-feeds-style");const i=[{name:"视频",type:"video",url:"https://t.bilibili.com/?tab=8"},{name:"番剧",type:"bangumi",url:"https://t.bilibili.com/?tab=512"}];return{export:Object.assign({template:s},{components:{VideoCard:()=>t.importAsync("video-card.vue"),Icon:()=>t.importAsync("icon.vue")},data(){return{online:"--",isBottom:false,tabs:i,currentTab:i[0],feedCards:[]}},watch:{currentTab(e){this.updateFeedCards(e)}},methods:{async updateFeedCards(e){const{getVideoFeeds:s}=await t.importAsync("feeds-apis");this.feedCards=await s(e.type)},changeTab(e){if(this.currentTab===e){open(e.url,"_blank")}else{this.currentTab=e}},scroll(e){const t=this.$refs.contents;const s=getComputedStyle(t);const i=parseFloat(s.getPropertyValue("--card-count"));const a=parseFloat(s.getPropertyValue("--card-width"));const o=16;const d=i*(a+o);t.scrollBy(e*d,0)},checkScrollPosition:_.debounce((function e(t){const s=t.target;this.isBottom=s.scrollWidth-s.scrollLeft===s.clientWidth}),200)},async mounted(){this.updateFeedCards(this.currentTab);let e;addSettingsListener("simpleHomeWheelScroll",(async s=>{if(s){const s=this.$refs.contents;const{enableHorizontalScroll:i}=await t.importAsync("horizontal-scroll");e=i(s)}else{e&&e()}}),true)}})}})();

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
#app>.bili-header-m.stardust-common>.bili-wrapper,#app>.bili-wrapper,#app>.elevator-module,.bili-header-m .head-banner .head-content .head-logo,.international-footer,.international-header .b-wrap,.international-home>:not(.international-header){position:fixed;visibility:hidden;top:100vh;left:0;height:0!important;padding:0!important;margin:0!important}
#app>.bili-header-m.stardust-common>.bili-wrapper,#app>.bili-wrapper,#app>.elevator-module,#i_cecream .bili-header__channel,#i_cecream>:not(.bili-header),.bili-header-m .head-banner .head-content .head-logo,.international-footer,.international-header .b-wrap,.international-home>:not(.international-header){position:fixed;visibility:hidden;top:100vh;left:0;height:0!important;padding:0!important;margin:0!important}

View File

@ -1 +1 @@
(()=>(e,o)=>{const m=`<div class=simplify-home><component class=simplify-home-component :is=activeComponent></component></div>`;o.applyStyleFromText(`.simplify-home{padding-top:32px;display:flex;align-items:flex-start;justify-content:center;min-height:100vh;background-color:#f4f4f4;font-size:12px}body.dark .simplify-home{background-color:#181818}.simplify-home .simplify-home-component{max-width:100%}html{scroll-behavior:smooth}`,"simplify-home-style");return{export:Object.assign({template:m},{components:{"minimal-home":()=>o.importAsync("minimal-home.vue"),"simple-home":()=>o.importAsync("simple-home.vue")},computed:{activeComponent(){return this.homeStyle==="清爽"?"simple-home":"minimal-home"}},props:{homeStyle:String}})}})();
(()=>(m,e)=>{const o=`<div class=simplify-home><component class=simplify-home-component :is=activeComponent></component></div>`;e.applyStyleFromText(`.simplify-home{padding:32px 72px 0;display:flex;align-items:flex-start;justify-content:center;min-height:100vh;--simplify-home-background:#f4f4f4;background-color:var(--simplify-home-background);font-size:12px}body.dark .simplify-home{--simplify-home-background:#181818}.simplify-home .simplify-home-component{max-width:100%}html{scroll-behavior:smooth}`,"simplify-home-style");return{export:Object.assign({template:o},{components:{"minimal-home":()=>e.importAsync("minimal-home.vue"),"simple-home":()=>e.importAsync("simple-home.vue")},computed:{activeComponent(){return this.homeStyle==="清爽"?"simple-home":"minimal-home"}},props:{homeStyle:String}})}})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1 +1 @@
(()=>(t,e)=>{const a=async()=>{const{isVideoCardBlocked:t}=await e.importAsync("feeds-apis");if(!unsafeWindow.__INITIAL_STATE__){throw new Error("unsafeWindow.__INITIAL_STATE__ not available")}if(unsafeWindow.__INITIAL_STATE__.recommendData){return unsafeWindow.__INITIAL_STATE__.recommendData.item.map((t=>({id:t.id,aid:t.id,bvid:t.bvid,description:t.desc,duration:t.duration,durationText:formatDuration(t.duration),coverUrl:t.pic.replace("http:","https:"),title:t.title,playCount:formatCount(t.stat.view),upName:t.owner.name,upFaceUrl:t.owner.face.replace("http:","https:")}))).filter((e=>!t(e)))}return unsafeWindow.__INITIAL_STATE__.recommendList.map((t=>({id:t.aid,aid:t.aid,bvid:t.bvid,timestamp:t.ctime*1e3,time:new Date(t.ctime*1e3),description:t.desc,duration:t.duration,durationText:formatDuration(t.duration),coverUrl:t.pic.replace("http:","https:"),title:t.title,coins:formatCount(t.stat.coin),danmakuCount:formatCount(t.stat.danmaku),like:formatCount(t.stat.like),playCount:formatCount(t.stat.view),upName:t.owner.name,upFaceUrl:t.owner.face.replace("http:","https:")}))).filter((e=>!t(e)))};return{export:{getTrendingVideos:a}}})();
(()=>(t,e)=>{const i=async()=>{const{isVideoCardBlocked:i}=await e.importAsync("feeds-apis");const o="https://api.bilibili.com/x/web-interface/index/top/rcmd?fresh_type=0&version=1";const a=Boolean(getUID())&&t.simpleHomePersonalized;const n=a?"getJsonWithCredentials":"getJson";const{code:r,message:s,data:d}=await Ajax[n](o);if(r!==0){throw new Error(`获取${a?"推荐":"热门"}视频失败: ${s}`)}const p=d.item;return p.map((t=>{const e={id:t.id,aid:t.id,bvid:t.bvid,coverUrl:t.pic.replace("http:","https:"),title:t.title,description:"",duration:t.duration,durationText:formatDuration(t.duration),timestamp:t.pubdate*1e3,time:new Date(t.pubdate*1e3),upName:t.owner.name,upID:t.owner.mid,upFaceUrl:t.owner.face.replace("http:","https:"),like:formatCount(t.stat.like),playCount:formatCount(t.stat.view)};return e})).filter((t=>!i(t)))};return{export:{getTrendingVideos:i}}})();

View File

@ -1 +1 @@
(()=>(e,n)=>{const t=`<div class=trendings><div class=header><div class=title>热门</div><div class=page><div class=prev-page @click=scroll(-1)><icon type=extended icon=left-arrow></icon></div><div class=next-page @click=scroll(1)><icon type=extended icon=right-arrow></icon></div></div></div><div class=contents ref=contents><div class=card-wrapper v-for="card in trendingCards":key=card.id><video-card :data=card orientation=vertical></video-card></div></div></div>`;n.applyStyleFromText(`.simple-home .trendings{display:flex;flex-direction:column}.simple-home .trendings .header{padding:0 8px}.simple-home .trendings .header .page{display:flex;align-items:center}.simple-home .trendings .header .page>*{display:flex;align-items:center;justify-content:center;padding:4px;background-color:#8882;border-radius:50%;margin-left:8px;cursor:pointer}.simple-home .trendings .header .page>:hover{background-color:#8884}.simple-home .trendings .header .page .prev-page .be-icon{transform:translateX(-1px)}.simple-home .trendings .header .page .next-page .be-icon{transform:translateX(1px)}.simple-home .trendings .contents{--card-width:200px;--card-height:250px;--card-count:3;margin-top:16px;display:flex;overflow:auto;height:calc(var(--card-height) + 16px);width:calc((var(--card-width) + 16px) * var(--card-count));scrollbar-width:none!important}@media screen and (max-width:1300px) and (min-width:900px){.simple-home .trendings .contents{--card-count:2}}@media screen and (max-width:1100px) and (min-width:900px){.simple-home .trendings .contents{--card-count:4}}@media screen and (min-width:1550px){.simple-home .trendings .contents{--card-count:4}}@media screen and (min-width:1850px){.simple-home .trendings .contents{--card-count:5}}.simple-home .trendings .contents::-webkit-scrollbar{width:0!important;height:0!important}.simple-home .trendings .contents .card-wrapper{padding:0 8px;scroll-snap-align:start;flex-shrink:0}`,"trending-videos-style");return{export:Object.assign({template:t},{components:{VideoCard:()=>n.importAsync("video-card.vue"),Icon:()=>n.importAsync("icon.vue")},data(){return{trendingCards:[]}},methods:{scroll(e){const n=this.$refs.contents;const t=getComputedStyle(n);const i=parseFloat(t.getPropertyValue("--card-count"));const r=parseFloat(t.getPropertyValue("--card-width"));const a=16;const s=i*(r+a);n.scrollBy(e*s,0)}},async created(){const{getTrendingVideos:e}=await n.importAsync("trending-videos");this.trendingCards=await e()},async mounted(){let e;addSettingsListener("simpleHomeWheelScroll",(async t=>{if(t){const t=this.$refs.contents;const{enableHorizontalScroll:i}=await n.importAsync("horizontal-scroll");e=i(t)}else{e&&e()}}),true);const t=this.$refs.contents;await SpinQuery.condition((()=>t),(()=>t.childElementCount>0));n.applyImportantStyleFromText(`\n .simple-home.snap .trendings .contents {\n scroll-snap-type: x mandatory;\n }\n`,"trending-videos-snap-fix")}})}})();
(()=>(e,t)=>{const n=`<div class=trendings><div class=header><div class=title>{{ trendingTitle }}</div><div class=page><div v-if=personalized class=refresh @click=refreshCards><icon type=mdi icon=refresh></icon></div><div class=prev-page @click=scroll(-1)><icon type=extended icon=left-arrow></icon></div><div class=next-page @click=scroll(1)><icon type=extended icon=right-arrow></icon></div></div></div><div class="contents edge-gradient"ref=contents @scroll=checkScrollPosition :class="{ 'is-bottom': isBottom }"><div class=card-wrapper v-for="card in trendingCards":key=card.id><video-card :data=card orientation=vertical></video-card></div></div></div>`;t.applyStyleFromText(`.simple-home .trendings{display:flex;flex-direction:column}.simple-home .trendings .header{padding:0 8px}.simple-home .trendings .header .page{display:flex;align-items:center}.simple-home .trendings .header .page>*{display:flex;align-items:center;justify-content:center;padding:4px;background-color:#8882;border-radius:50%;margin-left:8px;cursor:pointer}.simple-home .trendings .header .page>:hover{background-color:#8884}.simple-home .trendings .header .page .prev-page .be-icon{transform:translateX(-1px)}.simple-home .trendings .header .page .next-page .be-icon{transform:translateX(1px)}.simple-home .trendings .header .page .refresh .be-icon{transition-duration:.5s;transform:scale(.9)}.simple-home .trendings .header .page .refresh:hover .be-icon{transform:scale(.9) rotate(360deg)}.simple-home .trendings .contents{--card-width:200px;--card-height:250px;--card-count:4;margin-top:16px;display:flex;overflow:auto;height:calc(var(--card-height) + 16px);width:calc((var(--card-width) + 16px) * var(--card-count));scrollbar-width:none!important}@media screen and (max-width:1300px) and (min-width:900px){.simple-home .trendings .contents{--card-count:3}}@media screen and (max-width:1100px) and (min-width:900px){.simple-home .trendings .contents{--card-count:5}}@media screen and (min-width:1550px){.simple-home .trendings .contents{--card-count:5}}@media screen and (min-width:1850px){.simple-home .trendings .contents{--card-count:6}}.simple-home .trendings .contents::-webkit-scrollbar{width:0!important;height:0!important}.simple-home .trendings .contents .card-wrapper{padding:0 8px;scroll-snap-align:start;flex-shrink:0}`,"trending-videos-style");return{export:Object.assign({template:n},{components:{VideoCard:()=>t.importAsync("video-card.vue"),Icon:()=>t.importAsync("icon.vue")},data(){const t=getUID()&&e.simpleHomePersonalized;return{personalized:t,isBottom:false,trendingTitle:t?"推荐":"热门",trendingCards:[]}},methods:{async refreshCards(){const{getTrendingVideos:e}=await t.importAsync("trending-videos");this.trendingCards=await e()},scroll(e){const t=this.$refs.contents;const n=getComputedStyle(t);const i=parseFloat(n.getPropertyValue("--card-count"));const r=parseFloat(n.getPropertyValue("--card-width"));const s=16;const o=i*(r+s);t.scrollBy(e*o,0)},checkScrollPosition:_.debounce((function e(t){const n=t.target;this.isBottom=n.scrollWidth-n.scrollLeft===n.clientWidth}),200)},async created(){await this.refreshCards()},async mounted(){let e;addSettingsListener("simpleHomeWheelScroll",(async n=>{if(n){const n=this.$refs.contents;const{enableHorizontalScroll:i}=await t.importAsync("horizontal-scroll");e=i(n)}else{e&&e()}}),true);const n=this.$refs.contents;await SpinQuery.condition((()=>n),(()=>n.childElementCount>0));t.applyImportantStyleFromText(`\n .simple-home.snap .trendings .contents {\n scroll-snap-type: x mandatory;\n }\n`,"trending-videos-snap-fix")}})}})();

File diff suppressed because one or more lines are too long

File diff suppressed because one or more lines are too long

View File

@ -1,6 +1,6 @@
// ==UserScript==
// @name Bilibili Evolved (Preview)
// @version 1.12.16
// @version 1.12.19
// @description Bilibili Evolved 的预览版, 可以抢先体验新功能.
// @author Grant Howard, Coulomb-G
// @copyright 2021, Grant Howard (https://github.com/the1812) & Coulomb-G (https://github.com/Coulomb-G)

View File

@ -494,6 +494,7 @@ Resource.manifest = {
simplifyHome: '简化首页',
simplifyHomeStyle: '首页风格',
simpleHomeWheelScroll: '允许横向滚动',
simpleHomePersonalized: '个性化推荐',
},
dropdown: {
key: 'simplifyHomeStyle',

View File

@ -165,6 +165,11 @@ export const settings = {
doubleClickFullscreenPreventSingleClick: false,
simplifyHome: false,
simplifyHomeStyle: '清爽',
simpleHomeCategoryOrders: { ...simpleHomeCategoryDefaultOrders },
simpleHomeBangumiLayout: '时间表',
simpleHomeWheelScroll: true,
simpleHomePersonalized: true,
simpleHomeLayoutFill: true,
minimalHomeSettings: {
showSearch: true,
backgroundImage: '',
@ -193,17 +198,12 @@ export const settings = {
defaultMedalID: 0,
autoMatchMedal: false,
customStyles: [],
simpleHomeCategoryOrders: { ...simpleHomeCategoryDefaultOrders },
simpleHomeBangumiLayout: '时间表',
simpleHomeWheelScroll: true,
keymapJumpSeconds: 85,
urlParamsClean: true,
collapseLiveSideBar: true,
noDarkOnMember: true,
feedsTranslate: false,
feedsTranslateProvider: 'Bing',
feedsTranslateLanguage: '',
commentsTranslate: false,
downloadVideoQuality: 120,
defaultLiveQuality: '原画',
foregroundColorMode: '自动',
@ -225,7 +225,7 @@ export const settings = {
quickFavoriteID: 0,
bilibiliSimpleNewHomeCompatible: false,
disableFeedsDetails: true,
elegantScrollbar: true,
elegantScrollbar: !navigator.platform.toLowerCase().includes('mac'),
danmakuSendBar: false,
watchLaterRedirectNavbar: true,
watchLaterRedirectPage: true,
@ -262,9 +262,12 @@ export const settings = {
scrollOutPlayerAutoLightOn: true,
disableDanmakuHighlights: false,
disableUpDanmakuStyle: false,
noNotifyV2: false,
cache: {},
}
const fixedSettings = {
feedsTranslate: false,
commentsTranslate: false,
seedsToCoins: false,
autoSeedsToCoins: false,
lastSeedsToCoinsDate: 0,

View File

@ -173,12 +173,13 @@ export const getDpiSourceSet = (src, baseSize, forceExtension = '') => {
}).join(",")
}
export const isOffline = () => typeof offlineData !== 'undefined'
export const getUID = () => document.cookie.replace(/(?:(?:^|.*;\s*)DedeUserID\s*\=\s*([^;]*).*$)|^.*$/, '$1')
export const getCookieValue = (name) => document.cookie.replace(new RegExp(`(?:(?:^|.*;\\s*)${name}\\s*\\=\\s*([^;]*).*$)|^.*$`), '$1')
export const getUID = () => getCookieValue('DedeUserID')
export const scriptVersion = (() => {
const match = GM.info.script.name.match(/Evolved \((.*)\)/)
return match ? match[1] : 'Stable'
})()
export const getCsrf = () => document.cookie.replace(/(?:(?:^|.*;\s*)bili_jct\s*\=\s*([^;]*).*$)|^.*$/, '$1')
export const getCsrf = () => getCookieValue('bili_jct')
export const formatCount = (count) => {
if (typeof count === 'string') {
count = parseInt(count)

16
src/global.d.ts vendored
View File

@ -193,10 +193,10 @@ declare global {
}
interface Document {
pictureInPictureElement: HTMLElement | null
exitPictureInPicture: () => void
}
interface HTMLVideoElement {
requestPictureInPicture: () => void
const BwpElement: {
new(): HTMLVideoElement
prototype: HTMLVideoElement
}
class SpinQuery {
static condition<T>(query: () => T, condition: (queryResult: T) => boolean, success: (queryResult: T) => void, failed?: () => void): void
@ -422,6 +422,11 @@ declare global {
doubleClickFullscreenPreventSingleClick: boolean
simplifyHome: boolean,
simplifyHomeStyle: '清爽' | '极简',
simpleHomeCategoryOrders: SimpleHomeCategoryOrders,
simpleHomeBangumiLayout: '时间表' | '动态',
simpleHomeWheelScroll: boolean,
simpleHomePersonalized: boolean,
simpleHomeLayoutFill: boolean,
minimalHomeSettings: {
showSearch: boolean,
backgroundImage: string,
@ -451,9 +456,6 @@ declare global {
defaultMedalID: number,
autoMatchMedal: boolean,
customStyles: CustomStyle[],
simpleHomeCategoryOrders: SimpleHomeCategoryOrders,
simpleHomeBangumiLayout: '时间表' | '动态',
simpleHomeWheelScroll: boolean,
keymapJumpSeconds: number,
urlParamsClean: boolean,
collapseLiveSideBar: boolean,
@ -525,6 +527,7 @@ declare global {
scrollOutPlayerAutoLightOn: boolean,
disableDanmakuHighlights: boolean,
disableUpDanmakuStyle: boolean,
noNotifyV2: boolean,
}
const GM_info: MonkeyInfo
function GM_xmlhttpRequest(details: MonkeyXhrDetails): { abort: () => void }
@ -571,6 +574,7 @@ declare global {
const descendingSort: <T>(itemProp: (item: T) => number) => (a: T, b: T) => number
const getDpiSourceSet: (src: string, baseSize: number | string | { width?: number | string, height?: number | string }, extension?: string) => string
const isOffline: () => boolean
const getCookieValue: (name: string) => string
const getUID: () => string
const getCsrf: () => string
const formatCount: (count: number | string) => string

View File

@ -10,8 +10,8 @@
},
callback: async controlBar => {
const leftController = dq(controlBar, '.left-area') as HTMLDivElement
const originalTextArea = await SpinQuery.select('.chat-input-ctnr .chat-input') as HTMLTextAreaElement
const sendButton = await SpinQuery.select('.chat-input-ctnr ~ .bottom-actions .bl-button--primary') as HTMLButtonElement
const originalTextArea = await SpinQuery.select('.control-panel-ctnr .chat-input-ctnr .chat-input') as HTMLTextAreaElement
const sendButton = await SpinQuery.select('.control-panel-ctnr .chat-input-ctnr ~ .bottom-actions .bl-button--primary') as HTMLButtonElement
if ([leftController, originalTextArea, sendButton].some(it => it === null)) {
console.warn('[danmakuSendBar] ref elements not found', leftController === null, originalTextArea === null, sendButton === null)

View File

@ -18,6 +18,7 @@
&-kanban .live-haruna-ctnr,
&-enterPrompt .chat-item.important-prompt-item,
&-enterPrompt .chat-history-panel .brush-prompt,
&-enterPrompt .chat-item.convention-msg,
&-pk .chaos-pk,
&-topRank .chat-item.top3-notice,
&-topRank .chat-item .rank-icon {

View File

@ -173,12 +173,16 @@
background-color: #fff;
}
.comment-submit {
height: 64px !important;
padding: 4px 15px !important;
position: relative !important;
right: 0 !important;
margin-left: 10px !important;
}
// .comment-submit,
.textarea-container .baffle {
line-height: 65px !important;
}
.textarea-container .baffle,
.textarea-container .ipt-txt {
height: 65px !important;
width: calc(100% - 80px) !important;
@ -499,5 +503,5 @@ body.dark .panel-area .bb-comment {
top: -72px !important;
}
.v-wrap #comment {
z-index: 1 !important;
z-index: 21 !important;
}

View File

@ -152,7 +152,9 @@ li.nav-item[report-id="playpage_dynamic"] .i-frame,
.international-header .mini-header,
.bili-header-m .head-banner .head-content .head-logo,
#biliMainHeader .mini-header,
#biliMainHeader .base-mini-header {
#biliMainHeader .base-mini-header,
.home-header .mini-header-container,
.bili-header__bar {
display: none !important;
}
.van-popover {
@ -205,6 +207,9 @@ li.nav-item[report-id="playpage_dynamic"] .i-frame,
display: flex;
justify-content: center;
body.player-fullscreen-fix & {
z-index: 1;
}
&:not(.fill) .custom-navbar-iconfont {
color: var(--theme-color);
}

View File

@ -74,7 +74,7 @@ export default (() => {
true
)
})
SpinQuery.select('#banner_link,.international-header .bili-banner').then(banner => {
SpinQuery.select('#banner_link,.international-header .bili-banner, .bili-header__banner').then(banner => {
if (banner === null || !(banner instanceof HTMLElement)) {
return
}

View File

@ -338,6 +338,9 @@ export class SearchBox extends NavbarComponent {
}
})
keywordInput.addEventListener('keydown', e => {
if (e.isComposing) {
return
}
if (e.key === 'ArrowDown' && searchList.items.length > 0) {
e.preventDefault();
e.stopImmediatePropagation();

View File

@ -439,3 +439,276 @@
@include color("a");
}
}
#i_cecream {
@include background-color();
.mini-header {
.header-entry-avatar {
@include border-color("3");
}
.default-entry,
.right-entry-icon,
.mini-header__title > span {
@include color("e");
}
.right-entry-text {
@include color("a");
}
.header-upload-entry {
@include theme-background-color();
@include foreground-color();
.header-upload-entry__icon {
@include foreground-color();
}
&:hover {
@include theme-background-color("90");
}
}
}
.bili-header,
.home-header {
@include background-color();
&__banner {
@include background-color("3");
}
&.fixed-top .home-header__bar {
@include background-color("2");
}
&__channel {
@include background-color();
.channel-entry-more__link,
.channel-link {
@include color("e");
@include background-color("3");
@include border-color();
&:hover {
@include color("e");
@include background-color("5");
}
}
}
.channel-icons {
&__item {
@include color("e");
}
.channel-notify {
@include border-color("2");
}
}
}
.primary-btn {
@include color("e");
@include background-color("3");
@include border-color();
&:hover {
@include background-color("5");
}
}
.area-header {
.roll-btn {
@include color("e");
}
.title {
@include color("e");
&:hover {
@include theme-color();
}
}
.track-switch {
@include background-color("3");
@include color("a");
.switch-bar {
@include theme-background-color();
}
button {
&:hover {
@include background-color("5");
}
&.is-active {
@include foreground-color();
}
}
}
}
:not(.aside-head) > .area-header {
.mouse-switch > * {
@include color("a");
@include background-color("3");
&:hover {
@include color("a");
@include background-color("5");
}
&.is-active {
@include theme-background-color();
@include foreground-color();
}
}
}
.aside-head {
.mouse-switch > * {
@include color("a");
&.is-active {
@include theme-color();
&::after {
@include theme-background-color();
}
}
}
}
.aside-body {
.list-state-error,
.list-state-nothing,
.list-state-loading {
@include background-color("4");
span {
@include color("a");
}
}
}
}
.v-popover-content {
@include border-color();
@include background-color("3");
}
$media-types: (video, bangumi, cheese, live, manga, movie, ogv, article);
@each $type in $media-types {
.bili-rank-list-#{$type} {
&__list {
@include border-color();
@include background-color();
}
&__item:nth-of-type(2n + 1) {
@include background-color("3");
}
&__item:nth-of-type(2n) {
@include background-color("4");
}
.rank-#{$type}-card {
&__popover {
@include background-color();
&--icon,
&--stats,
&--subtitle,
&--author {
@include color("a");
}
&--stats {
@include border-color("4");
}
}
&__cover {
@include background-color("3");
}
&__info--pts,
&__info--schedule,
&__info--styles {
@include color("a");
}
}
}
.bili-#{$type}-card {
&__info--tit {
&:hover {
@include theme-color();
}
}
&__info--living {
@include to-theme("pink");
}
&__info--pub,
&__info--subtitle,
&__info--styles,
&__info--uname {
@include color("a");
}
&__info--owner {
@include color("a");
&:hover {
@include theme-color();
}
}
.v-img,
&__image,
&__cover,
&__image--wrap {
@include background-color("3");
}
&__skeleton {
&--light,
&--text,
&--face,
&--cover {
@include background-color("4");
}
}
&__wrap {
@include background-color();
}
}
}
.n-drawer-container .elevator {
@include background-color("2");
.elevator-head {
@include color("e");
}
.elevator-core {
&.is-active {
@include background-color("3");
}
&:hover {
@include background-color("4");
}
.name {
@include color("e");
}
.icon {
@include color("a");
}
}
}
#bili-footer {
@include background-color();
.split-line {
@include background-color("4");
}
p {
@include color("e");
}
a {
@include color("e");
&:hover {
@include theme-color();
}
}
.link-item .bt {
@include color("a");
}
.text-con {
&__line {
&--link {
@include color("a");
}
}
}
}
.footer-qrcode-popover,
.footer-wechat-popover {
.qrcode-text {
@include color("e");
}
}
.gm-skeleton {
.chat-input-ctnr {
@include border-color("3");
@include background-color("2");
.medal-section {
@include border-color("3");
}
}
}

View File

@ -24,7 +24,7 @@ export default {
data() {
return {
srcset: null,
actualSrc: null,
actualSrc: EmptyImageUrl,
isPlaceholderActive: false,
}
},
@ -51,7 +51,7 @@ export default {
if (this.placeholderImage) {
this.actualSrc = `https://s1.hdslb.com/bfs/static/blive/live-web-center/static/img/no-cover.1ebe4d5.jpg`
} else {
this.actualSrc = null
this.actualSrc = EmptyImageUrl
}
return
}

View File

@ -1,6 +1,7 @@
#banner_link,
.z-top-container.has-banner > .header,
.custom-navbar .blur-layer {
.custom-navbar .blur-layer,
.bili-header__banner {
display: none !important;
}
div.blur-bg,

View File

@ -21,6 +21,12 @@ const homeHiddenOptions: HomeHiddenOption[] = [
height: 24px !important;
padding: 0 !important;
}
.bili-header__channel {
height: 12px !important;
}
.bili-header__channel > * {
display: none !important;
}
`,
},
{
@ -29,30 +35,36 @@ const homeHiddenOptions: HomeHiddenOption[] = [
.first-screen .space-between {
margin-bottom: 0 !important;
}
.rcmd-box-wrap { display: none !important; }
.bili-layout .bili-grid:first-child,
.rcmd-box-wrap {
display: none !important;
}
`,
},
{
name: 'online', displayName: '在线列表', style: `
name: 'online', displayName: '在线列表(旧版)', style: `
.first-screen #reportFirst2 { display: none !important; }
`,
},
{
name: 'ext-box', displayName: '电竞赛事', style: `
name: 'ext-box', displayName: '赛事(旧版)', style: `
.first-screen #reportFirst3 { display: none !important; } `,
},
{
name: 'special', displayName: '特别推荐', style: `
name: 'special', displayName: '特别推荐(旧版)', style: `
#bili_report_spe_rec { display: none !important; }
`,
},
{
name: 'contact', displayName: '联系方式', style: `
.international-footer { display: none !important; }
.bili-footer .b-footer-wrap,
.international-footer {
display: none !important;
}
`,
},
{
name: 'elevator', displayName: '右侧分区导航', style: `
name: 'elevator', displayName: '右侧分区导航(旧版)', style: `
.storey-box .elevator { display: none !important; }
`,
},
@ -76,17 +88,58 @@ const syncState = (item: HomeHiddenOption) => {
if (!isHome()) {
return
}
const generatedOptions: HomeHiddenOption[] = (await SpinQuery.condition(
() => dqa('.proxy-box > div'),
elements => elements.length > 0 || document.URL !== 'https://www.bilibili.com/',
)).map(it => ({
name: it.id.replace(/^bili_/, ''),
displayName: it.querySelector('header .name')?.textContent?.trim() ?? '未知分区',
}))
const homeOptions: Promise<HomeHiddenOption[]> = (async () => {
const isNewHome = getCookieValue('i-wanna-go-back') === '-1'
const isNotHome = document.URL !== 'https://www.bilibili.com/'
if (!isNewHome) {
const list = await SpinQuery.condition(
() => dqa('.proxy-box > div'),
elements => elements.length > 0 || isNotHome,
)
return list?.map(it => ({
name: it.id.replace(/^bili_/, ''),
displayName: it.querySelector('header .name')?.textContent?.trim() ?? '未知分区',
})) ?? []
} else {
const skipIds = ['推广']
const headers = await SpinQuery.condition(
() => dqa('.bili-grid .the-world'),
elements => elements.length > 3 || isNotHome,
)
console.log(headers)
const getContainer = (header: Element) => {
let currentElement = header
while (currentElement.parentElement) {
if (currentElement.classList.contains('bili-grid')) {
return currentElement
}
currentElement = currentElement.parentElement
}
return null
}
return headers
?.filter(element => !skipIds.includes(element.id))
.map(element => {
const container = getContainer(element) as HTMLElement
const name = element.id
if (container) {
container.dataset.area = name
return {
name,
displayName: name,
}
}
return null
})
.filter((it): it is HomeHiddenOption => it !== null) ?? []
}
})()
const generatedOptions = await homeOptions
homeHiddenOptions.push(...generatedOptions)
homeHiddenOptions.forEach(syncState)
const generatedStyles = generatedOptions.map(({ name }) => {
return `
body.home-hidden-${name} .bili-layout .bili-grid[data-area="${name}"],
body.home-hidden-${name} .storey-box .proxy-box #bili_${name} {
display: none !important;
}

View File

@ -272,10 +272,7 @@ export default {
position: sticky;
top: 0;
z-index: 1;
background-color: #f4f4f4;
body.dark & {
background-color: #181818;
}
background-color: var(--simplify-home-background);
.icon {
grid-area: icon;
justify-self: center;

View File

@ -5,33 +5,48 @@ export interface Blackboard {
imageUrl: string
}
export const getBlackboards = async (): Promise<Blackboard[]> => {
if (dq('.international-home')) {
const initData = await SpinQuery.condition(() => unsafeWindow['__INITIAL_STATE__'], it => it !== undefined)
return dqa('.first-screen .home-slide .item')
.slice(0, 5)
.map((it, index) => {
const locID = it.querySelector('a')!.getAttribute('data-loc-id')!
return {
url: initData.locsData[locID][index].url,
title: (it.querySelector('.title') as HTMLElement).textContent!.trim(),
isAd: Boolean(it.querySelector('.gg-icon,.bypb-icon')),
imageUrl: it.querySelector('img')!.getAttribute('src')!.replace(/@.+$/, ''),
} as Blackboard
})
} else {
const panel = dq('.chief-recommend-module .panel') as HTMLElement
const images = panel.querySelector('.pic') as HTMLElement
const titles = panel.querySelectorAll('.title > a')
return [...images.querySelectorAll('li')].map((li, index) => {
const title = titles[index] as HTMLElement
return {
url: title.getAttribute('href'),
title: title.innerText!.trim(),
isAd: Boolean(title.querySelector('.gg-pic')),
imageUrl: li.querySelector('img')!.getAttribute('src')!.replace(/@.+$/, ''),
} as Blackboard
})
const locId = 4694
const api = `https://api.bilibili.com/x/web-show/res/locs?pf=0&ids=${locId}`
const { code, message, data } = await Ajax.getJson(api)
if (code !== 0) {
throw new Error(`获取活动卡片失败: ${message}`)
}
const list: any[] = data[locId]
return list.map(it => {
return {
url: it.url,
title: it.name,
isAd: it.is_ad_loc,
imageUrl: it.pic,
} as Blackboard
})
// if (dq('.international-home')) {
// const initData = await SpinQuery.condition(() => unsafeWindow['__INITIAL_STATE__'], it => it !== undefined)
// return dqa('.first-screen .home-slide .item')
// .slice(0, 5)
// .map((it, index) => {
// const locID = it.querySelector('a')!.getAttribute('data-loc-id')!
// return {
// url: initData.locsData[locID][index].url,
// title: (it.querySelector('.title') as HTMLElement).textContent!.trim(),
// isAd: Boolean(it.querySelector('.gg-icon,.bypb-icon')),
// imageUrl: it.querySelector('img')!.getAttribute('src')!.replace(/@.+$/, ''),
// } as Blackboard
// })
// } else {
// const panel = dq('.chief-recommend-module .panel') as HTMLElement
// const images = panel.querySelector('.pic') as HTMLElement
// const titles = panel.querySelectorAll('.title > a')
// return [...images.querySelectorAll('li')].map((li, index) => {
// const title = titles[index] as HTMLElement
// return {
// url: title.getAttribute('href'),
// title: title.innerText!.trim(),
// isAd: Boolean(title.querySelector('.gg-pic')),
// imageUrl: li.querySelector('img')!.getAttribute('src')!.replace(/@.+$/, ''),
// } as Blackboard
// })
// }
}
export default {
export: {

View File

@ -26,7 +26,7 @@
:title="b.title"
>
<dpi-img :src="b.imageUrl" :alt="b.title" :size="{width: 500, height: 250}" :root="cardsContainer"></dpi-img>
<div class="title">{{b.title}}</div>
<div class="title" :title="b.title">{{b.title}}</div>
</a>
</div>
<div class="jump-dots">
@ -99,37 +99,45 @@ $first-row-height: 250px;
.jump-dots {
position: absolute;
top: 50%;
left: 8px;
transform: translateY(-50%);
left: 50%;
bottom: 0;
transform: translateX(-50%);
grid-area: cards;
align-self: center;
justify-self: center;
display: flex;
align-items: center;
& label {
display: block;
}
& label:not(:last-child) {
margin-bottom: 6px;
padding: 8px 6px;
cursor: pointer;
}
.jump-dot {
background-color: #8884;
border: 1px solid #8888;
box-sizing: border-box;
width: 8px;
height: 20px;
width: 20px;
height: 8px;
border-radius: 8px;
cursor: pointer;
}
}
.blackboard-cards {
display: flex;
grid-area: cards;
--blackboard-width: 568.5px;
--blackboard-width: 350px;
--blackboard-height: 250px;
--image-height: 197px;
width: var(--blackboard-width);
height: var(--blackboard-height);
border-radius: 16px;
overflow: hidden;
background-color: #fff;
box-shadow: 0 4px 8px 0 #0001;
body.dark & {
background-color: #282828;
}
.blackboard-card {
flex: 0 0 auto;
width: 100%;
height: 100%;
position: relative;
@ -137,27 +145,26 @@ $first-row-height: 250px;
transition: 0.8s cubic-bezier(0.44, 0.29, 0.13, 1);
img {
width: 100%;
height: 100%;
height: var(--image-height);
object-fit: fill;
display: block;
border-radius: 12px;
transition-duration: inherit;
}
.title {
position: absolute;
bottom: 8px;
bottom: 24px;
left: 50%;
transform: translateX(-50%);
padding: 4px 16px;
color: white;
background-color: #000a;
padding: 0 16px;
font-size: 14px;
font-weight: bold;
border-radius: 14px;
max-width: var(--blackboard-width);
box-sizing: border-box;
white-space: nowrap;
opacity: 0;
}
&:hover .title {
opacity: 1;
overflow: hidden;
text-overflow: ellipsis;
}
}
}

View File

@ -161,9 +161,9 @@ export default {
--loading-from: #d4d4d4;
--loading-to: #ddd;
--slideshow-ratio: 0.6;
--rank-width: 370px;
--rank-width: 20vw;
--rank-height: calc(var(--rank-width) / 16 * 10);
--card-height: 280px;
--card-height: 22vh;
--card-width: calc(var(--card-height) * (42 / 25));
display: flex;
flex-direction: column;
@ -179,12 +179,12 @@ export default {
background-color: var(--loading-to);
}
}
@for $width from 18 through 7 {
@media screen and (max-width: #{$width * 100}px) {
--card-height: #{280 - 8 * (19 - $width)}px;
--rank-width: #{370 - 20 * (19 - $width)}px;
}
}
// @for $width from 18 through 7 {
// @media screen and (max-width: #{$width * 100}px) {
// --card-height: #{280 - 8 * (19 - $width)}px;
// --rank-width: #{370 - 20 * (19 - $width)}px;
// }
// }
&,
& *,
::after,
@ -219,6 +219,9 @@ export default {
font-weight: bold;
font-size: 11pt;
padding-bottom: 12px;
margin: 0;
height: 20px;
box-sizing: content-box;
&::before {
content: '';
display: inline-flex;

File diff suppressed because one or more lines are too long

View File

@ -113,13 +113,14 @@ export default {
position: sticky;
top: 0;
z-index: 1000;
background-color: #f4f4f4;
background-color: var(--simplify-home-background);
color: black;
margin: 0;
height: auto;
&:link {
cursor: pointer;
}
body.dark & {
background-color: #181818;
color: #eee;
}
}

View File

@ -32,7 +32,7 @@
<icon type="home" icon="activity"></icon>全部动态
</a>
</div>
<div class="contents" ref="contents">
<div class="contents edge-gradient" ref="contents" @scroll="checkScrollPosition" :class="{ 'is-bottom': isBottom }">
<div class="card-wrapper" v-for="card in feedCards" :key="card.id">
<video-card :data="card" orientation="vertical"></video-card>
</div>
@ -82,6 +82,7 @@ export default {
data() {
return {
online: '--',
isBottom: false,
tabs,
currentTab: tabs[0],
feedCards: []
@ -112,7 +113,11 @@ export default {
const gap = 16
const distance = count * (width + gap)
contents.scrollBy(orientation * distance, 0)
}
},
checkScrollPosition: _.debounce(function checkScrollPosition(e: Event) {
const element = e.target as HTMLElement
this.isBottom = element.scrollWidth - element.scrollLeft === element.clientWidth
}, 200),
},
async mounted() {
this.updateFeedCards(this.currentTab)
@ -209,7 +214,7 @@ export default {
--card-height: 250px;
--card-count: 4;
width: calc((var(--card-width) + 16px) * var(--card-count));
padding-bottom: 16px;
// padding-bottom: 16px;
scrollbar-width: none !important;
min-height: calc(var(--card-height) + 16px);
@media screen and (max-width: 900px) {

View File

@ -1,5 +1,5 @@
<template>
<div class="simple-home" :class="{ snap }">
<div class="simple-home" :class="{ snap, 'layout-fill': layoutFill }">
<blackboards></blackboards>
<trending-videos></trending-videos>
<info-row></info-row>
@ -19,12 +19,16 @@ export default {
data() {
return {
snap: false,
layoutFill: true,
}
},
mounted() {
addSettingsListener('simpleHomeWheelScroll', (value: boolean) => {
this.snap = !value
}, true)
addSettingsListener('simpleHomeLayoutFill', (value: boolean) => {
this.layoutFill = value
}, true)
},
}
</script>
@ -57,14 +61,14 @@ export default {
label:nth-child(#{$i})
.jump-dot {
background-color: var(--theme-color);
height: 40px;
width: 40px;
}
&:checked:nth-of-type(#{$i}) ~ .blackboard-cards .blackboard-card {
transform: translateY(calc(-1 * #{$i - 1} * var(--blackboard-height))) scale(0.95);
transform: translateX(calc(-1 * #{$i - 1} * var(--blackboard-width))) scale(0.9);
&:nth-of-type(#{$i}) {
transform: translateY(calc(-1 * #{$i - 1} * var(--blackboard-height)));
transform: translateX(calc(-1 * #{$i - 1} * var(--blackboard-width)));
img {
border-radius: 16px;
border-radius: 16px 16px 0 0;
}
}
}
@ -187,6 +191,47 @@ export default {
grid-area: categories;
padding-bottom: 32px;
}
&.layout-fill {
flex: 1;
.trendings,
.feeds {
justify-self: stretch;
width: 100%;
}
&.layout-fill .edge-gradient {
width: auto;
&::before,
&::after {
content: "";
position: fixed;
bottom: 0;
height: calc(var(--card-height) + 16px);
width: 10%;
pointer-events: none;
z-index: 1;
transition: .2s ease-out;
}
&::before {
background-image: linear-gradient(to left, transparent, var(--simplify-home-background));
left: 0;
opacity: 0;
}
&::after {
background-image: linear-gradient(to right, transparent, var(--simplify-home-background));
right: 0;
opacity: 1;
}
&.is-bottom {
&::before {
opacity: 1;
}
&::after {
opacity: 0;
}
}
}
}
@media screen and (max-width: 1100px) {
& {
grid-template-areas: 'blackboards' 'trendings' 'info' 'feeds' 'categories';

View File

@ -151,6 +151,7 @@ export default {
}
@mixin round-button {
background-color: #ddd;
color: inherit;
border-radius: 50%;
border: none;
display: flex;
@ -227,6 +228,9 @@ export default {
& > * {
display: flex;
align-items: center;
&:not(:last-child) {
margin-bottom: 6px;
}
}
.title {
color: inherit !important;
@ -234,6 +238,7 @@ export default {
font-weight: bold;
line-height: normal;
text-align: right;
flex-shrink: 0;
@include max-line(2);
}
.up {
@ -258,6 +263,7 @@ export default {
.description {
@include max-line(6);
flex-grow: 1;
flex-shrink: 1;
white-space: pre-wrap;
text-align: right;
opacity: 0.75;

View File

@ -1,7 +1,7 @@
<template>
<div class="trendings">
<div class="header">
<div class="title">热门</div>
<div class="title">{{ trendingTitle }}</div>
<!-- <div class="tabs">
<div
class="tab"
@ -14,6 +14,9 @@
</div>
</div>-->
<div class="page">
<div v-if="personalized" class="refresh" @click="refreshCards">
<icon type="mdi" icon="refresh"></icon>
</div>
<div class="prev-page" @click="scroll(-1)">
<icon type="extended" icon="left-arrow"></icon>
</div>
@ -22,7 +25,7 @@
</div>
</div>
</div>
<div class="contents" ref="contents">
<div class="contents edge-gradient" ref="contents" @scroll="checkScrollPosition" :class="{ 'is-bottom': isBottom }">
<div class="card-wrapper" v-for="card in trendingCards" :key="card.id">
<video-card :data="card" orientation="vertical"></video-card>
</div>
@ -33,57 +36,25 @@
<script lang="ts">
import { VideoCardInfo } from '../video-card-info'
interface Tab {
name: string
day: number
url: string
}
// const tabs: Tab[] = [
// {
// name: '',
// day: 1,
// url: 'https://www.bilibili.com/ranking/all/0/0/1'
// },
// {
// name: '',
// day: 3,
// url: 'https://www.bilibili.com/ranking'
// },
// {
// name: '',
// day: 7,
// url: 'https://www.bilibili.com/ranking/all/0/0/7'
// }
// ]
export default {
components: {
VideoCard: () => import('../video-card.vue'),
Icon: () => import('../../icon.vue'),
},
data() {
const personalized = getUID() && settings.simpleHomePersonalized
return {
// tabs,
// currentTab: tabs[0],
trendingCards: [],
personalized,
isBottom: false,
trendingTitle: personalized ? '推荐' : '热门',
trendingCards: [] as VideoCardInfo[],
}
},
// watch: {
// currentTab(tab: Tab) {
// this.updateTrendingTab(tab)
// },
// },
methods: {
// async updateTrendingTab(tab: Tab) {
// const { getTrendingVideos } = await import('../trending-videos')
// this.trendingCards = await getTrendingVideos(tab.day)
// },
// changeTab(tab: Tab) {
// if (this.currentTab === tab) {
// open(tab.url, '_blank')
// } else {
// this.currentTab = tab
// }
// },
async refreshCards() {
const { getTrendingVideos } = await import('../trending-videos')
this.trendingCards = await getTrendingVideos()
},
scroll(orientation: number) {
const contents = this.$refs.contents as HTMLElement
const style = getComputedStyle(contents)
@ -92,11 +63,14 @@ export default {
const gap = 16
const distance = count * (width + gap)
contents.scrollBy(orientation * distance, 0)
}
},
checkScrollPosition: _.debounce(function checkScrollPosition(e: Event) {
const element = e.target as HTMLElement
this.isBottom = element.scrollWidth - element.scrollLeft === element.clientWidth
}, 200),
},
async created() {
const { getTrendingVideos } = await import('../trending-videos')
this.trendingCards = await getTrendingVideos()
await this.refreshCards()
},
async mounted() {
let cancelHorizontalScroll: () => void
@ -123,74 +97,83 @@ export default {
</script>
<style lang="scss">
.simple-home .trendings {
display: flex;
flex-direction: column;
.header {
padding: 0 8px;
.page {
display: flex;
align-items: center;
> * {
.simple-home {
.trendings {
display: flex;
flex-direction: column;
.header {
padding: 0 8px;
.page {
display: flex;
align-items: center;
justify-content: center;
padding: 4px;
background-color: #8882;
border-radius: 50%;
margin-left: 8px;
cursor: pointer;
&:hover {
background-color: #8884;
> * {
display: flex;
align-items: center;
justify-content: center;
padding: 4px;
background-color: #8882;
border-radius: 50%;
margin-left: 8px;
cursor: pointer;
&:hover {
background-color: #8884;
}
}
.prev-page .be-icon {
transform: translateX(-1px);
}
.next-page .be-icon {
transform: translateX(1px);
}
.refresh .be-icon {
transition-duration: .5s;
transform: scale(0.9);
}
.refresh:hover .be-icon {
transform: scale(0.9) rotate(360deg);
}
}
.prev-page .be-icon {
transform: translateX(-1px);
}
.next-page .be-icon {
transform: translateX(1px);
}
}
}
.contents {
--card-width: 200px;
--card-height: 250px;
--card-count: 3;
margin-top: 16px;
display: flex;
overflow: auto;
height: calc(var(--card-height) + 16px);
width: calc((var(--card-width) + 16px) * var(--card-count));
scrollbar-width: none !important;
.contents {
--card-width: 200px;
--card-height: 250px;
--card-count: 4;
margin-top: 16px;
display: flex;
overflow: auto;
height: calc(var(--card-height) + 16px);
width: calc((var(--card-width) + 16px) * var(--card-count));
scrollbar-width: none !important;
@media screen and (max-width: 1300px) and (min-width: 900px) {
& {
--card-count: 2;
@media screen and (max-width: 1300px) and (min-width: 900px) {
& {
--card-count: 3;
}
}
}
@media screen and (max-width: 1100px) and (min-width: 900px) {
& {
--card-count: 4;
@media screen and (max-width: 1100px) and (min-width: 900px) {
& {
--card-count: 5;
}
}
}
@media screen and (min-width: 1550px) {
& {
--card-count: 4;
@media screen and (min-width: 1550px) {
& {
--card-count: 5;
}
}
}
@media screen and (min-width: 1850px) {
& {
--card-count: 5;
@media screen and (min-width: 1850px) {
& {
--card-count: 6;
}
}
&::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
}
.card-wrapper {
padding: 0 8px;
scroll-snap-align: start;
flex-shrink: 0;
}
}
&::-webkit-scrollbar {
width: 0 !important;
height: 0 !important;
}
.card-wrapper {
padding: 0 8px;
scroll-snap-align: start;
flex-shrink: 0;
}
}
}

View File

@ -4,7 +4,9 @@
#app > .bili-wrapper,
#app > .elevator-module,
#app > .bili-header-m.stardust-common > .bili-wrapper,
.bili-header-m .head-banner .head-content .head-logo {
.bili-header-m .head-banner .head-content .head-logo,
#i_cecream .bili-header__channel,
#i_cecream > :not(.bili-header) {
position: fixed;
visibility: hidden;
top: 100vh;

View File

@ -21,16 +21,17 @@ export default {
</script>
<style lang="scss">
.simplify-home {
padding-top: 32px;
padding: 32px 72px 0;
display: flex;
align-items: flex-start;
justify-content: center;
min-height: 100vh;
background-color: #f4f4f4;
--simplify-home-background: #f4f4f4;
background-color: var(--simplify-home-background);
font-size: 12px;
body.dark & {
background-color: #181818;
--simplify-home-background: #181818;
}
.simplify-home-component {
max-width: 100%;

View File

@ -2,86 +2,34 @@ import { VideoCardInfo } from './video-card-info'
export const getTrendingVideos = async () => {
const { isVideoCardBlocked } = await import('../../activity/feeds-apis')
// const json = await Ajax.getJsonWithCredentials(
// `https://api.bilibili.com/x/web-interface/ranking/index?day=${days}`
// )
// if (getUID() && watchlaterList === undefined) {
// const { getWatchlaterList } = await import(
// '../../video/watchlater-api'
// )
// watchlaterList = await getWatchlaterList()
// }
// if (json.code !== 0) {
// throw new Error(json.message)
// }
// return json.data.map(
// (card: any) => ({
// id: card.aid + '-' + days,
// aid: parseInt(card.aid),
// title: card.title,
// upID: card.mid,
// upName: card.author,
// coverUrl: card.pic.replace('http://', 'https://'),
// description: card.description,
// durationText: card.duration,
// playCount: formatCount(card.play),
// coins: formatCount(card.coins),
// favorites: formatCount(card.favorites),
// watchlater: true,
// // watchlater: watchlaterList ? watchlaterList.includes(parseInt(card.aid)) : null
// })
// )
if (!unsafeWindow.__INITIAL_STATE__) {
throw new Error('unsafeWindow.__INITIAL_STATE__ not available')
const api = 'https://api.bilibili.com/x/web-interface/index/top/rcmd?fresh_type=0&version=1'
const personalized = Boolean(getUID()) && settings.simpleHomePersonalized
const requestMethod: keyof typeof Ajax = personalized ? 'getJsonWithCredentials' : 'getJson'
const { code, message, data } = await Ajax[requestMethod](api)
if (code !== 0) {
throw new Error(`获取${personalized ? '推荐' : '热门'}视频失败: ${message}`)
}
if (unsafeWindow.__INITIAL_STATE__.recommendData) {
return (unsafeWindow.__INITIAL_STATE__.recommendData.item as any[]).map(
it => {
return {
id: it.id,
aid: it.id,
bvid: it.bvid,
// timestamp: it.ctime * 1000,
// time: new Date(it.ctime * 1000),
description: it.desc,
duration: it.duration,
durationText: formatDuration(it.duration),
coverUrl: it.pic.replace('http:', 'https:'),
title: it.title,
// coins: formatCount(it.stat.coin),
// danmakuCount: formatCount(it.stat.danmaku),
// favorites: formatCount(it.stat.favorite),
// like: formatCount(it.stat.like),
playCount: formatCount(it.stat.view),
upName: it.owner.name,
upFaceUrl: it.owner.face.replace('http:', 'https:'),
} as VideoCardInfo
},
).filter(it => !isVideoCardBlocked(it))
}
return (unsafeWindow.__INITIAL_STATE__.recommendList as any[]).map(
it => {
return {
id: it.aid,
aid: it.aid,
bvid: it.bvid,
timestamp: it.ctime * 1000,
time: new Date(it.ctime * 1000),
description: it.desc,
duration: it.duration,
durationText: formatDuration(it.duration),
coverUrl: it.pic.replace('http:', 'https:'),
title: it.title,
coins: formatCount(it.stat.coin),
danmakuCount: formatCount(it.stat.danmaku),
// favorites: formatCount(it.stat.favorite),
like: formatCount(it.stat.like),
playCount: formatCount(it.stat.view),
upName: it.owner.name,
upFaceUrl: it.owner.face.replace('http:', 'https:'),
} as VideoCardInfo
},
).filter(it => !isVideoCardBlocked(it))
const list: any[] = data.item
return list.map(it => {
const card: VideoCardInfo = {
id: it.id,
aid: it.id,
bvid: it.bvid,
coverUrl: it.pic.replace('http:', 'https:'),
title: it.title,
description: '',
duration: it.duration,
durationText: formatDuration(it.duration),
timestamp: it.pubdate * 1000,
time: new Date(it.pubdate * 1000),
upName: it.owner.name,
upID: it.owner.mid,
upFaceUrl: it.owner.face.replace('http:', 'https:'),
like: formatCount(it.stat.like),
playCount: formatCount(it.stat.view),
}
return card
}).filter(card => !isVideoCardBlocked(card))
}
export default {
export: {

View File

@ -39,23 +39,23 @@
<div class="name" :title="upName">{{upName}}</div>
</a>
<div class="stats">
<template v-if="like && !vertical">
<Icon type="extended" icon="like-outline"></Icon>
{{like}}
<Icon type="extended" icon="play"></Icon>
<span>{{playCount}}</span>
<template v-if="danmakuCount">
<Icon type="extended" icon="danmaku"></Icon>
<span>{{danmakuCount}}</span>
</template>
<template v-if="coins && !vertical">
<template v-if="like">
<Icon type="extended" icon="like-outline"></Icon>
<span>{{like}}</span>
</template>
<template v-if="coins">
<Icon type="home" icon="coin-outline"></Icon>
{{coins}}
<span>{{coins}}</span>
</template>
<template v-if="favorites">
<Icon type="home" icon="favorites-outline"></Icon>
{{favorites}}
</template>
<Icon type="extended" icon="play"></Icon>
{{playCount}}
<template v-if="danmakuCount">
<Icon type="extended" icon="danmaku"></Icon>
{{danmakuCount}}
<span>{{favorites}}</span>
</template>
</div>
</a>
@ -176,6 +176,9 @@ export default {
justify-self: start;
margin-bottom: 8px;
margin-right: 0;
> :nth-child(n + 5) {
display: none;
}
}
}
& > * {

View File

@ -110,6 +110,7 @@
<checkbox indent="0" key="simplifyHome" dependencies=""></checkbox>
<dropdown indent="1" key="simplifyHomeStyle" dependencies="simplifyHome"></dropdown>
<checkbox indent="1" key="simpleHomeWheelScroll" dependencies="simplifyHome"></checkbox>
<checkbox indent="1" key="simpleHomePersonalized" dependencies="simplifyHome"></checkbox>
<checkbox indent="0" key="hideBanner" dependencies=""></checkbox>
<checkbox indent="0" key="playerShadow" dependencies=""></checkbox>
<checkbox indent="0" key="narrowDanmaku" dependencies=""></checkbox>
@ -129,9 +130,9 @@
<checkbox indent="0" key="fullTweetsTitle" dependencies=""></checkbox>
<checkbox indent="0" key="fullActivityContent" dependencies=""></checkbox>
<checkbox indent="0" key="feedsFilter" dependencies=""></checkbox>
<checkbox indent="0" key="feedsTranslate" dependencies=""></checkbox>
<!-- <checkbox indent="0" key="feedsTranslate" dependencies=""></checkbox>
<dropdown indent="1" key="feedsTranslateProvider" dependencies="feedsTranslate"></dropdown>
<checkbox indent="1" key="commentsTranslate" dependencies="feedsTranslate"></checkbox>
<checkbox indent="1" key="commentsTranslate" dependencies="feedsTranslate"></checkbox> -->
<checkbox indent="0" key="fixedSidebars" dependencies=""></checkbox>
<checkbox indent="0" key="extendFeedsLive" dependencies=""></checkbox>
<checkbox indent="0" key="disableFeedsDetails" dependencies=""></checkbox>

View File

@ -138,7 +138,16 @@ function checkOfflineData () {
}
const preCheckCompatibility = () => {
// empty
SpinQuery.select('meta[name=spm_prefix]').then(spm => {
if (spm) {
spm.remove()
SpinQuery.select(() => unsafeWindow.__spm_prefix).then(() => {
if (unsafeWindow.__spm_prefix) {
delete unsafeWindow.__spm_prefix
}
})
}
})
}
function checkCompatibility () {
if (window.devicePixelRatio === 1) {

View File

@ -17,6 +17,9 @@
transform: rotate(360deg);
font-size: 12px;
}
body.player-fullscreen-fix & {
z-index: 1;
}
}
.gui-settings,
.gui-settings-widgets {

View File

@ -209,6 +209,7 @@ export const toolTips = new Map<keyof BilibiliEvolvedSettings, string>([
[`unfoldFeeds`, /*html*/`自动展开被折叠的动态.`],
[`commentsTranslate`, /*html*/`为评论也添加翻译按钮.`],
[`simpleHomeWheelScroll`, /*html*/`在横向的卡片列表中, 允许鼠标滚轮上下滚动时变成对此列表的横向滚动. (因为是模拟的, 可能会有点卡顿)`],
[`simpleHomePersonalized`, /*html*/`是否允许展示个性化推荐视频, 关闭后则展示热门视频.`],
[`downloadPackageEmitMode`, /*html*/`选择多个文件下载时的行为, 打包会先打成一个 zip 再下载, 分别下载会对每一个文件触发下载.`],
[`columnImageExporter`, /*html*/`在专栏页面中可在附加功能中导出所有图片.`],
[`feedsImageExporter`, /*html*/`在动态的右上角菜单中可选择导出图片来下载当前动态里的所有图片.`],

View File

@ -40,6 +40,10 @@
white-space: nowrap !important;
}
}
.header-login-entry span {
white-space: nowrap !important;
font-size: smaller;
}
.live-sidebar-ctnr .sidebar-btn,
.up-info .up-focus-btn,
.attention-btn-ctnr .left-part,

View File

@ -69,6 +69,15 @@ async function checkNewVersion () {
latestVersionText = await Ajax.monkey({ url: Resource.cdnRoot || Resource.root + 'version.txt' })
}
const latestVersion = new Version(latestVersionText)
if (latestVersion.parts[0] >= 2 && !settings.noNotifyV2) {
const message = /* html */`新版本<span>${latestVersion.versionString}</span>已发布, 请前往项目的<a class="link" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/releases">更新日志</a>或者<a class="link" target="_blank" href="https://github.com/the1812/Bilibili-Evolved/discussions">讨论区</a>了解如何安装和使用. <a class="link" href="javascript:void(0)" id="no-notify-v2">不再提示</a>`
const toast = Toast.info(message, '检查更新')
SpinQuery.select('#no-notify-v2').then(span => span.addEventListener('click', () => {
settings.noNotifyV2 = true
toast && toast.dismiss()
}))
return false
}
const currentVersion = new Version(settings.currentVersion)
const hasNewVersion = latestVersion.greaterThan(currentVersion)
if (hasNewVersion) {

View File

@ -2,6 +2,9 @@ if (document.URL.replace(window.location.search, '') === 'https://www.bilibili.c
// addSettingsListener('removeGameMatchModule', value => {
// document.body.classList.toggle('remove-game-match-module', value)
// }, true)
SpinQuery.select('.eva-extension-area').then(it => {
it.parentElement.style.margin = '12px'
})
SpinQuery.any(
() => dqa('.gg-pic'),
it => {

View File

@ -20,7 +20,10 @@ body:not(.preserve-event-banner) .activity-m,
body.remove-game-match-module .bili-wrapper > .home-match,
body.remove-game-match-module #reportFirst3,
.home-content .ad-panel,
.recommend-list .rec-list > :not(.video-page-card) {
.recommend-list .rec-list > :not(.video-page-card),
.eva-extension-area,
.eva-banner
{
display: none !important;
}
.recommend-list .rec-list > :not(.video-page-card) + .video-page-card {

View File

@ -9,21 +9,23 @@ const playerModes = [
{
name: '宽屏',
action: async () => {
document.querySelector('.bilibili-player-video-btn-widescreen').click()
// document.querySelector("#bilibili-player").scrollIntoView({ behavior: "smooth" });
const { playerAgent } = await import('./player-agent')
await playerAgent.widescreen()
}
},
{
name: '网页全屏',
action: () => {
document.querySelector('.bilibili-player-video-web-fullscreen').click()
action: async () => {
const { playerAgent } = await import('./player-agent')
await playerAgent.webFullscreen()
}
},
{
name: '全屏',
action: async () => {
const { playerAgent } = await import('./player-agent')
const video = await SpinQuery.condition(
() => document.querySelector('.bilibili-player-video video'),
() => document.querySelector(playerAgent.query.video.element.selector),
it => {
return it !== null && it.readyState === 4 &&
document.readyState === 'complete' && document.hasFocus()
@ -32,16 +34,17 @@ const playerModes = [
console.warn('[默认播放器模式] 未能应用全屏模式, 等待超时.')
return
}
document.querySelector('.bilibili-player-video-btn-fullscreen').click()
await playerAgent.fullscreen()
}
}
]
let lightOff = () => { }
let lightOn = () => { }
async function initLights () {
const { playerAgent } = await import('./player-agent')
if (settings.autoLightOff) {
await SpinQuery.unsafeJquery()
const settingsButton = await SpinQuery.any(() => unsafeWindow.$('.bilibili-player-video-btn-setting'))
const settingsButton = await playerAgent.query.control.buttons.settings()
if (!settingsButton) {
return
}
@ -59,58 +62,40 @@ async function initLights () {
}
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 { playerReady } = await import('./player-ready')
const { playerAgent } = await import('./player-agent')
await playerReady()
const video = dq('video')
const video = await playerAgent.query.video.element()
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()
}
const onplay = async () => {
const container = await (playerAgent.query.bilibiliPlayer())
const attribute = container.getAttribute('data-screen')
const isNormalMode = !container.className.includes('mode-') && (attribute === null || attribute === 'normal')
if (info && isNormalMode) {
info.action()
}
const autoPlay = _.get(JSON.parse(localStorage.getItem('bilibili_player_settings')), 'video_status.autoplay', false)
if (settings.applyPlayerModeOnPlay && !autoPlay) {
video.addEventListener('play', onplay, { once: true })
} else {
onplay()
}
// if (!autoPlay) {
// video.addEventListener('play', lightOff, { once: true })
// } else {
// lightOff()
// }
if (autoPlay) {
lightOff()
}
video.addEventListener('ended', lightOn)
video.addEventListener('pause', lightOn)
video.addEventListener('play', lightOff)
}
const autoPlay = _.get(JSON.parse(localStorage.getItem('bilibili_player_settings')), 'video_status.autoplay', false)
if (settings.applyPlayerModeOnPlay && !autoPlay) {
video.addEventListener('play', onplay, { once: true })
} else {
onplay()
}
// if (!autoPlay) {
// video.addEventListener('play', lightOff, { once: true })
// } else {
// lightOff()
// }
if (autoPlay) {
lightOff()
}
video.addEventListener('ended', lightOn)
video.addEventListener('pause', lightOn)
video.addEventListener('play', lightOff)
}
Observer.videoChange(main)

View File

@ -9,7 +9,7 @@
color: white;
pointer-events: none;
opacity: 0;
z-index: 100;
z-index: 150;
display: flex;
align-items: center;
font-size: 14pt;

View File

@ -10,37 +10,43 @@ const supportedUrls = [
'https://www.bilibili.com/festival/2021bnj',
]
let config: { enable: boolean, bindings: KeyBinding[] } | undefined = undefined
if (supportedUrls.some(url => document.URL.startsWith(url))) {
const clickElement = (target: string | HTMLElement) => {
return ({ event }: KeyBindingActionContext) => {
let config: { enable: boolean, bindings: KeyBinding[] } | undefined = undefined;
(async () => {
if (!supportedUrls.some(url => document.URL.startsWith(url))) {
return
}
const { playerAgent } = await import('../player-agent')
const clickElement = (target: string | HTMLElement | Promise<HTMLElement | null>) => {
return async ({ event }: KeyBindingActionContext) => {
const mouseEvent = new MouseEvent('click', {
..._.pick(event, 'ctrlKey', 'shiftKey', 'altKey', 'metaKey')
})
if (typeof target === 'string') {
(dq(target) as HTMLElement)?.dispatchEvent(mouseEvent)
} else {
target.dispatchEvent(mouseEvent)
const element = await target
element?.dispatchEvent(mouseEvent)
}
}
}
const changeVideoTime = (delta: number) => {
return () => {
const video = dq('.bilibili-player-video video') as HTMLVideoElement
console.log(`[keymap] requested video time change, delta = ${delta}`)
if (!video) {
console.log('[keymap] video element not found')
return
}
if (!unsafeWindow.player) {
// fallback
console.log('[keymap] fallback')
video.currentTime += delta
return
}
console.log('[keymap] player API seek')
unsafeWindow.player.seek(video.currentTime + delta, video.paused)
}
return async () => playerAgent.changeTime(delta)
// return async () => {
// const video = await playerAgent.query.video.element() as HTMLVideoElement
// console.log(`[keymap] requested video time change, delta = ${delta}`)
// if (!video) {
// console.log('[keymap] video element not found')
// return
// }
// if (!unsafeWindow.player) {
// // fallback
// console.log('[keymap] fallback')
// video.currentTime += delta
// return
// }
// console.log('[keymap] player API seek')
// unsafeWindow.player.seek(video.currentTime + delta, video.paused)
// }
}
/** 提示框用的`setTimeout`句柄 */
let tipTimeoutHandle: number
@ -49,10 +55,10 @@ if (supportedUrls.some(url => document.URL.startsWith(url))) {
* @param text ( HTML)
* @param icon MDI class
*/
const showTip = (text: string, icon: string) => {
const showTip = async (text: string, icon: string) => {
let tip = dq('.keymap-tip') as HTMLDivElement
if (!tip) {
const player = dq('.bilibili-player-video-wrap')
const player = await playerAgent.query.playerArea() as HTMLElement
if (!player) {
return
}
@ -86,37 +92,34 @@ if (supportedUrls.some(url => document.URL.startsWith(url))) {
}
}
const actions = {
fullscreen: clickElement('.bilibili-player-video-btn-fullscreen'),
webFullscreen: clickElement('.bilibili-player-video-web-fullscreen'),
wideScreen: clickElement('.bilibili-player-video-btn-widescreen'),
volumeUp: () => {
const current = unsafeWindow.player.volume()
unsafeWindow.player.volume(current + 0.1)
showTip(`${Math.round(unsafeWindow.player.volume() * 100)}%`, 'mdi-volume-high')
fullscreen: () => playerAgent.fullscreen(),
webFullscreen: () => playerAgent.webFullscreen(),
wideScreen: () => playerAgent.widescreen(),
volumeUp: async () => {
const volume = await playerAgent.changeVolume(10)
showTip(`${volume}%`, 'mdi-volume-high')
},
volumeDown: () => {
const current = unsafeWindow.player.volume()
unsafeWindow.player.volume(current - 0.1)
const after = Math.round(unsafeWindow.player.volume() * 100)
if (after === 0) {
volumeDown: async () => {
const volume = await playerAgent.changeVolume(-10)
if (volume === 0) {
showTip('静音', 'mdi-volume-off')
} else {
showTip(`${after}%`, 'mdi-volume-high')
showTip(`${volume}%`, 'mdi-volume-high')
}
},
mute: (context: KeyBindingActionContext) => {
clickElement('.bilibili-player-video-btn-volume .bilibili-player-iconfont-volume')(context)
const isMute = unsafeWindow.player.isMute()
mute: async () => {
await playerAgent.toggleMute()
const isMute = await playerAgent.isMute()
if (isMute) {
showTip('已静音', 'mdi-volume-off')
} else {
showTip('已取消静音', 'mdi-volume-high')
}
},
pictureInPicture: clickElement('.bilibili-player-video-btn-pip'),
pictureInPicture: () => playerAgent.togglePip(),
coin: clickElement('.video-toolbar .coin,.tool-bar .coin-info, .video-toolbar-module .coin-box, .play-options-ul > li:nth-child(2)'),
favorite: clickElement('.video-toolbar .collect, .video-toolbar-module .fav-box, .play-options-ul > li:nth-child(3)'),
pause: clickElement('.bilibili-player-video-btn-start'),
pause: () => playerAgent.togglePlay(),
like: (() => {
/** 长按`L`三连使用的记忆变量 */
let likeClick = true
@ -140,26 +143,21 @@ if (supportedUrls.some(url => document.URL.startsWith(url))) {
}) as KeyBindingAction
})(),
danmaku: () => {
const checkbox = dq('.bilibili-player-video-danmaku-switch input') as HTMLInputElement
if (!checkbox) {
return
}
checkbox.checked = !checkbox.checked
raiseEvent(checkbox, 'change')
playerAgent.toggleDanmaku()
},
longJumpBackward: changeVideoTime(-settings.keymapJumpSeconds),
longJumpForward: changeVideoTime(settings.keymapJumpSeconds),
jumpBackward: changeVideoTime(-5),
jumpForward: changeVideoTime(5),
playerMenu: () => {
playerMenu: async () => {
// menu size: 386.6 x 311 (2020-03-29)
// menu size: 176.65 x 194 (2020-06-09)
const player = dq('.bilibili-player-video-wrap') as HTMLElement
if (!player) {
const container = await playerAgent.query.video.container() as HTMLElement
if (!container) {
return
}
const rect = player.getBoundingClientRect()
player.dispatchEvent(new MouseEvent('contextmenu', {
const rect = container.getBoundingClientRect()
container.dispatchEvent(new MouseEvent('contextmenu', {
bubbles: true,
cancelable: false,
view: unsafeWindow,
@ -186,19 +184,7 @@ if (supportedUrls.some(url => document.URL.startsWith(url))) {
takeScreenshot: clickElement('.video-take-screenshot'),
previousFrame: clickElement('.prev-frame'),
nextFrame: clickElement('.next-frame'),
seekBegin: () => {
if (!unsafeWindow.player) {
return
}
unsafeWindow.player.play()
setTimeout(() => {
unsafeWindow.player.seek(0)
const toastText = dq(".bilibili-player-video-toast-bottom .bilibili-player-video-toast-item:first-child .bilibili-player-video-toast-item-text span:nth-child(2)")
if (toastText) {
toastText.textContent = " 00:00"
}
})
},
seekBegin: () => playerAgent.seek(0),
}
const defaultBindings: { [action in keyof typeof actions]: string } = {
fullscreen: 'f',
@ -234,29 +220,26 @@ if (supportedUrls.some(url => document.URL.startsWith(url))) {
const keys = keyString.split(' ').filter(it => it !== '')
return {
keys,
action: (actions as any)[actionName] || (() => {}),
action: (actions as any)[actionName] || (() => { }),
} as KeyBinding
})
}
;(async () => {
const { loadKeyBindings } = await import('./key-bindings')
const { presets } = await import('./key-binding-presets')
addSettingsListener('keymapPreset', () => {
const preset = presets[settings.keymapPreset] || {}
const bindings = parseBindings(
{ ...defaultBindings, ...preset, ...settings.customKeyBindings }
)
if (config) {
console.log('load preset', settings.keymapPreset)
config.bindings = bindings
} else {
config = loadKeyBindings(bindings)
}
}, true)
resources.applyImportantStyle('keymapStyle')
})()
}
const { loadKeyBindings } = await import('./key-bindings')
const { presets } = await import('./key-binding-presets')
addSettingsListener('keymapPreset', () => {
const preset = presets[settings.keymapPreset] || {}
const bindings = parseBindings(
{ ...defaultBindings, ...preset, ...settings.customKeyBindings }
)
if (config) {
console.log('load preset', settings.keymapPreset)
config.bindings = bindings
} else {
config = loadKeyBindings(bindings)
}
}, true)
resources.applyImportantStyle('keymapStyle')
})()
export default {
reload: () => config && (config.enable = true),

295
src/video/player-agent.ts Normal file
View File

@ -0,0 +1,295 @@
/** 元素查询函数, 调用时执行 `SpinQuery.select` 查询, 可访问 `selector` 获取选择器 */
type ElementQuery<Target = HTMLElement> = {
(): Promise<Target | null>
selector: string
}
interface CustomNestedQuery<QueryResult> {
[key: string]: QueryResult | CustomNestedQuery<QueryResult>
}
interface CustomQuery<QueryResult> extends CustomNestedQuery<QueryResult> {
[key: string]: QueryResult
}
type AgentType = 'video' | 'bwp' | 'bangumi'
type CustomQueryProvider<TargetType> = {
[key in AgentType]?: TargetType
} & { video: TargetType }
interface PlayerQuery<QueryResult> extends CustomNestedQuery<QueryResult> {
playerWrap: QueryResult
bilibiliPlayer: QueryResult
playerArea: QueryResult
video: {
element: QueryResult
wrap: QueryResult
top: QueryResult
state: QueryResult
panel: QueryResult
popup: QueryResult
subtitle: QueryResult
basDanmaku: QueryResult
advDanmaku: QueryResult
danmaku: QueryResult
container: QueryResult
}
control: {
element: QueryResult
wrap: QueryResult
mask: QueryResult
top: QueryResult
progress: QueryResult
bottom: QueryResult
bottomLeft: QueryResult
bottomCenter: QueryResult
bottomRight: QueryResult
buttons: {
start: QueryResult
next: QueryResult
time: QueryResult
quality: QueryResult
pageList: QueryResult
speed: QueryResult
subtitle: QueryResult
volume: QueryResult
settings: QueryResult
pip: QueryResult
widescreen: QueryResult
webFullscreen: QueryResult
fullscreen: QueryResult
}
}
toastWrap: QueryResult
danmakuTipLayer: QueryResult
danmakuSwitch: QueryResult
}
const select = (selector: string): ElementQuery => {
const func = () => SpinQuery.select(selector)
func.selector = selector
return func
}
const selectorWrap = (query: CustomNestedQuery<string>): CustomNestedQuery<ElementQuery> => {
const map = (value: string | Record<string, any>): ElementQuery | Record<string, any> => {
if (typeof value !== 'string') {
return _.mapValues(value, map)
}
return select(value)
}
return _.mapValues(query, map) as CustomNestedQuery<ElementQuery>
}
export abstract class PlayerAgent {
abstract type: AgentType
abstract query: PlayerQuery<ElementQuery>
protected async click(target: () => Promise<HTMLElement | null>) {
const button = await target()
button?.click()
}
provideCustomQuery<CustomQueryType extends CustomQuery<string>>(config: CustomQueryProvider<CustomQueryType>) {
const custom = selectorWrap(config[this.type] ?? config.video) as CustomQuery<ElementQuery>
return { ...this, custom } as (this & { custom: { [key in keyof CustomQueryType]: ElementQuery } })
}
async widescreen() {
await this.click(this.query.control.buttons.widescreen)
}
async webFullscreen() {
await this.click(this.query.control.buttons.webFullscreen)
}
async fullscreen() {
await this.click(this.query.control.buttons.fullscreen)
}
async togglePlay() {
await this.click(this.query.control.buttons.start)
}
async togglePip() {
await this.click(this.query.control.buttons.pip)
}
async toggleMute() {
await this.click(this.query.control.buttons.volume)
}
async toggleDanmaku() {
const checkbox = await this.query.danmakuSwitch() as HTMLInputElement
if (!checkbox) {
return
}
checkbox.checked = !checkbox.checked
raiseEvent(checkbox, 'change')
}
abstract isMute(): Promise<boolean>
/** 更改音量 (%) */
abstract changeVolume(change: number): Promise<number>
/** 跳转到指定时间 */
abstract seek(time: number): Promise<number>
/** 更改时间 */
abstract changeTime(change: number): Promise<number>
}
export class VideoPlayerAgent extends PlayerAgent {
type: AgentType = 'video'
get nativeApi() { return unsafeWindow.player }
query = selectorWrap({
playerWrap: '.player-wrap',
bilibiliPlayer: '.bilibili-player',
playerArea: '.bilibili-player-area',
video: {
element: 'video',
wrap: '.bilibili-player-video-wrap',
top: '.bilibili-player-top',
state: '.bilibili-player-state',
panel: '.bilibili-player-video-panel',
popup: '.bilibili-player-video-popup',
subtitle: '.bilibili-player-video-subtitle',
basDanmaku: '.bilibili-player-bas-danmaku',
advDanmaku: '.bilibili-player-adv-danmaku',
danmaku: '.bilibili-player-danmaku',
container: '.bilibili-player-video',
},
control: {
element: '.bilibili-player-control',
wrap: '.bilibili-player-control-wrap',
mask: '.bilibili-player-control-mask',
top: '.bilibili-player-control-top',
progress: '.bilibili-player-video-progress',
bottom: '.bilibili-player-control-bottom',
bottomLeft: '.bilibili-player-control-bottom-left',
bottomCenter: '.bilibili-player-control-bottom-center',
bottomRight: '.bilibili-player-control-bottom-right',
buttons: {
start: '.bilibili-player-video-btn-start',
next: '.bilibili-player-video-btn-next',
time: '.bilibili-player-video-time',
quality: '.bilibili-player-btn-quality',
pageList: '.bilibili-player-video-btn-pagelist',
speed: '.bilibili-player-video-btn-speed',
subtitle: '.bilibili-player-video-btn-subtitle',
volume: '.bilibili-player-video-btn-volume .bilibili-player-iconfont-volume',
settings: '.bilibili-player-video-btn-setting',
pip: '.bilibili-player-video-btn-pip',
widescreen: '.bilibili-player-video-btn-widescreen',
webFullscreen: '.bilibili-player-video-web-fullscreen',
fullscreen: '.bilibili-player-video-btn-fullscreen',
}
},
toastWrap: '.bilibili-player-video-toast-wrp',
danmakuTipLayer: '.bilibili-player-dm-tip-wrap',
danmakuSwitch: '.bilibili-player-video-danmaku-switch input',
}) as PlayerQuery<ElementQuery>
async isMute() {
return this.nativeApi.isMute()
}
async changeVolume(change: number) {
const current = this.nativeApi.volume()
this.nativeApi.volume(current + change / 100)
return Math.round(this.nativeApi.volume() * 100)
}
async seek(time: number) {
this.nativeApi.play()
setTimeout(() => {
this.nativeApi.seek(time)
const toastText = dq(".bilibili-player-video-toast-bottom .bilibili-player-video-toast-item:first-child .bilibili-player-video-toast-item-text span:nth-child(2)")
if (toastText) {
toastText.textContent = " 00:00"
}
})
return this.nativeApi.getCurrentTime()
}
async changeTime(change: number) {
const video = await this.query.video.element() as HTMLVideoElement
this.nativeApi.seek(video.currentTime + change, video.paused)
return this.nativeApi.getCurrentTime()
}
}
export class BwpPlayerAgent extends VideoPlayerAgent {
type: AgentType = 'bwp'
constructor() {
super()
this.query.video.element = select('bwp-video')
}
}
export class BangumiPlayerAgent extends PlayerAgent {
type: AgentType = 'bangumi'
query = selectorWrap({
playerWrap: '.player-module',
bilibiliPlayer: '.bpx-player-container',
playerArea: '.bpx-player-primary-area',
video: {
element: 'video',
wrap: '.bpx-player-video-area',
top: '.bpx-player-top-wrap',
state: '.bpx-player-state-wrap',
panel: '.bpx-player-ending-panel',
popup: '.bpx-player-dialog-wrap',
subtitle: '.bpx-player-subtitle-wrap',
basDanmaku: '.bpx-player-bas-dm-wrap',
advDanmaku: '.bpx-player-adv-dm-wrap',
danmaku: '.bpx-player-row-dm-wrap',
container: '.bpx-player-video-wrap',
},
control: {
element: '.squirtle-controller',
wrap: '.bpx-player-control-wrap',
mask: '.bpx-player-control-mask',
top: '.bpx-player-control-top',
progress: '.squirtle-progress-wrap',
bottom: '.squirtle-controller-wrap',
bottomLeft: '.squirtle-controller-wrap-left',
bottomCenter: '.squirtle-controller-wrap-center',
bottomRight: '.squirtle-controller-wrap-right',
buttons: {
start: '.squirtle-video-start',
next: '.squirtle-video-next',
time: '.squirtle-video-time',
quality: '.squirtle-video-quality',
pageList: '.squirtle-video-pagelist',
speed: '.squirtle-video-speed',
subtitle: '.squirtle-video-subtitle',
volume: '.squirtle-video-volume .squirtle-volume-icon',
settings: '.squirtle-video-setting',
pip: '.squirtle-video-pip',
widescreen: '.squirtle-video-widescreen',
webFullscreen: '.squirtle-video-pagefullscreen',
fullscreen: '.squirtle-video-fullscreen',
}
},
toastWrap: '.bpx-player-tooltip-area',
danmakuTipLayer: '.bpx-player-dialog-wrap',
danmakuSwitch: '.bpx-player-dm-switch input',
}) as PlayerQuery<ElementQuery>
async isMute() {
const icon = await this.query.control.buttons.volume() as HTMLElement
return icon?.classList.contains('squirtle-volume-mute-state') ?? false
}
async changeVolume(change: number) {
const video = await this.query.video.element() as HTMLVideoElement
video.volume = _.clamp(video.volume + change / 100, 0, 1)
return Math.round(video.volume * 100)
}
async seek(time: number) {
const video = await this.query.video.element() as HTMLVideoElement
video.play()
setTimeout(() => {
video.currentTime = _.clamp(time, 0, video.duration)
const toastText = dq('.bpx-player-toast-row .bpx-player-toast-item .bpx-player-toast-text')
if (toastText?.textContent?.startsWith('已为您定位至')) {
toastText.textContent = '已为您定位至00:00'
}
})
return video.currentTime
}
async changeTime(change: number) {
const video = await this.query.video.element() as HTMLVideoElement
video.currentTime = _.clamp(video.currentTime + change, 0, video.duration)
return video.currentTime
}
}
export const playerAgent = (() => {
if (document.URL.includes('//www.bilibili.com/bangumi/play')) {
return new BangumiPlayerAgent()
}
if (unsafeWindow.__ENABLE_WASM_PLAYER__) {
return new BwpPlayerAgent()
}
return new VideoPlayerAgent()
})()
export default {
export: {
playerAgent,
}
}

View File

@ -12,8 +12,10 @@ const entry = () => {
}
resources.applyStyle(styleID)
const removeCover = () => document.body.style.removeProperty('--cover-url')
const originalPlay = HTMLVideoElement.prototype.play
HTMLVideoElement.prototype.play = function (...args: any[]) {
const isBwpVideo = unsafeWindow.__ENABLE_WASM_PLAYER__ || dq('bwp-video')
const proto = isBwpVideo ? BwpElement.prototype : HTMLVideoElement.prototype
const originalPlay = proto.play
proto.play = function (...args: any[]) {
removeCover()
return originalPlay.call(this, ...args)
}

View File

@ -1,5 +1,5 @@
export class VideoSpeedController {
static readonly classNameMap = {
static classNameMap = {
speedMenuList: "bilibili-player-video-btn-speed-menu",
speedMenuItem: "bilibili-player-video-btn-speed-menu-list",
speedNameBtn: "bilibili-player-video-btn-speed-name",
@ -106,7 +106,7 @@ export class VideoSpeedController {
return new VideoSpeedController(containerElement, videoElement, previousSpeed, nativeSpeed)
}
static init = _.once(() => {
static init = _.once(async () => {
// 分 P 切换时共享同一个倍数,这里指定初始倍数可以是 undefined不需要是 1
let sharedSpeed: number | undefined = undefined
// 分 P 切换时共享同一个原生倍速值,初始值设置为 1
@ -114,6 +114,37 @@ export class VideoSpeedController {
// 持有菜单容器元素的引用videoChange 时更换(以前缓存的 VideoController 就没有意义了)
let containerElement: HTMLElement
const { playerAgent } = await import('../player-agent')
const extendedAgent = playerAgent.provideCustomQuery({
video: {
speedMenuList: 'bilibili-player-video-btn-speed-menu',
speedMenuItem: 'bilibili-player-video-btn-speed-menu-list',
speedNameBtn: 'bilibili-player-video-btn-speed-name',
speedContainer: 'bilibili-player-video-btn-speed',
active: 'bilibili-player-active',
show: 'bilibili-player-speed-show',
},
bangumi: {
speedMenuList: 'squirtle-speed-select-list',
speedMenuItem: 'squirtle-select-item',
speedNameBtn: 'squirtle-speed-select-result',
speedContainer: 'squirtle-speed-wrap',
active: 'active',
// bangumi 那边没有这种 class, 随便填一个就行了
show: 'bilibili-player-speed-show',
}
})
const trimLeadingDot = (selector: string) => selector.replace(/^\./, '')
VideoSpeedController.classNameMap = {
speedMenuList: trimLeadingDot(extendedAgent.custom.speedMenuList.selector),
speedMenuItem: trimLeadingDot(extendedAgent.custom.speedMenuItem.selector),
speedNameBtn: trimLeadingDot(extendedAgent.custom.speedNameBtn.selector),
speedContainer: trimLeadingDot(extendedAgent.custom.speedContainer.selector),
active: trimLeadingDot(extendedAgent.custom.active.selector),
show: trimLeadingDot(extendedAgent.custom.show.selector),
video: trimLeadingDot(extendedAgent.query.video.container.selector),
}
Observer.videoChange(async () => {
const { getExtraSpeedMenuItemElements } = await import("./extend-video-speed")
const { calcOrder } = await import("./video-speed-common")
@ -176,12 +207,20 @@ export class VideoSpeedController {
return controller
}
this._videoElement = videoElement
this._containerElement = containerElement
this._previousSpeedVal = previousSpeed
this._nativeSpeedVal = nativeSpeed ?? (previousSpeed && VideoSpeedController.nativeSupportedRates.includes(previousSpeed) ? previousSpeed : 1)
this._nameBtn = this._containerElement.querySelector(`.${VideoSpeedController.classNameMap.speedNameBtn}`) as HTMLButtonElement
this._menuListElement = this._containerElement.querySelector(`.${VideoSpeedController.classNameMap.speedMenuList}`) as HTMLElement
this._menuListElement.querySelectorAll(`.${VideoSpeedController.classNameMap.speedMenuItem}`).forEach(it => {
if (!it.hasAttribute('data-value')) {
const speed = parseFloat(it.textContent!).toString()
it.setAttribute('data-value', speed)
}
})
VideoSpeedController.instanceMap.set(containerElement, this)
}

View File

@ -1 +1 @@
1.12.16
1.12.19