android-components / mozilla.components.browser.errorpages / ErrorPages

ErrorPages

object ErrorPages (source)

Functions

Name Summary
createErrorPage fun createErrorPage(context: <ERROR CLASS>, errorType: ErrorType, uri: String? = null, htmlResource: Int = R.raw.error_pages, cssResource: Int = R.raw.error_style): String
Load and generate error page for the given error type and html/css resources. Encoded in Base64 & does NOT support loading images
createUrlEncodedErrorPage fun createUrlEncodedErrorPage(context: <ERROR CLASS>, errorType: ErrorType, uri: String? = null, htmlResource: String = HTML_RESOURCE_FILE): String
Provides an encoded URL for an error page. Supports displaying images

Extension Functions

Name Summary
loadResourceAsString fun Any.loadResourceAsString(path: String): String
Loads a file from the resources folder and returns its content as a string object.