Skip to content

Commit

Permalink
optimize: hotkey fit firefox, update some css
Browse files Browse the repository at this point in the history
  • Loading branch information
festoney8 committed Dec 29, 2023
1 parent f4a2e9c commit c6bbbf3
Show file tree
Hide file tree
Showing 6 changed files with 29 additions and 11 deletions.
6 changes: 6 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
# CHANGELOG

## 2.2.0

- 新增:全局快捷键开关 Alt+B 和 Ctrl+Alt+B
- 优化:直播页 页面直角化
- 优化:部分CSS细节

## 2.1.0

- 新增:直播页,隐藏 高能用户提示
Expand Down
12 changes: 10 additions & 2 deletions src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,18 @@ const main = async () => {
})
}

// 启动/关闭快捷键Alt+B
// 全局启动/关闭快捷键 chrome: Alt+B,firefox: Ctrl+Alt+B
let isGroupEnable = true
document.addEventListener('keydown', (event) => {
if (event.altKey && event.key === 'b') {
let flag = false
if (event.altKey && event.ctrlKey && (event.key === 'b' || event.key === 'B')) {
flag = true
} else if (event.altKey && (event.key === 'b' || event.key === 'B')) {
if (navigator.userAgent.toLocaleLowerCase().includes('chrome')) {
flag = true
}
}
if (flag) {
debug('keydown Alt+B detected')
if (isGroupEnable) {
GROUPS.forEach((e) => e.disableGroup())
Expand Down
10 changes: 5 additions & 5 deletions src/pages/common.ts
Original file line number Diff line number Diff line change
Expand Up @@ -626,7 +626,7 @@ if (location.host != 'live.bilibili.com') {
true,
undefined,
false,
`.right-entry .vip-wrap:has([href="//account.bilibili.com/big"]) {
`.right-entry .vip-wrap:has([href*="//account.bilibili.com/big"]) {
display: none !important;
}
/* 旧版header */
Expand All @@ -643,7 +643,7 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap:has([href^="//message.bilibili.com"], [data-idx="message"]) {
`.right-entry .v-popover-wrap:has([href*="//message.bilibili.com"], [data-idx="message"]) {
display: none !important;
}
/* 旧版header */
Expand All @@ -660,7 +660,7 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap:has([href^="//t.bilibili.com"], [data-idx="dynamic"]) {
`.right-entry .v-popover-wrap:has([href*="//t.bilibili.com"], [data-idx="dynamic"]) {
display: none !important;
}
/* 旧版header */
Expand Down Expand Up @@ -694,7 +694,7 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .v-popover-wrap:has([href="//www.bilibili.com/account/history"], [data-idx="history"]) {
`.right-entry .v-popover-wrap:has([href*="www.bilibili.com/account/history"], [data-idx="history"]) {
display: none !important;
}
/* 旧版header */
Expand All @@ -711,7 +711,7 @@ if (location.host != 'live.bilibili.com') {
false,
undefined,
false,
`.right-entry .right-entry-item:has(a[href="//member.bilibili.com/platform/home"], [data-idx="creation"]) {
`.right-entry .right-entry-item:has(a[href*="//member.bilibili.com/platform/home"], [data-idx="creation"]) {
display: none !important;
}
/* 旧版header */
Expand Down
3 changes: 2 additions & 1 deletion src/pages/homepage.ts
Original file line number Diff line number Diff line change
Expand Up @@ -345,7 +345,8 @@ if (location.href.startsWith('https://www.bilibili.com/') && ['/index.html', '/'
undefined,
false,
`.floor-single-card .layer {display: none !important;}
.floor-single-card .floor-card {box-shadow: unset !important; border: none !important;}`,
.floor-single-card .floor-card {box-shadow: unset !important; border: none !important;}
.single-card.floor-card .floor-card-inner:hover {background: none !important;}`,
),
)
// 隐藏 视频列表-分区推荐视频
Expand Down
7 changes: 5 additions & 2 deletions src/pages/live.ts
Original file line number Diff line number Diff line change
Expand Up @@ -472,15 +472,18 @@ if (location.host === 'live.bilibili.com') {
.chat-history-panel .danmaku-at-prompt {bottom: 50px !important;}`,
),
)
// 隐藏 右侧-关闭全部互动框/控制栏
// 隐藏 右侧-关闭全部互动框和控制栏
liveItems.push(
new NormalItem(
'live-page-chat-control-panel',
'隐藏 右侧-关闭全部互动框/控制栏',
'隐藏 右侧-关闭全部互动框和控制栏',
false,
undefined,
false,
`#chat-control-panel-vm {display: none !important;}
.chat-history-panel {
border-radius: 0 0 12px 12px;
}
/* 高权限调高度 */
#aside-area-vm .chat-history-panel {
height: calc(100% - 15px) !important;
Expand Down
2 changes: 1 addition & 1 deletion vite.config.ts
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ export default defineConfig({
userscript: {
name: 'bilibili 页面净化大师',
namespace: 'http://tampermonkey.net/',
version: '2.1.0',
version: '2.1.1',
description: '净化 B站/哔哩哔哩 页面内各种元素,去广告,BV号转AV号,提供300+项功能,定制自己的B站页面',
author: 'festoney8',
homepage: 'https://github.com/festoney8/bilibili-cleaner',
Expand Down

0 comments on commit c6bbbf3

Please sign in to comment.