DnsPrefetchHintParser
Extract dns-prefetch link hints from HTML source without fetching, validating browser support, or resolving their hrefs.
Description
DNS-prefetch hints let a browser consider early hostname resolution.
DNS-prefetch hints let a browser consider early hostname resolution. They are narrower than preconnect hints, which can also prepare transport connections.1
Extract dns-prefetch link hints from HTML source without fetching, validating browser support, or resolving their hrefs.
When to use DnsPrefetchHintParser
Use this tool to extract dns-prefetch 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 DnsPrefetchHintParser and understand its results
- 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.
- Enter html using the field table and calculation rules, then run the tool.
- Read hrefs. The explanation below defines the units, signs, ordering and any flags or placeholder values.
- 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 field | Meaning | Value type; see rules below | Requirement |
|---|---|---|---|
| html | HTML source. | string; maximum length: 1000000 | Required |
Paste HTML source. Scan link tags, match a case-insensitive dns-prefetch rel token and collect href attributes in order. Decode the scanner's supported numeric/common named references and preserve repeated links. No matches yields an empty list.
hrefs=source-order link hrefs with a rel token equal to dns-prefetch Units, indexing, boundary conditions and exceptional cases are defined in the calculation rules above.
| Output field | Meaning | Value type |
|---|---|---|
| hrefs | Matching link hrefs in document order. | list of string; maximum length: 1000000; minimum entries: 0; maximum entries: 100000 |
{
"input": {
"html": "<link rel=\"DNS-PREFETCH\" href=\"/app.js\"><link rel=\"stylesheet\" href=\"/style.css\">"
},
"output": {
"hrefs": [
"/app.js"
]
}
} Limitations and assumptions
The tool does not perform DNS lookup, resolve relative hrefs or predict browser scheduling. It reads source without JavaScript rendering or full DOM parsing recovery.
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 PreconnectHintParser: Extract preconnect link hints from HTML source without fetching, validating browser support, or resolving their hrefs. For a complementary task, use URL Hostname: Extract the hostname of an absolute URL using the WHATWG URL parser, including its normalization rules.
References
-
DnsPrefetchHintParser — tool.io
Similar or alternative tools
- PreconnectHintParser
Extract preconnect link hints from HTML source without fetching, validating browser support, or resolving their hrefs.
- URL Hostname
Extract the hostname of an absolute URL using the WHATWG URL parser, including its normalization rules.