Interfaces
RedirectChain
Represents the complete result of tracing a URL through its redirect chain.The validated input URL that was traced. This URL has been processed by
validateUrl() and may include protocol additions.The last URL reached in the redirect chain. This is either the final destination or the URL where the trace stopped (due to limits or errors).
Array of all redirect steps encountered, in chronological order. Each step contains the URL, HTTP status, and response headers.
Count of how many redirects occurred. A value of 0 means the URL didn’t redirect. Maximum value is determined by the
maxRedirects preference.Indicates whether the trace completed successfully.
true: The trace reached a non-redirect status code (200, 404, etc.)false: The trace stopped due to hittingmaxRedirectslimit or encountering an error
Error message if the trace failed. Only present when an error occurred. See troubleshooting for common error messages.
RedirectStep
Represents a single step in the redirect chain.The URL that was requested for this step. This is the current location in the redirect chain.
HTTP status code returned by the server.Common codes:
301: Permanent redirect302: Temporary redirect307: Temporary redirect (method preserved)308: Permanent redirect (method preserved)200: Success (final destination)
Human-readable status text corresponding to the status code (e.g., “Moved Permanently”, “Found”, “OK”).
All HTTP response headers as key-value pairs. The
location header contains the next URL in redirect responses (3xx status codes).Preferences
Configuration interface for extension preferences.String representation of maximum redirects to follow. Parsed to integer with default
"10".String representation of timeout in milliseconds. Parsed to integer with default
"5000".Functions
followRedirects()
Traces a URL through its redirect chain and returns the complete analysis.The URL to trace. Can be with or without protocol (http/https). Will be validated and normalized.
Promise that resolves to a
RedirectChain object containing all trace results.- Validates and normalizes the input URL using
validateUrl() - Makes HTTP requests with
redirect: "manual"to prevent automatic following - Collects each redirect step including status codes and headers
- Stops when:
- A non-redirect status code is received (200, 404, etc.)
maxRedirectslimit is reached- A timeout or network error occurs
- No
locationheader is present in a 3xx response
validateUrl()
Normalizes and validates URLs before tracing.Raw URL input from user (may lack protocol or contain whitespace).
Validated and normalized URL with protocol included.
- Trims leading/trailing whitespace
- Removes line breaks and tabs (
\r,\n,\t) - Adds
https://protocol if missing - Returns empty string for empty input
cleanTrackingParams()
Removes tracking parameters from URLs to get clean destination URLs.URL potentially containing tracking parameters.
URL with tracking parameters removed. Falls back to original URL if parsing fails.
Google Analytics & Marketing
Google Analytics & Marketing
utm_source,utm_medium,utm_campaign,utm_term,utm_contentgclid,gclsrc,dclid,gbraid,wbraid
Facebook/Meta tracking
Facebook/Meta tracking
fbclid,fb_action_ids,fb_action_types,fb_ref,fb_source
Email marketing platforms
Email marketing platforms
mc_cid,mc_eid(MailChimp)_hsenc,_hsmi(HubSpot)vero_conv,vero_id(Vero)mkt_tok(Marketo)
Social media platforms
Social media platforms
Analytics platforms
Analytics platforms
_ga,_gl(Google Analytics)s_cid,ncid(Adobe/Omniture)pk_campaign,pk_kwd(Matomo)
- Long random strings (>20 chars) with alphanumeric values
- Parameters starting with:
track,trk,tid,cid,sid,campaign, etc. - Base64-encoded or URL-encoded data blobs
Error handling
All functions handle errors gracefully:followRedirects()returns aRedirectChainwitherrorfield populatedvalidateUrl()returns empty string for invalid inputcleanTrackingParams()returns original URL if parsing fails
igshid,igsh(Instagram)ref_src,ref_url,share,shared