SWebViewProxyHtmlUtils class
Utilities for normalizing HTML payloads returned by CORS proxies.
Constructors
Properties
- hashCode → int
-
The hash code for this object.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
Methods
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited
Static Methods
-
buildProxiedUrl(
String proxyBase, String targetAbsoluteUrl) → String - Builds a proxied URL for a target absolute URL.
-
injectBaseTagIfMissing(
String html, String baseUrl) → String -
Ensures a
<base href="...">tag exists with an absolute URL. -
injectProxyCompatibilityScript(
String html) → String -
Injects a small compatibility patch for proxied documents rendered from
data:origin, preventing hard failures on unsupported APIs. -
isLikelyProxyIncompatibleDocument(
String html) → bool -
Detects HTML payloads that are known to break when rendered from a
data:URL origin (for example Cloudflare challenge pages). -
isQueryStyleProxyBase(
String proxyBase) → bool -
Returns
truewhen the proxy base is query-parameter style (e.g....proxy?url=) instead of path-prefix style. -
looksLikeHtml(
String value) → bool - Best-effort check indicating whether a string likely contains HTML markup.
-
normalizeProxyHtml(
String body, {Map< String, String> ? headers}) → String - Normalizes proxy response payloads into usable HTML:
-
requiresPathFriendlyProxy(
String html) → bool -
Returns
truewhen the HTML payload appears to rely on module/import-map loading semantics where query-style proxy URLs can break relative imports. -
rewriteHtmlResourceUrlsForProxy(
String html, {required String originalUrl, required String proxyBase}) → String -
Rewrites external resource URLs (
src,href,poster,srcset) and import-map values to use the selected proxy endpoint.