Interface ResourceInterceptor
-
- All Implemented Interfaces:
public interface ResourceInterceptor
Used to intercept resource requests in HtmlToPdfConverter to allow providing custom data for these resources.
-
-
Method Summary
Modifier and Type Method Description abstract ResourceResponse
shouldInterceptRequest(@NonNull() ResourceRequest request)
Called when the HTML converter wants to loads a resource (image, stylesheet, JavaScript etc.). -
-
Method Detail
-
shouldInterceptRequest
@Nullable() abstract ResourceResponse shouldInterceptRequest(@NonNull() ResourceRequest request)
Called when the HTML converter wants to loads a resource (image, stylesheet, JavaScript etc.).
This method is invoked for most supported URI schemes ("http(s):", "file:" etc.) and is not limited to requests made over the network. This is not called for "javascript:", "data:" and "blob:" schemes as well as for Android assets ("file:///android_asset/") or Android resources ("file:///android_res/").
If the source requires redirects, this method is called only for the initial base URL, not for the redirect URLs.
This method is called on the background thread.
- Returns:
Response for resource request with resource data,
null
to proceed with loading the resource as usual and skipResource to skip loading the resource.
-
-
-
-