chore(desktop): 跟踪 apps/desktop/dist 静态资源并统一文档与忽略规则

This commit is contained in:
agent
2026-04-14 19:23:45 +08:00
parent 763d99b15e
commit 328962706b
8 changed files with 2418 additions and 5 deletions

41
apps/desktop/dist/disable-features.js vendored Normal file
View File

@@ -0,0 +1,41 @@
(() => {
const tauriInvoke = window.__TAURI_INTERNALS__?.invoke;
// Disable text selection globally, but keep inputs editable.
document.addEventListener("selectstart", (event) => {
const target = event.target;
if (target instanceof HTMLInputElement || target instanceof HTMLTextAreaElement) {
return;
}
event.preventDefault();
});
async function applyProductionGuards() {
if (!tauriInvoke) {
return;
}
let isDebugBuild = false;
try {
isDebugBuild = await tauriInvoke("is_debug_build");
} catch {
return;
}
if (isDebugBuild) {
return;
}
document.addEventListener("contextmenu", (event) => event.preventDefault());
document.addEventListener("keydown", (event) => {
if (event.key === "F12") {
event.preventDefault();
}
if ((event.ctrlKey || event.metaKey) && event.shiftKey && ["I", "C", "J"].includes(event.key.toUpperCase())) {
event.preventDefault();
}
});
}
void applyProductionGuards();
})();