[Webkit-unassigned] [Bug 238369] New: navigator.share does not trigger TypeError even if the url is invalid.

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Fri Mar 25 04:02:15 PDT 2022


https://bugs.webkit.org/show_bug.cgi?id=238369

            Bug ID: 238369
           Summary: navigator.share does not trigger TypeError even if the
                    url is invalid.
           Product: WebKit
           Version: Safari 15
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: Platform
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: baba at bpsinc.jp

# 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).

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.webkit.org/pipermail/webkit-unassigned/attachments/20220325/7a25efd2/attachment-0001.htm>


More information about the webkit-unassigned mailing list