Bug 238369

Summary: navigator.share does not trigger TypeError even if the url is invalid.
Product: WebKit Reporter: Takao Baba <baba>
Component: PlatformAssignee: Nobody <webkit-unassigned>
Status: NEW ---    
Severity: Normal CC: thorton, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: Safari 15   
Hardware: Unspecified   
OS: Unspecified   

Description Takao Baba 2022-03-25 04:02:15 PDT
# Steps to reproduce:

1. Open https://jsbin.com/yevuhebadu/edit?html,js,output
2. Click "share" button

# Expected behavior:

"TypeError: Failed to execute 'share' on 'Navigator': Invalid URL" should be shown.

As the spec described in here (https://w3c.github.io/web-share/#share-method https://w3c.github.io/web-share/#dfn-validate-share-data), if the "url" is present and it is invalid, "validate share data" must return false. Thus, "share()" should return a promise rejected with a TypeError.

# Actual behavior:

Sharing succeeded with text "foo". The invalid URL was just ignored.

# Note

Chrome 99 works correctly (returns TypeError). I've confirmed this issue on Safari (15.4 on mac and 14.7 on iPad).
Comment 1 Radar WebKit Bug Importer 2022-03-28 06:40:47 PDT
<rdar://problem/90919392>