Bug 238369
Summary: | navigator.share does not trigger TypeError even if the url is invalid. | ||
---|---|---|---|
Product: | WebKit | Reporter: | Takao Baba <baba> |
Component: | Platform | Assignee: | Nobody <webkit-unassigned> |
Status: | NEW | ||
Severity: | Normal | CC: | thorton, webkit-bug-importer |
Priority: | P2 | Keywords: | InRadar |
Version: | Safari 15 | ||
Hardware: | Unspecified | ||
OS: | Unspecified |
Takao Baba
# 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).
Attachments | ||
---|---|---|
Add attachment proposed patch, testcase, etc. |
Radar WebKit Bug Importer
<rdar://problem/90919392>