Select & Save Icon
Select & SaveCHROME EXTENSION
← Back to BlogWeb Technology4 min read

Why You Keep Losing Web Highlights (And How Deep-Link Text Directives Fix It)

Select & Save Logo
Select & Save Web Standards Team
Published on 2026-08-07

We have all experienced this frustration:

You read an insightful 5,000-word essay online and copy a single paragraph into your notes app alongside the article URL. Months later, you reopen the link to review the surrounding context, only to be landed at the top of a massive page filled with popups, sidebars, and infinite scrolling content.

You hit Ctrl + F, type keywords from memory, and spend minutes searching for the original passage.

Why do standard links fail to preserve exact reading locations, and how do modern web standards solve this issue?


The Problem with Standard Web Anchors (#element-id)

Historically, linking to a specific section of a webpage required an explicit HTML anchor tag:

<!-- Requires the author to explicitly add an ID -->
<h2 id="section-performance">Performance Benchmarks</h2>

If the author forgot to add an id attribute, or if the website content updated its layout, linking directly to a paragraph was impossible.


Enter W3C Text Fragment Directives

Modern web browsers like Chrome and Edge introduced standard support for Text Fragments (also known as #:~:text=).

Text fragments allow URLs to specify exact start and end text words to highlight on load, without requiring HTML element IDs:

https://example.com/article#`:~:text=start_text,end_text`

When a browser navigates to a URL containing a text fragment directive:

  1. It automatically searches the DOM for matching text.
  2. It scrolls the window down to bring the paragraph into view.
  3. It applies a temporary yellow background highlight over the target text.

How Select & Save Implements Resilient Deep-Link Navigation

While standard browser text fragments are powerful, they have limitations: web applications that render content dynamically via client-side JavaScript (like React or Vue) often load text after the browser's initial fragment highlight phase has completed.

To solve this, Select & Save implements a custom dual-layer deep-linking algorithm:

// Constructing resilient deep link with query parameters & fragment fallbacks
export function buildHighlightedUrl(url?: string, content?: string): string {
  if (!url || !content) return url || '';
  const words = stripHtml(content).split(' ').filter(Boolean);
  const startText = words.slice(0, 4).join(' ');
  const endText = words.slice(-4).join(' ');
  
  const urlObj = new URL(url);
  urlObj.searchParams.set('select_and_save_text', startText);
  if (endText) urlObj.searchParams.set('select_and_save_end', endText);
  
  return urlObj.toString();
}

Dual-Layer Restoration Process:

  1. Browser Native Scroll: Select & Save attempts standard browser text fragment navigation.
  2. Content Script Injection: When the page loads, Select & Save's content script inspects the URL query parameters (select_and_save_text). If dynamic DOM rendering delayed the initial highlight, the extension dynamically searches the live DOM, scrolls smoothly into view, and paints an animated highlight border around the text block.

Stop Losing Context — Start Deep Linking

With Select & Save, every saved snippet remains anchored to its live web origin. Never lose your reading spot again.

Article Topics & Keywords

#deep link text fragment#scroll to text fragment chrome#web highlight target link#find original quote on webpage#select_and_save_text