diff --git a/.vscode/extensions.json b/.vscode/extensions.json
index d77ba87..2182da9 100644
--- a/.vscode/extensions.json
+++ b/.vscode/extensions.json
@@ -1,3 +1,3 @@
{
- "recommendations": ["Vue.volar", "Vue.vscode-typescript-vue-plugin"]
+ "recommendations": ["Vue.volar", "esbenp.prettier-vscode", "dbaeumer.vscode-eslint"]
}
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 03a08f5..87d6b2a 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,21 @@
## NEXT_VERSION
+## [1.3.5](https://github.com/ADJazzzz/BLSPAM/compare/1.3.4...1.3.6) 2024-08-10
+
+### 新增
+
+- 适配深色模式(自动跟随B站官方实验室中的深色模式)
+
+### 修复
+
+- 修复通用表情显示问题
+- 过滤无效表情
+
+### 调整
+
+- B站相关API调整
+- 更改CDN [unpkg => jsdelivr](https://www.jsdelivr.com)
+
## [1.3.4](https://github.com/ADJazzzz/BLSPAM/compare/1.3.3...1.3.4) 2024-08-01
### 修复
@@ -10,7 +26,7 @@
### 修复
-- 修复段弹幕无法停止的问题
+- 修复短弹幕无法停止的问题
## [1.3.2](https://github.com/ADJazzzz/BLSPAM/compare/1.3.1...1.3.2) 2024-07-21
diff --git a/README.md b/README.md
index c7007ed..c48edc0 100644
--- a/README.md
+++ b/README.md
@@ -25,8 +25,8 @@
- 使用独轮车可能会对直播间环境造成污染,若你的账号被封禁或禁言,本脚本、作者以及贡献者不负任何责任
- 本脚本会使用你的账号信息用于对B站相关API请求
-- 本脚本只会对B站相关域名、依赖CDN(目前使用的是 [UNPKG](https://unpkg.com/) )和 Github API 发起请求
-- 部分地区可能无法从CDN([UNPKG](https://unpkg.com/))获取相关依赖,请尝试修改host或开魔法
+- 本脚本只会对B站相关域名、依赖CDN 和 Github API 发起请求
+- 部分地区可能无法从 CDN 获取相关依赖,请尝试修改host或开魔法
**安装**
@@ -46,7 +46,7 @@
-> 右上角为状态显示,蓝色为可使用状态,红色为不可使用状态(即未登录),绿色为正在运行独轮车
+> 右上角为状态显示,蓝色为可使用状态,红色为不可使用状态(未登录,API异常等),绿色为正在运行独轮车
# 兼容
diff --git a/images/panel.png b/images/panel.png
index d5e2d55..666fc76 100644
Binary files a/images/panel.png and b/images/panel.png differ
diff --git a/package-lock.json b/package-lock.json
index c556d00..76d73b0 100644
--- a/package-lock.json
+++ b/package-lock.json
@@ -1,31 +1,31 @@
{
"name": "bilibili-live-spamer",
- "version": "1.3.4",
+ "version": "1.3.5",
"lockfileVersion": 3,
"requires": true,
"packages": {
"": {
"name": "bilibili-live-spamer",
- "version": "1.3.4",
+ "version": "1.3.5",
"dependencies": {
- "axios": "^1.7.2",
+ "axios": "^1.7.3",
"lodash": "^4.17.21",
"mitt": "^3.0.1",
"naive-ui": "^2.39.0",
- "pinia": "^2.2.0",
- "vue": "^3.4.35"
+ "pinia": "^2.2.1",
+ "vue": "^3.4.37"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.4",
- "@vitejs/plugin-vue": "^5.1.1",
+ "@vitejs/plugin-vue": "^5.1.2",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.27.0",
"prettier": "^3.3.3",
- "terser": "^5.31.3",
+ "terser": "^5.31.5",
"typescript": "^5.5.4",
- "vite": "^5.3.5",
+ "vite": "^5.4.0",
"vite-plugin-monkey": "^4.0.6",
"vue-tsc": "^2.0.29"
}
@@ -1149,9 +1149,9 @@
"dev": true
},
"node_modules/@vitejs/plugin-vue": {
- "version": "5.1.1",
- "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.1.1.tgz",
- "integrity": "sha512-sDckXxlHpMsjRQbAH9WanangrfrblsOd3pNifePs+FOHjJg1jfWq5L/P0PsBRndEt3nmdUnmvieP8ULDeX5AvA==",
+ "version": "5.1.2",
+ "resolved": "https://registry.npmjs.org/@vitejs/plugin-vue/-/plugin-vue-5.1.2.tgz",
+ "integrity": "sha512-nY9IwH12qeiJqumTCLJLE7IiNx7HZ39cbHaysEUd+Myvbz9KAqd2yq+U01Kab1R/H1BmiyM2ShTYlNH32Fzo3A==",
"dev": true,
"license": "MIT",
"engines": {
@@ -1192,39 +1192,51 @@
}
},
"node_modules/@vue/compiler-core": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.35.tgz",
- "integrity": "sha512-gKp0zGoLnMYtw4uS/SJRRO7rsVggLjvot3mcctlMXunYNsX+aRJDqqw/lV5/gHK91nvaAAlWFgdVl020AW1Prg==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-core/-/compiler-core-3.4.37.tgz",
+ "integrity": "sha512-ZDDT/KiLKuCRXyzWecNzC5vTcubGz4LECAtfGPENpo0nrmqJHwuWtRLxk/Sb9RAKtR9iFflFycbkjkY+W/PZUQ==",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.24.7",
- "@vue/shared": "3.4.35",
- "entities": "^4.5.0",
+ "@vue/shared": "3.4.37",
+ "entities": "^5.0.0",
"estree-walker": "^2.0.2",
"source-map-js": "^1.2.0"
}
},
+ "node_modules/@vue/compiler-core/node_modules/entities": {
+ "version": "5.0.0",
+ "resolved": "https://registry.npmjs.org/entities/-/entities-5.0.0.tgz",
+ "integrity": "sha512-BeJFvFRJddxobhvEdm5GqHzRV/X+ACeuw0/BuuxsCh1EUZcAIz8+kYmBp/LrQuloy6K1f3a0M7+IhmZ7QnkISA==",
+ "license": "BSD-2-Clause",
+ "engines": {
+ "node": ">=0.12"
+ },
+ "funding": {
+ "url": "https://github.com/fb55/entities?sponsor=1"
+ }
+ },
"node_modules/@vue/compiler-dom": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.35.tgz",
- "integrity": "sha512-pWIZRL76/oE/VMhdv/ovZfmuooEni6JPG1BFe7oLk5DZRo/ImydXijoZl/4kh2406boRQ7lxTYzbZEEXEhj9NQ==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-dom/-/compiler-dom-3.4.37.tgz",
+ "integrity": "sha512-rIiSmL3YrntvgYV84rekAtU/xfogMUJIclUMeIKEtVBFngOL3IeZHhsH3UaFEgB5iFGpj6IW+8YuM/2Up+vVag==",
"license": "MIT",
"dependencies": {
- "@vue/compiler-core": "3.4.35",
- "@vue/shared": "3.4.35"
+ "@vue/compiler-core": "3.4.37",
+ "@vue/shared": "3.4.37"
}
},
"node_modules/@vue/compiler-sfc": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.35.tgz",
- "integrity": "sha512-xacnRS/h/FCsjsMfxBkzjoNxyxEyKyZfBch/P4vkLRvYJwe5ChXmZZrj8Dsed/752H2Q3JE8kYu9Uyha9J6PgA==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-sfc/-/compiler-sfc-3.4.37.tgz",
+ "integrity": "sha512-vCfetdas40Wk9aK/WWf8XcVESffsbNkBQwS5t13Y/PcfqKfIwJX2gF+82th6dOpnpbptNMlMjAny80li7TaCIg==",
"license": "MIT",
"dependencies": {
"@babel/parser": "^7.24.7",
- "@vue/compiler-core": "3.4.35",
- "@vue/compiler-dom": "3.4.35",
- "@vue/compiler-ssr": "3.4.35",
- "@vue/shared": "3.4.35",
+ "@vue/compiler-core": "3.4.37",
+ "@vue/compiler-dom": "3.4.37",
+ "@vue/compiler-ssr": "3.4.37",
+ "@vue/shared": "3.4.37",
"estree-walker": "^2.0.2",
"magic-string": "^0.30.10",
"postcss": "^8.4.40",
@@ -1232,13 +1244,13 @@
}
},
"node_modules/@vue/compiler-ssr": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.35.tgz",
- "integrity": "sha512-7iynB+0KB1AAJKk/biENTV5cRGHRdbdaD7Mx3nWcm1W8bVD6QmnH3B4AHhQQ1qZHhqFwzEzMwiytXm3PX1e60A==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/compiler-ssr/-/compiler-ssr-3.4.37.tgz",
+ "integrity": "sha512-TyAgYBWrHlFrt4qpdACh8e9Ms6C/AZQ6A6xLJaWrCL8GCX5DxMzxyeFAEMfU/VFr4tylHm+a2NpfJpcd7+20XA==",
"license": "MIT",
"dependencies": {
- "@vue/compiler-dom": "3.4.35",
- "@vue/shared": "3.4.35"
+ "@vue/compiler-dom": "3.4.37",
+ "@vue/shared": "3.4.37"
}
},
"node_modules/@vue/compiler-vue2": {
@@ -1348,53 +1360,53 @@
}
},
"node_modules/@vue/reactivity": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.35.tgz",
- "integrity": "sha512-Ggtz7ZZHakriKioveJtPlStYardwQH6VCs9V13/4qjHSQb/teE30LVJNrbBVs4+aoYGtTQKJbTe4CWGxVZrvEw==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/reactivity/-/reactivity-3.4.37.tgz",
+ "integrity": "sha512-UmdKXGx0BZ5kkxPqQr3PK3tElz6adTey4307NzZ3whZu19i5VavYal7u2FfOmAzlcDVgE8+X0HZ2LxLb/jgbYw==",
"license": "MIT",
"dependencies": {
- "@vue/shared": "3.4.35"
+ "@vue/shared": "3.4.37"
}
},
"node_modules/@vue/runtime-core": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.35.tgz",
- "integrity": "sha512-D+BAjFoWwT5wtITpSxwqfWZiBClhBbR+bm0VQlWYFOadUUXFo+5wbe9ErXhLvwguPiLZdEF13QAWi2vP3ZD5tA==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/runtime-core/-/runtime-core-3.4.37.tgz",
+ "integrity": "sha512-MNjrVoLV/sirHZoD7QAilU1Ifs7m/KJv4/84QVbE6nyAZGQNVOa1HGxaOzp9YqCG+GpLt1hNDC4RbH+KtanV7w==",
"license": "MIT",
"dependencies": {
- "@vue/reactivity": "3.4.35",
- "@vue/shared": "3.4.35"
+ "@vue/reactivity": "3.4.37",
+ "@vue/shared": "3.4.37"
}
},
"node_modules/@vue/runtime-dom": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.35.tgz",
- "integrity": "sha512-yGOlbos+MVhlS5NWBF2HDNgblG8e2MY3+GigHEyR/dREAluvI5tuUUgie3/9XeqhPE4LF0i2wjlduh5thnfOqw==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/runtime-dom/-/runtime-dom-3.4.37.tgz",
+ "integrity": "sha512-Mg2EwgGZqtwKrqdL/FKMF2NEaOHuH+Ks9TQn3DHKyX//hQTYOun+7Tqp1eo0P4Ds+SjltZshOSRq6VsU0baaNg==",
"license": "MIT",
"dependencies": {
- "@vue/reactivity": "3.4.35",
- "@vue/runtime-core": "3.4.35",
- "@vue/shared": "3.4.35",
+ "@vue/reactivity": "3.4.37",
+ "@vue/runtime-core": "3.4.37",
+ "@vue/shared": "3.4.37",
"csstype": "^3.1.3"
}
},
"node_modules/@vue/server-renderer": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.35.tgz",
- "integrity": "sha512-iZ0e/u9mRE4T8tNhlo0tbA+gzVkgv8r5BX6s1kRbOZqfpq14qoIvCZ5gIgraOmYkMYrSEZgkkojFPr+Nyq/Mnw==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/server-renderer/-/server-renderer-3.4.37.tgz",
+ "integrity": "sha512-jZ5FAHDR2KBq2FsRUJW6GKDOAG9lUTX8aBEGq4Vf6B/35I9fPce66BornuwmqmKgfiSlecwuOb6oeoamYMohkg==",
"license": "MIT",
"dependencies": {
- "@vue/compiler-ssr": "3.4.35",
- "@vue/shared": "3.4.35"
+ "@vue/compiler-ssr": "3.4.37",
+ "@vue/shared": "3.4.37"
},
"peerDependencies": {
- "vue": "3.4.35"
+ "vue": "3.4.37"
}
},
"node_modules/@vue/shared": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.35.tgz",
- "integrity": "sha512-hvuhBYYDe+b1G8KHxsQ0diDqDMA8D9laxWZhNAjE83VZb5UDaXl9Xnz7cGdDSyiHM90qqI/CyGMcpBpiDy6VVQ==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/@vue/shared/-/shared-3.4.37.tgz",
+ "integrity": "sha512-nIh8P2fc3DflG8+5Uw8PT/1i17ccFn0xxN/5oE9RfV5SVnd7G0XEFRwakrnNFE/jlS95fpGXDVG5zDETS26nmg==",
"license": "MIT"
},
"node_modules/acorn": {
@@ -1486,9 +1498,9 @@
"integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q=="
},
"node_modules/axios": {
- "version": "1.7.2",
- "resolved": "https://registry.npmmirror.com/axios/-/axios-1.7.2.tgz",
- "integrity": "sha512-2A8QhOMrbomlDuiLeK9XibIBzuHeRcqqNOHp0Cyp5EoJ1IFDh+XZH3A6BkXtv0K4gFGCI0Y4BM7B1wOEi0Rmgw==",
+ "version": "1.7.3",
+ "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz",
+ "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==",
"license": "MIT",
"dependencies": {
"follow-redirects": "^1.15.6",
@@ -1847,6 +1859,7 @@
"version": "4.5.0",
"resolved": "https://registry.npmmirror.com/entities/-/entities-4.5.0.tgz",
"integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==",
+ "dev": true,
"engines": {
"node": ">=0.12"
}
@@ -3007,13 +3020,13 @@
}
},
"node_modules/pinia": {
- "version": "2.2.0",
- "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.2.0.tgz",
- "integrity": "sha512-iPrIh26GMqfpUlMOGyxuDowGmYousTecbTHFwT0xZ1zJvh23oQ+Cj99ZoPQA1TnUPhU6AuRPv6/drkTCJ0VHQA==",
+ "version": "2.2.1",
+ "resolved": "https://registry.npmjs.org/pinia/-/pinia-2.2.1.tgz",
+ "integrity": "sha512-ltEU3xwiz5ojVMizdP93AHi84Rtfz0+yKd8ud75hr9LVyWX2alxp7vLbY1kFm7MXFmHHr/9B08Xf8Jj6IHTEiQ==",
"license": "MIT",
"dependencies": {
"@vue/devtools-api": "^6.6.3",
- "vue-demi": "^0.14.8"
+ "vue-demi": "^0.14.10"
},
"funding": {
"url": "https://github.com/sponsors/posva"
@@ -3470,9 +3483,9 @@
"dev": true
},
"node_modules/terser": {
- "version": "5.31.3",
- "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.3.tgz",
- "integrity": "sha512-pAfYn3NIZLyZpa83ZKigvj6Rn9c/vd5KfYGX7cN1mnzqgDcxWvrU5ZtAfIKhEXz9nRecw4z3LXkjaq96/qZqAA==",
+ "version": "5.31.5",
+ "resolved": "https://registry.npmjs.org/terser/-/terser-5.31.5.tgz",
+ "integrity": "sha512-YPmas0L0rE1UyLL/llTWA0SiDOqIcAQYLeUj7cJYzXHlRTAnMSg9pPe4VJ5PlKvTrPQsdVFuiRiwyeNlYgwh2Q==",
"dev": true,
"license": "BSD-2-Clause",
"dependencies": {
@@ -3627,14 +3640,14 @@
}
},
"node_modules/vite": {
- "version": "5.3.5",
- "resolved": "https://registry.npmjs.org/vite/-/vite-5.3.5.tgz",
- "integrity": "sha512-MdjglKR6AQXQb9JGiS7Rc2wC6uMjcm7Go/NHNO63EwiJXfuk9PgqiP/n5IDJCziMkfw9n4Ubp7lttNwz+8ZVKA==",
+ "version": "5.4.0",
+ "resolved": "https://registry.npmjs.org/vite/-/vite-5.4.0.tgz",
+ "integrity": "sha512-5xokfMX0PIiwCMCMb9ZJcMyh5wbBun0zUzKib+L65vAZ8GY9ePZMXxFrHbr/Kyll2+LSCY7xtERPpxkBDKngwg==",
"dev": true,
"license": "MIT",
"dependencies": {
"esbuild": "^0.21.3",
- "postcss": "^8.4.39",
+ "postcss": "^8.4.40",
"rollup": "^4.13.0"
},
"bin": {
@@ -3654,6 +3667,7 @@
"less": "*",
"lightningcss": "^1.21.0",
"sass": "*",
+ "sass-embedded": "*",
"stylus": "*",
"sugarss": "*",
"terser": "^5.4.0"
@@ -3671,6 +3685,9 @@
"sass": {
"optional": true
},
+ "sass-embedded": {
+ "optional": true
+ },
"stylus": {
"optional": true
},
@@ -3727,16 +3744,16 @@
"license": "MIT"
},
"node_modules/vue": {
- "version": "3.4.35",
- "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.35.tgz",
- "integrity": "sha512-+fl/GLmI4GPileHftVlCdB7fUL4aziPcqTudpTGXCT8s+iZWuOCeNEB5haX6Uz2IpRrbEXOgIFbe+XciCuGbNQ==",
+ "version": "3.4.37",
+ "resolved": "https://registry.npmjs.org/vue/-/vue-3.4.37.tgz",
+ "integrity": "sha512-3vXvNfkKTBsSJ7JP+LyR7GBuwQuckbWvuwAid3xbqK9ppsKt/DUvfqgZ48fgOLEfpy1IacL5f8QhUVl77RaI7A==",
"license": "MIT",
"dependencies": {
- "@vue/compiler-dom": "3.4.35",
- "@vue/compiler-sfc": "3.4.35",
- "@vue/runtime-dom": "3.4.35",
- "@vue/server-renderer": "3.4.35",
- "@vue/shared": "3.4.35"
+ "@vue/compiler-dom": "3.4.37",
+ "@vue/compiler-sfc": "3.4.37",
+ "@vue/runtime-dom": "3.4.37",
+ "@vue/server-renderer": "3.4.37",
+ "@vue/shared": "3.4.37"
},
"peerDependencies": {
"typescript": "*"
diff --git a/package.json b/package.json
index 38a8744..10c86ca 100644
--- a/package.json
+++ b/package.json
@@ -1,7 +1,7 @@
{
"name": "bilibili-live-spamer",
"private": true,
- "version": "1.3.4",
+ "version": "1.3.5",
"type": "module",
"scripts": {
"dev": "vite",
@@ -11,24 +11,24 @@
"format": "prettier --write src/"
},
"dependencies": {
- "axios": "^1.7.2",
+ "axios": "^1.7.3",
"lodash": "^4.17.21",
"mitt": "^3.0.1",
"naive-ui": "^2.39.0",
- "pinia": "^2.2.0",
- "vue": "^3.4.35"
+ "pinia": "^2.2.1",
+ "vue": "^3.4.37"
},
"devDependencies": {
"@rushstack/eslint-patch": "^1.10.4",
- "@vitejs/plugin-vue": "^5.1.1",
+ "@vitejs/plugin-vue": "^5.1.2",
"@vue/eslint-config-prettier": "^9.0.0",
"@vue/eslint-config-typescript": "^13.0.0",
"eslint": "^8.57.0",
"eslint-plugin-vue": "^9.27.0",
"prettier": "^3.3.3",
- "terser": "^5.31.3",
+ "terser": "^5.31.5",
"typescript": "^5.5.4",
- "vite": "^5.3.5",
+ "vite": "^5.4.0",
"vite-plugin-monkey": "^4.0.6",
"vue-tsc": "^2.0.29"
}
diff --git a/src/App.vue b/src/App.vue
index 8ddaab4..037bb98 100644
--- a/src/App.vue
+++ b/src/App.vue
@@ -10,7 +10,8 @@ import {
NModal,
NLayout,
NLayoutSider,
- NLayoutContent
+ NLayoutContent,
+ darkTheme
} from 'naive-ui'
import { h, render } from 'vue'
import { dq, pollingQuery } from './utils/dom'
@@ -21,7 +22,7 @@ import MainIcon from './components/Icons/MainIcon.vue'
import PanelMenu from './components/PanelMenu.vue'
import PanelContent from './components/PanelContent.vue'
import Logger from './utils/logger'
-import { GM_addStyle } from '$'
+import { GM_addStyle, unsafeWindow } from '$'
const logger = new Logger('App')
@@ -45,6 +46,7 @@ const renderPanel = () => {
uiStore.uiConfig.isShowPanel = false
} else {
uiStore.uiConfig.isShowPanel = true
+ handleUpdateTheme()
}
}
},
@@ -76,10 +78,15 @@ const renderPanel = () => {
})
}
-const handleCollapse = (collapsed: boolean) => {
+const handleUpdateCollapse = (collapsed: boolean) => {
uiStore.uiConfig.isCollapsed = collapsed
}
+const handleUpdateTheme = () => {
+ const biliTheme = unsafeWindow.bililiveThemeV2.getTheme()
+ uiStore.uiConfig.theme = biliTheme
+}
+
const observer = new MutationObserver((mutationsList, observer) => {
const controlPanel = dq('#control-panel-ctnr-box')
if (controlPanel) {
@@ -96,7 +103,7 @@ GM_addStyle('body { font-size: 12px }')
-
+
@@ -110,7 +117,7 @@ GM_addStyle('body { font-size: 12px }')
:native-scrollbar="false"
content-style="max-height: 320px; padding-top: 8px"
:collapsed="uiStore.uiConfig.isCollapsed"
- :on-update:collapsed="handleCollapse"
+ :on-update:collapsed="handleUpdateCollapse"
>
diff --git a/src/components/EmotionView.vue b/src/components/EmotionView.vue
index 816e75f..f7f78ef 100644
--- a/src/components/EmotionView.vue
+++ b/src/components/EmotionView.vue
@@ -71,12 +71,16 @@ const handleStopSpamer = () => {
-
+
@@ -101,7 +105,12 @@ const handleStopSpamer = () => {
>
-
+
{{ data.emoji }}
diff --git a/src/stores/useUIStore.ts b/src/stores/useUIStore.ts
index 218f02e..b95190d 100644
--- a/src/stores/useUIStore.ts
+++ b/src/stores/useUIStore.ts
@@ -10,6 +10,7 @@ export const useUIStore = defineStore('ui', () => {
const updateMenuValue = (key: menuIndex) => {
uiConfig.activeMenuIndex = key
}
+
watch(
uiConfig,
_.debounce((newUiConfig: uiConfig) => Storage.setUiConfig(newUiConfig), 350)
diff --git a/src/types/bapidata.d.ts b/src/types/bapidata.d.ts
index 2bb80fd..7983e51 100644
--- a/src/types/bapidata.d.ts
+++ b/src/types/bapidata.d.ts
@@ -8,6 +8,66 @@ declare namespace LiveInfoData {
mode: number
show_player_type: number
extra: string
+ user: User
+ }
+ interface User {
+ uid: number
+ base: Base
+ medal: Medal | null
+ wealth: any | null
+ title: Title
+ guard: any | null
+ uhead_frame: any | null
+ guard_leader: GuardLeader
+ }
+ interface Base {
+ name: string
+ face: string
+ name_color: number
+ is_mystery: boolean
+ risk_ctrl_info: any | null
+ origin_info: OriginInfo
+ official_info: OfficialInfo
+ name_color_str: string
+ }
+ interface OriginInfo {
+ name: string
+ face: string
+ }
+ interface OfficialInfo {
+ role: number
+ title: string
+ desc: string
+ type: number
+ }
+ interface Medal {
+ name: string
+ level: number
+ color_start: number
+ color_end: number
+ color_border: number
+ color: number
+ id: number
+ typ: number
+ is_light: number
+ ruid: number
+ guard_level: number
+ score: number
+ guard_icon: string
+ honor_icon: string
+ v2_medal_color_start: string
+ v2_medal_color_end: string
+ v2_medal_color_border: string
+ v2_medal_color_text: string
+ v2_medal_color_level: string
+ user_receive_count: number
+ }
+ interface Title {
+ old_title_css_id: string
+ title_css_id: string
+ }
+ interface GuardLeader {
+ is_guard_leader: boolean
}
}
@@ -113,6 +173,7 @@ declare namespace UserData {
is_senior_member: number
wbi_img: WbiImg
is_jury: boolean
+ name_render: any
}
interface LevelInfo {
diff --git a/src/types/bapimethod.d.ts b/src/types/bapimethod.d.ts
index 1d121a3..7792369 100644
--- a/src/types/bapimethod.d.ts
+++ b/src/types/bapimethod.d.ts
@@ -4,22 +4,26 @@ interface BApiMethod {
sendMsg: (
msg: string,
room_id: number,
- room_type?: number,
+ bubble?: number,
+ color?: number,
mode?: number,
+ room_type?: number,
jumpfrom?: number,
- fontsize?: number,
- color?: number,
- bubble?: number,
- reply_mid?: number
+ reply_mid?: number,
+ reply_attr?: number,
+ replay_dmid?: any,
+ statistics?: { appId: number; platform: number },
+ fontsize?: number
) => Promise
sendEmotion: (
msg: string,
roomid: number,
+ bubble?: number,
color?: number,
mode?: number,
dm_type?: number,
- fontsize?: number,
- bubble?: number
+ emoticonOptions?: any,
+ fontsize?: number
) => Promise
getEmoticons: (
platform: string,
diff --git a/src/types/global.d.ts b/src/types/global.d.ts
index 0799038..18340c1 100644
--- a/src/types/global.d.ts
+++ b/src/types/global.d.ts
@@ -11,6 +11,9 @@ declare global {
AREA_ID: number
PARENT_AREA_ID: number
}
+ bililiveThemeV2: {
+ getTheme: () => string
+ }
}
}
diff --git a/src/types/storage.d.ts b/src/types/storage.d.ts
index 39fab6f..aa9369c 100644
--- a/src/types/storage.d.ts
+++ b/src/types/storage.d.ts
@@ -39,6 +39,7 @@ interface uiConfig {
activeMenuIndex: menuIndex
isShowPanel: boolean
isCollapsed: boolean
+ theme: string
}
type textGroupTabPanels = {
diff --git a/src/utils/bili/index.ts b/src/utils/bili/index.ts
index 88a67c7..d907560 100644
--- a/src/utils/bili/index.ts
+++ b/src/utils/bili/index.ts
@@ -8,13 +8,15 @@ const BILIAPI: BApiMethod = {
sendMsg: (
msg,
roomid,
- room_type = 0,
+ bubble = 0,
+ color = 16777215,
mode = 1,
+ room_type = 0,
jumpfrom = 0,
+ reply_mid = 0,
+ reply_attr = 0,
fontsize = 25,
- color = 16777215,
- bubble = 0,
- reply_mid = 0
+ statistics = { appId: 100, platform: 5 }
) => {
const biliStore = useBiliStore()
const bili_jct = (biliStore.cookies as BiliCookies).bili_jct
@@ -24,13 +26,15 @@ const BILIAPI: BApiMethod = {
{
msg,
roomid,
- room_type,
+ bubble,
+ color,
mode,
+ room_type,
jumpfrom,
- fontsize,
- color,
- bubble,
reply_mid,
+ reply_attr,
+ fontsize,
+ statistics: JSON.stringify(statistics),
rnd: timestamp(),
csrf: bili_jct,
csrf_token: bili_jct
@@ -46,11 +50,11 @@ const BILIAPI: BApiMethod = {
sendEmotion: (
msg,
roomid,
+ bubble = 0,
color = 16777215,
mode = 1,
dm_type = 1,
- fontsize = 25,
- bubble = 0
+ fontsize = 25
) => {
const biliStore = useBiliStore()
const bili_jct = (biliStore.cookies as BiliCookies).bili_jct
@@ -60,12 +64,12 @@ const BILIAPI: BApiMethod = {
{
msg,
roomid,
+ bubble,
color,
mode,
dm_type,
fontsize,
rnd: timestamp(),
- bubble,
csrf: bili_jct,
csrf_token: bili_jct
},
diff --git a/src/utils/helpinfo/index.ts b/src/utils/helpinfo/index.ts
index b95a761..5b8e2d8 100644
--- a/src/utils/helpinfo/index.ts
+++ b/src/utils/helpinfo/index.ts
@@ -24,7 +24,7 @@ const spHelpInfo: HelpInfo = {
h(
'span',
{ style: { color: '#FF0000', fontWeight: 'bold' } },
- '温馨提示:B站的弹幕菜单有问题,如果你在太低的地方触发,它有可能会无法完全显示所有选项。'
+ '温馨提示:B站的弹幕菜单有问题,如果在太低的地方触发,它有可能会无法完全显示所有选项。'
),
h('br'),
h('span', '该功能默认关闭。')
diff --git a/src/utils/storage/defaultValues.ts b/src/utils/storage/defaultValues.ts
index 66eb92e..fb8dd81 100644
--- a/src/utils/storage/defaultValues.ts
+++ b/src/utils/storage/defaultValues.ts
@@ -9,7 +9,8 @@ export default {
ui: {
activeMenuIndex: 'TextView',
isShowPanel: false,
- isCollapsed: false
+ isCollapsed: false,
+ theme: 'light'
},
modules: {
TextSpam: {
@@ -22,7 +23,7 @@ export default {
EmotionSpam: {
enable: false,
timeinterval: 3,
- emotionViewSelectedID: 100,
+ emotionViewSelectedID: 1,
msg: [],
timelimit: 0
},
diff --git a/vite.config.mts b/vite.config.mts
index 78a4bcd..c3a8cc7 100644
--- a/vite.config.mts
+++ b/vite.config.mts
@@ -27,7 +27,7 @@ export default defineConfig({
},
build: {
externalGlobals: {
- vue: cdn.unpkg('Vue', 'dist/vue.global.prod.js').concat(
+ vue: cdn.jsdelivr('Vue', 'dist/vue.global.prod.js').concat(
await util.fn2dataUrl(() => {
// @ts-ignore
window.Vue = Vue
@@ -35,10 +35,10 @@ export default defineConfig({
window.VueDemi = Vue
})
),
- pinia: cdn.unpkg('Pinia', 'dist/pinia.iife.prod.js'),
- 'naive-ui': cdn.unpkg('naive', 'dist/index.prod.js'),
- axios: cdn.unpkg('axios', 'dist/axios.min.js'),
- lodash: cdn.unpkg('_', 'lodash.min.js')
+ pinia: cdn.jsdelivr('Pinia', 'dist/pinia.iife.prod.js'),
+ 'naive-ui': cdn.jsdelivr('naive', 'dist/index.prod.js'),
+ axios: cdn.jsdelivr('axios', 'dist/axios.min.js'),
+ lodash: cdn.jsdelivr('_', 'lodash.min.js')
}
}
})