feat: Implement VRChat protocol handling for macOS

This commit is contained in:
2026-06-29 01:46:24 +07:00
parent 42db5d9946
commit 716fb82ae1
12 changed files with 126 additions and 32 deletions
+14
View File
@@ -41,6 +41,16 @@ function screenshotState(): EnhancementState {
function protocolState(): EnhancementState {
const s = protocol.status();
// isDefaultProtocolClient stays true after disabling on macOS/Windows; trust the pref instead
if (platform() !== "linux") {
const pref = readPrefs()["vrchat-protocol-handler"];
const enabled = pref ?? s.registered;
return {
id: "vrchat-protocol-handler",
enabled,
detail: { key: enabled ? "registered" : "notRegistered" },
};
}
return { id: "vrchat-protocol-handler", enabled: s.registered, detail: s.detail };
}
@@ -48,6 +58,10 @@ export function snapshot(): EnhancementsSnapshot {
return { platform: platform(), states: [screenshotState(), protocolState()] };
}
export function isEnabled(id: EnhancementId): boolean {
return readPrefs()[id] ?? false;
}
export async function setEnabled(
id: EnhancementId,
enabled: boolean,