beauticode-dsh 1.0.27 → 1.0.28
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/README.zh-CN.md +2 -0
- package/client.js +0 -46
- package/package.json +1 -1
package/README.zh-CN.md
CHANGED
|
@@ -2,6 +2,8 @@
|
|
|
2
2
|
|
|
3
3
|
该 Cordis 插件向 DSH Web 和官方 Desktop 注入 beautiCode 浏览器客户端,并提供本机鉴权接口。支持图片、MP4 / MOV、播放位置、静音、摸鱼模式以及清除背景。Web 和 Desktop 使用同一组结构化页面注入;Desktop 的页面请求经原生壳转发,回执由每次 Host 启动生成的页面密钥验证。
|
|
4
4
|
|
|
5
|
+
DSH Web 和 Desktop 启动及普通点击不会自动进入全屏。需要全屏时,在「设置 → 背景 → 全屏显示」中主动开启,按 `Esc` 或点击「退出全屏」退出。
|
|
6
|
+
|
|
5
7
|
## 官方 Desktop
|
|
6
8
|
|
|
7
9
|
先启动 Desktop 一次,让它创建 `desktop` profile,然后从系统托盘明确退出(关闭窗口通常只会隐藏)。可在 Desktop 的插件页面安装 `beauticode-dsh`,或使用 **Desktop 安装的** `dsh` 命令:
|
package/client.js
CHANGED
|
@@ -1861,50 +1861,4 @@ html[data-bc-fish="true"] #root{opacity:0!important;visibility:hidden!important;
|
|
|
1861
1861
|
}).catch(() => {});
|
|
1862
1862
|
}
|
|
1863
1863
|
}, 1_000);
|
|
1864
|
-
|
|
1865
|
-
// Fullscreen by default. A browser only grants fullscreen from inside a user
|
|
1866
|
-
// gesture, so a page cannot open in it; the closest honest reading of
|
|
1867
|
-
// "starts fullscreen" is the first click after load. Typing in the composer
|
|
1868
|
-
// must not count: DSH's main action is a keydown. Escape or the settings row
|
|
1869
|
-
// still exits. Stay armed until the request actually succeeds — a rejected
|
|
1870
|
-
// first gesture used to spend the listener and leave the page windowed.
|
|
1871
|
-
function armFullscreenDefault() {
|
|
1872
|
-
const root = document.documentElement;
|
|
1873
|
-
if (typeof root?.requestFullscreen !== "function" &&
|
|
1874
|
-
typeof root?.webkitRequestFullscreen !== "function") {
|
|
1875
|
-
return;
|
|
1876
|
-
}
|
|
1877
|
-
let spent = false;
|
|
1878
|
-
const enter = () => {
|
|
1879
|
-
if (spent) return;
|
|
1880
|
-
if (document.fullscreenElement || document.webkitFullscreenElement) {
|
|
1881
|
-
spent = true;
|
|
1882
|
-
document.removeEventListener?.("pointerdown", enter, true);
|
|
1883
|
-
return;
|
|
1884
|
-
}
|
|
1885
|
-
for (const name of ["requestFullscreen", "webkitRequestFullscreen"]) {
|
|
1886
|
-
const request = root?.[name];
|
|
1887
|
-
if (typeof request !== "function") continue;
|
|
1888
|
-
let started;
|
|
1889
|
-
try {
|
|
1890
|
-
started = request.call(root, { navigationUI: "hide" });
|
|
1891
|
-
} catch {
|
|
1892
|
-
continue;
|
|
1893
|
-
}
|
|
1894
|
-
Promise.resolve(started).then(
|
|
1895
|
-
() => {
|
|
1896
|
-
spent = true;
|
|
1897
|
-
document.removeEventListener?.("pointerdown", enter, true);
|
|
1898
|
-
},
|
|
1899
|
-
() => {
|
|
1900
|
-
/* gesture rejected — stay armed for the next click */
|
|
1901
|
-
},
|
|
1902
|
-
);
|
|
1903
|
-
return;
|
|
1904
|
-
}
|
|
1905
|
-
};
|
|
1906
|
-
document.addEventListener?.("pointerdown", enter, { capture: true });
|
|
1907
|
-
}
|
|
1908
|
-
|
|
1909
|
-
armFullscreenDefault();
|
|
1910
1864
|
})();
|