Topic summary
Hash-bang Fragment

Extracted from the Wikipedia article URI fragment.
Proposals
- As of September 2012 the Media Fragments URI 1.0 (basic) is a W3C Recommendation.
- Chrome versions 80 and above and Firefox versions 131 and above implement W3C's WICGText Fragments, so
#:~:text=foowill cause the browser to search forfoo, highlight the matching text, and scroll to it. Besides the start and end, the snippet can also specify a context: text that must precede or followfoobut will not be highlighted (example that uses#:~:text=night-,visionto find 'vision' preceded by 'night'). - The Python Package Index appends the MD5 hash of a file to the URL as a fragment identifier. If MD5 were unbroken (it is a ), it could be used to ensure the integrity of the package.
https://pypi.python.org ... zodbbrowser-0.3.1.tar.gz#md5=38dc89f294b24691d3f0d893ed3c119c
- A hash-bang fragment is a fragment starting with an exclamation mark
!. It was used in a now-deprecated approach to index dynamic single-page applications. An exclamation mark is illegal in HTML4, XHTML, and XML identifiers, granting certain degree of separation from that functionality. However, it is allowed in HTML5.- Between 2009 and 2015, Google Webmaster Central proposed and then recommended an "AJAX crawling scheme" using an initial exclamation mark in fragment identifiers for stateful AJAX pages:
http://example.com/page?query#!state - Another implementation has been the replacement of
#!with?_escaped_fragment_= - Hash-bang URIs have been considered problematic by a number of writers including Jeni Tennison at the W3C because they make pages inaccessible to those who do not have JavaScript activated in their browser. They also break HTTP referer headers as browsers are not allowed to send the fragment identifier in the Referer header.
- In 2015, Google deprecated their hash-bang AJAX crawling proposal, recommending instead the use of progressive enhancement and HTML5's
history.pushState()method. - Mozilla Foundation employee Gervase Markham has proposed a fragment identifier for searching, of the form
#!s!search terms. Adding a number after the s (#!s10!) indicates that the browser should search for the nth occurrence of the search term. A negative number (#!s-3!) starts searching backwards from the end of the document. A Greasemonkey script is available to add this functionality to compatible browsers.http://example.com/index.html#!s3!search terms
- Between 2009 and 2015, Google Webmaster Central proposed and then recommended an "AJAX crawling scheme" using an initial exclamation mark in fragment identifiers for stateful AJAX pages: