PreconnectHintParser

Extract preconnect link hints from HTML source without fetching, validating browser support, or resolving their hrefs.

Description

Preconnect hints identify destinations for which a browser may establish an early connection.

Preconnect hints identify destinations for which a browser may establish an early connection. They differ from hints that only request DNS lookup.1

Extract preconnect link hints from HTML source without fetching, validating browser support, or resolving their hrefs.

When to use PreconnectHintParser

Use this tool to extract preconnect link hints from HTML source without fetching, validating browser support, or resolving their hrefs.

Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.

How to use PreconnectHintParser and understand its results

  1. Choose the URL, decoded source text, header value or explicit byte list requested by this tool. Paste the complete relevant input and follow its parsing and encoding conventions.
  2. Enter html using the field table and calculation rules, then run the tool.
  3. Read hrefs. The explanation below defines the units, signs, ordering and any flags or placeholder values.
  4. If the tool reports an input issue, correct the values and run it again. Apply the stated assumptions when interpreting a successfully returned result.
Input fieldMeaningValue type; see rules belowRequirement
htmlHTML source.string; maximum length: 1000000Required

Paste HTML source. The scanner reads link start tags and case-insensitive ASCII-whitespace rel tokens, then collects matching href values with supported reference decoding. Preserve duplicates and source order; missing href is skipped.

hrefs=source-order link hrefs with a rel token equal to preconnect

Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.

Output fieldMeaningValue type
hrefsMatching link hrefs in document order.list of string; maximum length: 1000000; minimum entries: 0; maximum entries: 100000
json
{
  "input": {
    "html": "<link rel=\"PRECONNECT\" href=\"/app.js\"><link rel=\"stylesheet\" href=\"/style.css\">"
  },
  "output": {
    "hrefs": [
      "/app.js"
    ]
  }
}

Limitations and assumptions

This does not open connections, resolve hrefs or inspect crossorigin/CORS behavior. A source hint does not prove browser support or a performance improvement; the scanner is not a full DOM implementation.

Numeric inputs must be finite. Follow the calculation-specific rules for overflow, underflow and exceptional cases. Extremely large text inputs are rejected. Missing required fields, extra fields, wrong value types and violations of the calculation rules are input errors.

Alternative or Complementary methods

Use DnsPrefetchHintParser: Extract dns-prefetch link hints from HTML source without fetching, validating browser support, or resolving their hrefs. For a complementary task, use LinkPreloadDetector: Extract preload link hints from HTML source without fetching, validating browser support, or resolving their hrefs.

References

  1. PreconnectHintParser — tool.io

Similar or alternative tools

  • DnsPrefetchHintParser

    Extract dns-prefetch link hints from HTML source without fetching, validating browser support, or resolving their hrefs.

  • LinkPreloadDetector

    Extract preload link hints from HTML source without fetching, validating browser support, or resolving their hrefs.

Don't forget to set a bookmark for tool.io!
Privacy | Imprint | Cookies