Share works in the iOS app on an episode of a private feed (#452)

With no ipx-play link (a private feed, or no ipx-play set up), Share fell
back to the share sheet after the request for the link, which WebKit
refuses once an await has come between the press and it, and a Patreon
address went through confirm() first, which the iOS app answers Cancel
without showing anything (#453). Taps sent the request and nothing
appeared. That address now goes through the same menu as an ipx-play
link, so the sheet opens from a press of its own, and the warning about
an address that carries your access is written in the menu.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
2026-11-13 16:57:25 +00:00
parent c133adf398
commit b3636e648f
4 changed files with 39 additions and 19 deletions

View File

@@ -212,9 +212,17 @@ async function copyText(text: string,btn?: HTMLElement){
/// ponytail: a guess from the address. A private feed whose key has another name is shared
/// without asking; add its pattern here when one turns up.
async function share(title: string, url: string, btn?: HTMLElement){
if(/patreon\.com\/|\/\/[^/]*@|[?&][^=]*(auth|token|key|secret|pass|sig)[^=]*=/i.test(url)
&& !confirm('This address looks like it includes your own access to the feed, and anyone you '
+'send it to could use it as you.\n\nShare it anyway?')) return;
if(carriesAccess(url) && !confirm(ACCESS_WARNING+'\n\nShare it anyway?')) return;
await sendLink(title, url, btn);
}
const carriesAccess=(url: string)=>/patreon\.com\/|\/\/[^/]*@|[?&][^=]*(auth|token|key|secret|pass|sig)[^=]*=/i.test(url);
const ACCESS_WARNING='This address looks like it includes your own access to the feed, and anyone you '
+'send it to could use it as you.';
/// The share sheet or the clipboard, asking nothing. Call it straight from a press: WebKit refuses
/// the sheet once an await has come between the press and it (#452).
async function sendLink(title: string, url: string, btn?: HTMLElement){
if(navigator.share){
// Cancelling the sheet rejects too, and is not a failure worth a word.
try{ await navigator.share({title, url}); }