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 }')