Class HttpHeaderSiteKeyExtractor
java.lang.Object
org.adblockplus.libadblockplus.android.webview.BaseSiteKeyExtractor
org.adblockplus.libadblockplus.android.webview.HttpHeaderSiteKeyExtractor
- All Implemented Interfaces:
SiteKeyExtractor
public class HttpHeaderSiteKeyExtractor extends BaseSiteKeyExtractor
Makes a custom HTTP request and then does the Site Key verification by calling
SiteKeyVerifier.verifyInHeaders(String, Map, Map)-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classHttpHeaderSiteKeyExtractor.ResourceInfostatic classHttpHeaderSiteKeyExtractor.ServerResponseProcessor -
Field Summary
Fields inherited from class org.adblockplus.libadblockplus.android.webview.BaseSiteKeyExtractor
RESOURCE_HOLD_MAX_TIME_MS, webViewWeakReference -
Constructor Summary
Constructors Constructor Description HttpHeaderSiteKeyExtractor(AdblockWebView webView) -
Method Summary
Modifier and Type Method Description android.webkit.WebResourceResponseextract(android.webkit.WebResourceRequest request)This method is called by theAdblockWebViewduringWebViewClient.shouldInterceptRequest(WebView, WebResourceRequest)This method must perform custom HTTP request or return one of states fromAdblockWebView.WebResponseResultvoidsetEnabled(boolean enabled)voidstartNewPage()Notifies about starting of a new pagebooleanwaitForSitekeyCheck(java.lang.String url, boolean isMainFrame)Blocks the calling thread while checking the sitekeyMethods inherited from class org.adblockplus.libadblockplus.android.webview.BaseSiteKeyExtractor
getSiteKeysConfiguration, isEnabled, setSiteKeysConfigurationMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
HttpHeaderSiteKeyExtractor
-
-
Method Details
-
extract
public android.webkit.WebResourceResponse extract(android.webkit.WebResourceRequest request)Description copied from interface:SiteKeyExtractorThis method is called by theAdblockWebViewduringWebViewClient.shouldInterceptRequest(WebView, WebResourceRequest)This method must perform custom HTTP request or return one of states fromAdblockWebView.WebResponseResult- Parameters:
request- a request that might be used for understanding additional options (e.g. is the request intended for the main frame)- Returns:
- a response that will be passed to
-
setEnabled
public void setEnabled(boolean enabled)- Specified by:
setEnabledin interfaceSiteKeyExtractor- Overrides:
setEnabledin classBaseSiteKeyExtractor
-
startNewPage
public void startNewPage()Description copied from interface:SiteKeyExtractorNotifies about starting of a new page -
waitForSitekeyCheck
public boolean waitForSitekeyCheck(java.lang.String url, boolean isMainFrame)Description copied from interface:SiteKeyExtractorBlocks the calling thread while checking the sitekeyWill be removed later in a favor of setting internal WebViewClient for every SiteKeyExtractor
- Parameters:
url- a request url which is held back by this callisMainFrame- a boolean indicating whether this is a main or a subframe request- Returns:
- true if had to wait
-