I've noticed some web URLs link to a web page with highlighted text. This appears to be controlled by an escape sequence in the URL of the form #:~:text=StartText,EndText
, where StartText
indicates where on the page to begin the highlighting and EndText
is where on the page to terminate the highlighting.
Examples
- https://www.addictivetips.com/internet-tips/select-to-highlight-text-on-web-pages-share-via-url-chrome/#:~:text=Highlighter%20Pen%20For%20Web,paste%20to%20emails%20and%20chat
- https://en.wikipedia.org/wiki/Intraclass_correlation#:~:text=In%20statistics%2C%20the%20intraclass%20correlation,same%20group%20resemble%20each%20other.
I've seen query strings and named anchors/fragments in URLs (as per standard URL syntax), but I've never seen escape sequences in URLs -- certainly not like this.
What API/standard/protocol/etc. defines/permits/governs this highlighting behavior?
Bonus points for addressing how portable this is. (It works on Google Chrome, but doesn't work in Apple's Safari for macOS.)