| Modifier and Type | Class and Description |
|---|---|
static interface |
ZBrowserCore.CacheCallback |
static interface |
ZBrowserCore.DownloadCallback |
static interface |
ZBrowserCore.InvestigateListener |
static interface |
ZBrowserCore.PreloadCallback |
static class |
ZBrowserCore.Stats |
| Modifier and Type | Field and Description |
|---|---|
protected ConfigCache |
cacheConfig |
protected ZBrowserCore.InvestigateListener |
investigateListener |
protected static String |
LOG_TAG |
protected Map<String,String> |
requestHeaders |
protected ZBrowserCore.Stats |
statistic |
static String |
VERSION |
protected ZBrowserPreload.ZBrowserPreloadCallback |
zbrowserCallback |
WebChromeClient |
zbrowserWebChromeClientListener |
WebViewClient |
zbrowserWebviewListener |
| Constructor and Description |
|---|
ZBrowserCore(ConfigCache configCache,
String diskCacheDirectory,
Context context) |
ZBrowserCore(int htmlMemSize,
int staticMemSize,
int photoMemSize,
String diskCacheDirectory,
int htmlDiskSize,
int staticDiskSize,
int photoDiskSize,
ConfigCache cacheConfig,
Context context)
Deprecated.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addCookie(String domain,
Map<String,String> cookies) |
void |
cancelDebugToast() |
boolean |
checkCacheItem(String inputUrl) |
String |
checkUrlRedirect(String url) |
void |
clearCache() |
void |
destroy()
Destroy all instance inside zbrowser
Http client will be shutdown
All cached content in memory cache will be evicted
Cached content in disk cache will not be deleted
|
protected void |
finalize() |
ConfigCache |
getCacheConfig() |
CacheItem |
getFromDiskCache(DiskLruCache cache,
String key) |
long |
getHtmlMemCacheSize() |
long |
getStaticMemCacheSize() |
ZBrowserCore.Stats |
getStatistic() |
WebResourceResponse |
getWebResourceResponse(String inputUrl,
Context context)
Get WebResourceResponse represent for content of
url. |
WebResourceResponse |
getWebResourceResponse(WebResourceRequest request,
Context context)
Get WebResourceResponse represent for content of
request
Override WebViewClient.shouldInterceptRequest and return this function |
void |
load(String inputUrl,
ZBrowserCore.DownloadCallback callback,
PreloadParam preloadParam,
Context context)
Download an html resource from
url, and store content
to both memory cache and disk cache. |
void |
onCallWebviewLoadUrl(String url) |
void |
onInitWebviewEnded() |
void |
onInitWebviewStarted() |
void |
onJumpPreloadEnded() |
void |
onJumpPreloadStarted() |
void |
onOpenUrl() |
protected void |
putToDiskCache(DiskLruCache cache,
String key,
CacheItem value) |
void |
removeCacheItem(String inputUrl)
Force remove a resource from both memory and disk cache
|
void |
removeFromDiskCache(DiskLruCache cache,
String key) |
void |
setCacheCallback(ZBrowserCore.CacheCallback callback) |
boolean |
setCacheConfig(ConfigCache cacheConfig,
Context context)
Set cache config to zbrowser
Every time this function is called, zbrowser will preload
static files within
cacheConfig.preloadStatic |
void |
setInvestigateListener(ZBrowserCore.InvestigateListener listener) |
void |
setRequestHeaders(Map<String,String> headers)
Set custom http request header such as cookie...
|
void |
setZbrowserPreloadCallback(ZBrowserPreload.ZBrowserPreloadCallback callback) |
public static final String VERSION
protected static final String LOG_TAG
protected ConfigCache cacheConfig
protected ZBrowserCore.Stats statistic
protected ZBrowserCore.InvestigateListener investigateListener
protected ZBrowserPreload.ZBrowserPreloadCallback zbrowserCallback
public final WebViewClient zbrowserWebviewListener
public final WebChromeClient zbrowserWebChromeClientListener
@Deprecated public ZBrowserCore(int htmlMemSize, int staticMemSize, int photoMemSize, String diskCacheDirectory, int htmlDiskSize, int staticDiskSize, int photoDiskSize, ConfigCache cacheConfig, Context context)
public ZBrowserCore(@NonNull
ConfigCache configCache,
@NonNull
String diskCacheDirectory,
Context context)
public void cancelDebugToast()
public void setZbrowserPreloadCallback(ZBrowserPreload.ZBrowserPreloadCallback callback)
public void setCacheCallback(ZBrowserCore.CacheCallback callback)
public void setInvestigateListener(ZBrowserCore.InvestigateListener listener)
public CacheItem getFromDiskCache(DiskLruCache cache, String key)
protected void putToDiskCache(DiskLruCache cache, String key, CacheItem value)
public void setRequestHeaders(Map<String,String> headers)
headers - map header name and valuepublic boolean setCacheConfig(ConfigCache cacheConfig, Context context)
cacheConfig.preloadStaticcacheConfig - new cache configpublic void load(String inputUrl, ZBrowserCore.DownloadCallback callback, PreloadParam preloadParam, Context context)
url, and store content
to both memory cache and disk cache.inputUrl - http url of resourcecallback - download callback function raise when downloading article.preloadParam - information about url in order to decide to preload it or notpublic WebResourceResponse getWebResourceResponse(String inputUrl, Context context)
url.
Override WebViewClient.shouldInterceptRequest and return this function.
This function is now deprecated for external call.
Use getWebResourceResponse(WebResourceRequest) insteadinputUrl - http url of resource@RequiresApi(api=21) public WebResourceResponse getWebResourceResponse(WebResourceRequest request, Context context)
request
Override WebViewClient.shouldInterceptRequest and return this functionrequest - Object containing the details of the requestpublic void removeCacheItem(String inputUrl)
inputUrl - url of resource that need removedpublic void removeFromDiskCache(DiskLruCache cache, String key)
public boolean checkCacheItem(String inputUrl)
public ZBrowserCore.Stats getStatistic()
public long getHtmlMemCacheSize()
public long getStaticMemCacheSize()
public void clearCache()
public void destroy()
protected void finalize()
throws Throwable
public ConfigCache getCacheConfig()
public void onOpenUrl()
public void onInitWebviewStarted()
public void onInitWebviewEnded()
public void onJumpPreloadStarted()
public void onJumpPreloadEnded()
public void onCallWebviewLoadUrl(String url)