Skip to Content
Platform.Ontology

Scroll to text fragment

Highlights and scrolls to quoted text in a page when a link includes #:~:text=.

Does something on your deviceThings a page can doWindows and navigationWeb browsersWhile you use it

In one line

Can scroll to and highlight text on a page when you open a special link

Highlights and scrolls to quoted text in a page when a link includes #:~:text=.

A link can point at one sentence on any page. The browser, not the page, does the highlighting, and the page cannot see the fragment, so it cannot learn what the visitor was searching for.

What it can and can't do

What the user does: You tap a link that ends with a text highlight, like a link shared from search results.

It can

  • Jump to quoted text on the page and highlight it
  • Open from a link that someone shared with you
  • Show a short highlight in yellow

It cannot

  • Let the page's own code see which text was highlighted
  • Highlight text that is not on the page
  • Highlight text inside embedded frames in most cases
  • Run without you opening that link

Browser support

BrowserStatusFirst versionReleasedNote
ChromeSupported812020-04-07None
EdgeSupported832020-05-21None
FirefoxSupported1312024-10-01None
SafariSupported18.42025-03-31None
Safari on iPhoneSupported18.42025-03-31All iOS browsers use WebKit
Chrome on AndroidSupported812020-04-07None
Samsung InternetSupported13.02020-12-02None

How a site asks for it

APIhttps://example.com/#:~:text=start,end; document.fragmentDirective; ::target-text
Browser compat keysapi.FragmentDirective
css.selectors.target-text
How access is grantednone
What the user seesNone (no browser prompt)
Needs a secure context (HTTPS)No
Needs a user gestureNo
Activationnone
How long it lastsOne-shot per navigation
How to take it backNothing to revoke (no permission is stored)
Inside an iframeOnly full navigations in top-level browsing contexts

Typical flow

  1. Person opens a link with a text directive
  2. Browser finds the first match and scrolls
  3. Highlight is drawn by the browser

Data you get

Shape: none

No individual data fields. The signal is the access itself.

Technical limits

  • Needs user activation or browser-initiated navigation (search results, address bar)
  • Page script cannot read the directive (stripped from location.hash and document.fragmentDirective is empty)
  • Matches visible text only, word boundary aware, first match wins
  • Cross-origin initiated navigations need noopener; not applied in iframes
  • Can be disabled by Document-Policy: force-load-at-top

The story

What it is

A link can highlight and scroll to exact words on a page.

For you

You tap a link and the page jumps to a highlighted sentence. Search results use it so you land on the answer, not the top of the page.

For makers

Makers and search engines use it to send people to the exact passage. Google search snippets use it and some sharing tools make quote links with it.

Where you see it

TypeExampleApps
newsA search result links to the exact sentence that answers your question.Google Search
socialA reader copies a link to a quote from an article and sends it to a friend.Chrome, Edge
educationA teacher links students to the exact definition inside a long page.Wikipedia
productivityA research tool saves quotes as links back to the highlighted text.None named
adsA site may use it to find out whether specific words exist on a page.None named
developerA docs site links straight to the line about a function.MDN

Risks

  • Probing page text
  • Misleading highlights

What the platform says

Good uses and abuse

Legitimate uses

  • Search engine deep links
  • Shareable quotes

Known abuse

  • Probing page contents with crafted links (mitigated by activation, no readable fragment)

Scores

ScoreValueMeaning
Sensitivity1 of 5How revealing the data is
Utility3 of 5How useful it is to honest apps
Friction0 of 5How much the user has to do
Fingerprint bitsNot ratedRough identifying entropy, when known

History

  • 2020-02, Chrome 80: Scroll to Text Fragment ships
  • 2022-10, Safari 16.1: Text fragment support
  • 2024-10, Firefox 131: Text fragment support ships

Sources

How well checked: Based on official documentation.

On this page