dsh-pet-live2d 3.1.2 → 3.1.3
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +20 -36
- package/lib/index.js +10 -0
- package/package.json +3 -3
package/CHANGELOG.md
CHANGED
|
@@ -1,56 +1,40 @@
|
|
|
1
1
|
# 更新日志
|
|
2
2
|
|
|
3
|
-
## 3.1.
|
|
3
|
+
## 3.1.3(2026-10-01)
|
|
4
4
|
|
|
5
|
-
###
|
|
5
|
+
### 修:设置里选「桌面」后,桌面上什么都没有(手动双击同一个 exe 却正常)
|
|
6
6
|
|
|
7
|
-
|
|
7
|
+
插件拉起的桌面端会以「挂载模式」去 DSH 那里取宠物数据,而它拿到的地址一直退回默认端口
|
|
8
|
+
3080 —— 在官方桌面客户端下那个端口没人听,于是桌面上空的。现在改成同时看请求的 `Host`
|
|
9
|
+
头(官方客户端的页面地址是 `dsh-app://`,这种外壳下只有 `Host` 是真实地址)。
|
|
8
10
|
|
|
9
|
-
|
|
10
|
-
[Loader.load] Failed to load dsh-app://api/live2d-pet/asset/ds-whale-girl/textures/texture_01.png
|
|
11
|
-
Error: [WorkerManager.loadImageBitmap] Failed to fetch … 404 Not Found
|
|
12
|
-
```
|
|
11
|
+
### 修:官方桌面客户端里贴图全 404、宠物加载失败(issue #1)
|
|
13
12
|
|
|
14
|
-
|
|
13
|
+
官方客户端的页面地址是 `dsh-app://`,而引擎在 Worker 里按相对地址取贴图时,地址里的
|
|
14
|
+
`/api` 会被当成主机名 ⇒ 贴图全部 404。现在交给引擎的地址一律拼成保住主机名的绝对地址。
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
2. Live2D 引擎(Pixi)是在 **blob Worker** 里 `fetch` 贴图的,而 **blob Worker 里解析根相对
|
|
18
|
-
地址 `/api/...` 会把 host 丢掉** ⇒ 请求变成 `dsh-app://api/...` ⇒ 服务端收到的是
|
|
19
|
-
`/live2d-pet/asset/...`(少了 `/api`)⇒ 404 ⇒ 贴图全挂、模型加载失败。
|
|
16
|
+
### 修:某些桌面外壳里宠物和设置页一起白掉
|
|
20
17
|
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
18
|
+
自定义协议或隐私设置下,**一访问 `localStorage` 就会抛异常**,而插件原来到处直接用它。
|
|
19
|
+
现在全部走带兜底的封装:拿不到就退回内存存储 —— 本次会话内位置、大小、装扮照常工作,
|
|
20
|
+
只是关掉窗口不留存。
|
|
24
21
|
|
|
25
|
-
|
|
26
|
-
**光访问 `localStorage` 就会抛 `SecurityError`**,抛在组件第一帧 ⇒ 宠物与设置页一起白掉。
|
|
27
|
-
两处都要有,才算真正"适配得了各种桌面外壳"。)
|
|
22
|
+
### 改:macOS(arm64)的桌面端进了主包声明
|
|
28
23
|
|
|
29
|
-
|
|
24
|
+
装插件时会自动带上 mac 桌面端(在这之前只能从 Release 下 zip)。
|
|
30
25
|
|
|
31
|
-
|
|
26
|
+
## 3.1.2(2026-09-30)
|
|
32
27
|
|
|
33
|
-
|
|
34
|
-
客户端里有 20 多处**直接读写 `window.localStorage`**,而在**自定义协议 / opaque origin**
|
|
35
|
-
的外壳里,**光是访问 `localStorage` 就会抛 `SecurityError`**(有些壳还会因为隐私设置直接
|
|
36
|
-
禁用 storage)。它抛在组件的第一帧里 ⇒ **宠物和设置页一起白掉**,现象看起来就像"这个插件
|
|
37
|
-
不支持我的桌面端"。
|
|
28
|
+
### 修:官方桌面客户端里"加载失败"(issue #1)
|
|
38
29
|
|
|
39
|
-
|
|
30
|
+
`dsh-app://` 外壳下引擎取贴图的地址会丢主机名 ⇒ 404。现已改为传给引擎的地址保住主机名。
|
|
40
31
|
|
|
41
|
-
|
|
42
|
-
- 拿不到、或读写中途抛(配额/隐私模式),就退回**内存实现**:本次会话内位置 / 大小 / 装扮
|
|
43
|
-
照常工作,只是关掉窗口不留存。
|
|
32
|
+
## 3.1.1(2026-09-30)
|
|
44
33
|
|
|
45
|
-
|
|
46
|
-
(`dsh.bundle` / `dsh.client` / `slots`)—— 所以换成 `http://127.0.0.1:<端口>` 之外的外壳
|
|
47
|
-
地址也不该受影响。
|
|
34
|
+
### 修:某些桌面外壳里宠物与设置页一起白掉
|
|
48
35
|
|
|
49
|
-
|
|
36
|
+
这些外壳里访问 `localStorage` 会抛异常;现已加兜底,拿不到就用内存存储。
|
|
50
37
|
|
|
51
|
-
`dsh-pet-live2d-desktop-darwin-arm64` 已在上一版发上 npm,这一版把主包的
|
|
52
|
-
`optionalDependencies` 补上它 —— mac 用户装插件时会自动带上桌面端(在这之前只能从
|
|
53
|
-
Release 下 zip)。
|
|
54
38
|
|
|
55
39
|
## 3.1.0(2026-09-29)
|
|
56
40
|
|
package/lib/index.js
CHANGED
|
@@ -1392,8 +1392,18 @@ function layerRoute(display) {
|
|
|
1392
1392
|
return
|
|
1393
1393
|
}
|
|
1394
1394
|
// 页面自己报来的地址就是 DSH 的地址(端口是配置的,猜会猜错)。
|
|
1395
|
+
//
|
|
1396
|
+
// ⚠️ 但**官方桌面客户端的页面 origin 是 `dsh-app://app`**(自定义协议)—— 那个值
|
|
1397
|
+
// 进不了 `setDshUrl`(它只收 `http(s)://`),于是会一直退回 3080 兜底:
|
|
1398
|
+
// 壳以挂载模式连上一个没人听的端口 ⇒ 桌面上什么都没有(用户 2026-09-30 报的
|
|
1399
|
+
// "插件里点桌面打开的 exe 显示不出宠物,直接双击倒是能出"就是这个)。
|
|
1400
|
+
// 所以**同时看 `Host` 头** —— 自定义协议下应用会把请求转给本地服务,Host 才是真的。
|
|
1395
1401
|
const origin = request.headers?.origin
|
|
1396
1402
|
if (typeof origin === 'string') display.setDshUrl(origin)
|
|
1403
|
+
const host = request.headers?.host
|
|
1404
|
+
if (typeof host === 'string' && /^[\w.\-]+(:\d+)?$/.test(host)) {
|
|
1405
|
+
display.setDshUrl('http://' + host)
|
|
1406
|
+
}
|
|
1397
1407
|
// 每次读状态都顺手 reconcile 一次:设置页点完马上能看到结果,不用等下一个 tick。
|
|
1398
1408
|
const status = display.reconcile()
|
|
1399
1409
|
sendJson(response, 200, {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "dsh-pet-live2d",
|
|
3
|
-
"version": "3.1.
|
|
3
|
+
"version": "3.1.3",
|
|
4
4
|
"description": "Live2D 桌宠插件:为 DSH Web GUI 挂一只可拖动、会跟随鼠标、能换动作与表情的 Live2D 宠物。",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "lib/index.js",
|
|
@@ -49,8 +49,8 @@
|
|
|
49
49
|
}
|
|
50
50
|
},
|
|
51
51
|
"optionalDependencies": {
|
|
52
|
-
"dsh-pet-live2d-desktop-darwin-arm64": "3.1.
|
|
53
|
-
"dsh-pet-live2d-desktop-win32-x64": "3.1.
|
|
52
|
+
"dsh-pet-live2d-desktop-darwin-arm64": "3.1.3",
|
|
53
|
+
"dsh-pet-live2d-desktop-win32-x64": "3.1.3"
|
|
54
54
|
},
|
|
55
55
|
"devDependencies": {
|
|
56
56
|
"esbuild": "^0.25.10",
|