295a588988
Adds a `share` flag and `sharePosition` to `saveFile` across the app
services. On iOS/Android/macOS/Windows the annotation export now calls
the sharekit `shareFile` (writing the markdown/txt to `$TEMP` first when
no `filePath` is provided), so users get the system "Share via…" sheet
that drops the export into Mail, Notes, Messages, etc. Linux desktop
keeps the existing save dialog, since sharekit has no Linux backend.
On the web, `saveFile` now prefers `navigator.share({ files })` when the
browser advertises support via `canShare`. AbortError (user dismissed)
is treated as a deliberate "don't share" choice; any other rejection
(e.g., Chrome desktop's `NotAllowedError` despite a positive `canShare`)
falls through to the `<a download>` fallback so a save still happens.
Also fixes the macOS share popover anchoring: `preferredEdge: 'top'`
maps to `NSMaxYEdge`, which is the rect's bottom edge in WKWebView's
flipped coords, so the picker rendered below the trigger button. The
annotations export only got away with it because its dialog has no room
below — macOS auto-flipped above. Switching to `preferredEdge: 'bottom'`
(`NSMinYEdge` → top edge in flipped coords) anchors the popover above
the button consistently. Adds `$TEMP/**/*` to the Tauri fs capabilities
so the writable temp share file is permitted.
Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
205 lines
4.5 KiB
JSON
205 lines
4.5 KiB
JSON
{
|
|
"$schema": "../gen/schemas/desktop-schema.json",
|
|
"identifier": "default",
|
|
"description": "enables the default permissions",
|
|
"windows": ["main", "updater", "reader-*"],
|
|
"permissions": [
|
|
"core:default",
|
|
"fs:default",
|
|
"fs:read-meta",
|
|
"fs:allow-open",
|
|
"fs:allow-write",
|
|
"fs:allow-read",
|
|
"fs:allow-rename",
|
|
"fs:allow-mkdir",
|
|
"fs:allow-remove",
|
|
"fs:allow-stat",
|
|
"fs:allow-fstat",
|
|
"fs:allow-lstat",
|
|
{
|
|
"identifier": "fs:scope-appconfig-recursive",
|
|
"allow": [
|
|
{
|
|
"path": "$APPCONFIG"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"identifier": "fs:scope-appdata-recursive",
|
|
"allow": [
|
|
{
|
|
"path": "$APPDATA/Readest/**/*"
|
|
}
|
|
],
|
|
"deny": []
|
|
},
|
|
{
|
|
"identifier": "fs:allow-appdata-read",
|
|
"allow": [
|
|
{
|
|
"path": "$APPDATA/settings.json"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"identifier": "fs:allow-appdata-write",
|
|
"allow": [
|
|
{
|
|
"path": "$APPDATA/settings.json"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"identifier": "fs:allow-cache-read",
|
|
"allow": [
|
|
{
|
|
"path": "$APPCACHE/**/*"
|
|
},
|
|
{
|
|
"path": "/private/var/mobile/Containers/Data/Application/**/*"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"identifier": "fs:allow-cache-write",
|
|
"allow": [
|
|
{
|
|
"path": "$APPCACHE/**/*"
|
|
},
|
|
{
|
|
"path": "/private/var/mobile/Containers/Data/Application/**/*"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"identifier": "fs:scope",
|
|
"allow": [
|
|
{
|
|
"path": "**/Readest"
|
|
},
|
|
{
|
|
"path": "**/Readest/**/*"
|
|
},
|
|
{
|
|
"path": "**/com.github.johnfactotum.Foliate/**/*"
|
|
},
|
|
{
|
|
"path": "**/last-book-cover.png"
|
|
},
|
|
{
|
|
"path": "$TEMP/**/*"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"identifier": "http:default",
|
|
"allow": [
|
|
{
|
|
"url": "https://*.readest.com"
|
|
},
|
|
{
|
|
"url": "https://github.com/readest/*"
|
|
},
|
|
{
|
|
"url": "https://*.deepl.com"
|
|
},
|
|
{
|
|
"url": "https://*.cloudflarestorage.com"
|
|
},
|
|
{
|
|
"url": "https://edge.microsoft.com"
|
|
},
|
|
{
|
|
"url": "https://translate.toil.cc"
|
|
},
|
|
{
|
|
"url": "https://*.microsofttranslator.com"
|
|
},
|
|
{
|
|
"url": "https://translate.googleapis.com"
|
|
},
|
|
{
|
|
"url": "http://*:*"
|
|
},
|
|
{
|
|
"url": "https://*:*"
|
|
},
|
|
{
|
|
"url": "http://*"
|
|
},
|
|
{
|
|
"url": "https://*"
|
|
}
|
|
]
|
|
},
|
|
"websocket:default",
|
|
"dialog:default",
|
|
"os:default",
|
|
"core:window:default",
|
|
"core:window:allow-close",
|
|
"core:window:allow-center",
|
|
"core:window:allow-show",
|
|
"core:window:allow-minimize",
|
|
"core:window:allow-unminimize",
|
|
"core:window:allow-maximize",
|
|
"core:window:allow-unmaximize",
|
|
"core:window:allow-set-size",
|
|
"core:window:allow-set-focus",
|
|
"core:window:allow-is-maximized",
|
|
"core:window:allow-start-dragging",
|
|
"core:window:allow-toggle-maximize",
|
|
"core:window:allow-set-fullscreen",
|
|
"core:window:allow-set-always-on-top",
|
|
"core:window:allow-destroy",
|
|
"core:webview:allow-create-webview-window",
|
|
"core:path:allow-resolve-directory",
|
|
"log:default",
|
|
"shell:default",
|
|
"process:default",
|
|
"process:allow-exit",
|
|
"process:allow-restart",
|
|
"oauth:allow-start",
|
|
"oauth:allow-cancel",
|
|
"sign-in-with-apple:default",
|
|
"opener:default",
|
|
{
|
|
"identifier": "opener:allow-open-url",
|
|
"allow": [
|
|
{
|
|
"url": "alipays:*"
|
|
}
|
|
]
|
|
},
|
|
{
|
|
"identifier": "shell:allow-spawn",
|
|
"allow": [
|
|
{
|
|
"name": "start-readest",
|
|
"cmd": "cmd",
|
|
"args": ["/C", "start", "", { "validator": "^.*Readest(.*)\\.exe$" }]
|
|
},
|
|
{
|
|
"name": "chmod-appimage",
|
|
"cmd": "chmod",
|
|
"args": ["+x", { "validator": "^.*Readest(.*)\\.AppImage$" }]
|
|
},
|
|
{
|
|
"name": "launch-appimage",
|
|
"cmd": "setsid",
|
|
"args": [{ "validator": "^.*Readest(.*)\\.AppImage$" }]
|
|
}
|
|
]
|
|
},
|
|
"haptics:allow-vibrate",
|
|
"haptics:allow-impact-feedback",
|
|
"haptics:allow-notification-feedback",
|
|
"haptics:allow-selection-feedback",
|
|
"deep-link:default",
|
|
"sharekit:default",
|
|
"device-info:default",
|
|
"turso:default",
|
|
"native-tts:default",
|
|
"native-bridge:default"
|
|
]
|
|
}
|