Files
OwnCord/Client/tauri-client/src-tauri/capabilities/default.json
T
J3vbandClaude Opus 4.8 f3c6745c0b feat(client): add single-instance/autostart/deep-link; move window-state to plugin
Replace hand-rolled code with first-party Tauri v2 plugins where a plugin can
do the job, and add the genuine gaps:

- single-instance: focus the running window on a second launch instead of
  opening a duplicate (two WS connections / tray icons). Registered first;
  built with the "deep-link" feature so owncord:// links reach the running app.
- window-state: replace the hand-rolled save/restore plumbing with
  tauri-plugin-window-state. Keep only the one thing the plugin lacks — an
  off-screen re-center guard for windows restored onto a now-disconnected
  monitor (isRectOnScreen).
- autostart: "Launch on Login" toggle in Advanced settings, reading/writing
  real OS state via tauri-plugin-autostart (not a stored preference).
- deep-link: register the owncord:// scheme and route invite links into the
  register form. OwnCord invites are registration invites, so a link pre-fills
  and opens the form rather than completing a one-click join.

Intentionally NOT replaced: push-to-talk (ptt.rs) stays hand-rolled —
tauri-plugin-global-shortcut registers OS hotkeys that grab the key
system-wide (RegisterHotKey / XGrabKey), which cannot express non-consuming
press-and-hold PTT. Clipboard stays on the native Web API (no custom code).

Verified: tsc, eslint, prettier, 3369 unit tests, cargo check, cargo clippy
(client code clean; one pre-existing needless-borrow lint in commands.rs is
flagged only by newer local clippy, untouched here).

Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
2026-07-24 10:44:06 +02:00

130 lines
2.9 KiB
JSON

{
"identifier": "default",
"description": "Default capability granting core permissions to the main window. NOTE: http:allow-fetch is the ONLY URL-scoped HTTP identifier — tauri-plugin-http validates the URL once, in the `fetch` command; `fetch_send` and `fetch_read_body` take an already-validated ResourceId and never consult a scope, so allow/deny blocks on those identifiers are inert. Do not re-add them.",
"windows": [
"main"
],
"permissions": [
"core:default",
"core:event:default",
"core:window:default",
"core:window:allow-show",
"core:window:allow-hide",
"core:window:allow-set-focus",
"core:window:allow-is-visible",
"core:window:allow-set-position",
"core:window:allow-set-size",
"core:window:allow-maximize",
"core:window:allow-is-maximized",
"core:window:allow-is-minimized",
"core:window:allow-outer-position",
"core:window:allow-outer-size",
"core:window:allow-available-monitors",
"core:window:allow-center",
"notification:default",
"notification:allow-notify",
"notification:allow-request-permission",
"notification:allow-is-permission-granted",
{
"identifier": "http:allow-fetch",
"allow": [
{
"url": "https://*:*"
},
{
"url": "https://*"
},
{
"url": "http://127.0.0.1:*"
}
],
"deny": [
{
"url": "https://localhost"
},
{
"url": "https://localhost:*"
},
{
"url": "https://127.0.0.1"
},
{
"url": "https://127.0.0.1:*"
}
]
},
"http:allow-fetch-send",
"http:allow-fetch-read-body",
"http:allow-fetch-cancel",
"opener:default",
"dialog:default",
"process:allow-restart",
"window-state:default",
"autostart:allow-enable",
"autostart:allow-disable",
"autostart:allow-is-enabled",
"deep-link:default",
"deep-link:allow-register",
"fs:default",
{
"identifier": "fs:allow-write-file",
"allow": [
{
"path": "$APPDATA/**"
},
{
"path": "$APPLOG/**"
}
]
},
{
"identifier": "fs:allow-write-text-file",
"allow": [
{
"path": "$APPLOG/**"
}
]
},
{
"identifier": "fs:allow-mkdir",
"allow": [
{
"path": "$APPLOG/**"
}
]
},
{
"identifier": "fs:allow-exists",
"allow": [
{
"path": "$APPLOG/**"
}
]
},
{
"identifier": "fs:allow-read-dir",
"allow": [
{
"path": "$APPLOG/**"
}
]
},
{
"identifier": "fs:allow-remove",
"allow": [
{
"path": "$APPLOG/**"
}
]
},
{
"identifier": "fs:allow-read-text-file",
"allow": [
{
"path": "$APPLOG/**"
}
]
}
]
}