• Robert Knight's avatar
    Fix annotations made on PDFs in non-Safari browsers not appearing in Safari (#3494) · 134ca864
    Robert Knight authored
    In Safari a trailing '#' is appended to URIs extracted from web
    documents and PDFs. For URLs this makes no difference as the Hypothesis
    search API ignores the fragment identifier. However a URN with a
    trailing '#' is considered different from a URN without a trailing '#'.
    Since the URI for PDFs is now a URN of the form 'urn:x-pdf:...', when
    viewing a PDF in Safari annotations made in other browsers were not
    fetched and vice-versa.
    
    The trailing '#' is caused by a bug in the `URL.hash` setter in Safari.
    
    According to section 6.3 of the URL spec [1], setting URL.hash to an empty
    string should _remove_ the fragment identifier. In Safari however, it
    sets the fragment identifier to an empty string. The result is that when
    the URL is serialized, the output is eg. 'urn:x-pdf:aabb#' instead of
    'urn:x-pdf:aabb'.
    
    Upstream bug: https://bugs.webkit.org/show_bug.cgi?id=158869
    Fixes #3471
    
    [1] https://url.spec.whatwg.org/#urlutils-members
    134ca864
Name
Last commit
Last update
..
anchoring Loading commit data...
plugin Loading commit data...
test Loading commit data...
adder.html Loading commit data...
adder.js Loading commit data...
config.js Loading commit data...
guest.coffee Loading commit data...
highlighter.coffee Loading commit data...
host.coffee Loading commit data...
main.js Loading commit data...
pdf-sidebar.coffee Loading commit data...
range-util.js Loading commit data...
selections.js Loading commit data...
sidebar.coffee Loading commit data...