[Webkit-unassigned] [Bug 250317] New: Fragment identifiers should be applied to canonical URL when sharing, bookmarking

bugzilla-daemon at webkit.org bugzilla-daemon at webkit.org
Mon Jan 9 04:59:18 PST 2023


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

            Bug ID: 250317
           Summary: Fragment identifiers should be applied to canonical
                    URL when sharing, bookmarking
           Product: WebKit
           Version: Safari 16
          Hardware: Unspecified
                OS: Unspecified
            Status: NEW
          Severity: Normal
          Priority: P2
         Component: New Bugs
          Assignee: webkit-unassigned at lists.webkit.org
          Reporter: dan at moqups.com

In iOS Safari, sharing or bookmarking a web page that for which there exists a Canonical Link, generally defined via the <link rel='canonical' href='...'> HTML element, the canonical URL is used instead of the actual URL. Whether or not using the canonical URL for these purposes is appropriate is beyond the scope of this report, as there are benefits, drawbacks and limitations to the approach, and no straightforward alternative I'm aware of. 

Since fragment identifiers are a client-only feature that is reproduced in the canonical URL, any page defining a <link rel='canonical'> effectively prevents iOS Safari users from sharing links that point to specific elements (#id) or text (#:~:text=), as these gets stripped from the shared URL.

The issue affects a vast proportion of websites (more than half of pages analyzed according to HTTP Archive's Web Almanac 2022), e.g.:

https://en.wikipedia.org/wiki/Canonical_link_element#Examples

Behavior of other mobile browsers:

* Firefox Android: shares original URL
* Samsung Internet: shares original URL
* Chrome Android: shares canonical URL, but maintains fragment identifiers

iOS Safari should at least transfer the fragment identifiers to the canonical URL before sharing/bookmarking.

-- 
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/20230109/01f4e91f/attachment-0001.htm>


More information about the webkit-unassigned mailing list