You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Thanks for reporting! I am aware of this issue, but not sure how to handle it. Could wrap it in a try/catch but since I think it's a promise in of itself we could use a .then() and a .catch() to catch the error and surface console information for debugging:
window.navigator.share({title: root.title,text: root.title+"\n"+window.location.href}).then(()=>alert('The page was shared')).catch((e)=>console.log(e))
Describe the bug
When closing a share dialog without selecting an option an exception is thrown in Safari.
Screenshots
![Screen Shot 2023-12-19 at 11 08 24 AM](https://private-user-images.githubusercontent.com/16600959/291645476-8a2ab367-977a-45b7-a226-a26de2ac038d.png?jwt=eyJhbGciOiJIUzI1NiIsInR5cCI6IkpXVCJ9.eyJpc3MiOiJnaXRodWIuY29tIiwiYXVkIjoicmF3LmdpdGh1YnVzZXJjb250ZW50LmNvbSIsImtleSI6ImtleTUiLCJleHAiOjE3MjAxNzk4MTMsIm5iZiI6MTcyMDE3OTUxMywicGF0aCI6Ii8xNjYwMDk1OS8yOTE2NDU0NzYtOGEyYWIzNjctOTc3YS00NWI3LWEyMjYtYTI2ZGUyYWMwMzhkLnBuZz9YLUFtei1BbGdvcml0aG09QVdTNC1ITUFDLVNIQTI1NiZYLUFtei1DcmVkZW50aWFsPUFLSUFWQ09EWUxTQTUzUFFLNFpBJTJGMjAyNDA3MDUlMkZ1cy1lYXN0LTElMkZzMyUyRmF3czRfcmVxdWVzdCZYLUFtei1EYXRlPTIwMjQwNzA1VDExMzgzM1omWC1BbXotRXhwaXJlcz0zMDAmWC1BbXotU2lnbmF0dXJlPTQ2Y2UxMzdhMzgyNDJhN2VmMzM5YjA4YTVkYmVjOTkxZTMxYTVkZTk3NGFjMDg0OTcyOTM3NzBmNTY2YTQzNmMmWC1BbXotU2lnbmVkSGVhZGVycz1ob3N0JmFjdG9yX2lkPTAma2V5X2lkPTAmcmVwb19pZD0wIn0.1iUDrwaaletL9dwhwTUIgCQ5P88jbiR12QQ4CjcLLV8)
Desktop (please complete the following information):
Additional context
Possibly wrapping
navigator.share
in atry/catch
could avoid the issue. Untested.See this SO thread:
https://stackoverflow.com/questions/60510383/web-share-api-navigator-share-problem-when-canceling-share-dialog-ios-and-androi
The text was updated successfully, but these errors were encountered: