Class CombinedSiteKeyExtractor
java.lang.Object
org.adblockplus.libadblockplus.android.webview.CombinedSiteKeyExtractor
- All Implemented Interfaces:
SiteKeyExtractor
public class CombinedSiteKeyExtractor extends java.lang.Object implements SiteKeyExtractor
Decides what extractor has to be used by analyzing the data
that
AdblockWebView has.
In particular, it reads the WebResourceRequest.isForMainFrame() property
in order to understand, if we need to fire fallback extractor-
Constructor Summary
Constructors Modifier Constructor Description protectedCombinedSiteKeyExtractor(AdblockWebView webView) -
Method Summary
Modifier and Type Method Description android.webkit.WebResourceResponseextract(android.webkit.WebResourceRequest frameRequest)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)voidsetSiteKeysConfiguration(org.adblockplus.libadblockplus.sitekey.SiteKeysConfiguration siteKeysConfiguration)This method is called by theAdblockWebViewduringAdblockWebView.setSiteKeysConfiguration(SiteKeysConfiguration)You can later use siteKeysConfiguration in order to verify the sitekeyvoidstartNewPage()Notifies about starting of a new pagebooleanwaitForSitekeyCheck(java.lang.String url, boolean isMainFrame)Blocks the calling thread while checking the sitekeyMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Constructor Details
-
CombinedSiteKeyExtractor
-
-
Method Details
-
extract
public android.webkit.WebResourceResponse extract(android.webkit.WebResourceRequest frameRequest)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- Specified by:
extractin interfaceSiteKeyExtractor- Parameters:
frameRequest- 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
-
setSiteKeysConfiguration
public void setSiteKeysConfiguration(org.adblockplus.libadblockplus.sitekey.SiteKeysConfiguration siteKeysConfiguration)Description copied from interface:SiteKeyExtractorThis method is called by theAdblockWebViewduringAdblockWebView.setSiteKeysConfiguration(SiteKeysConfiguration)You can later use siteKeysConfiguration in order to verify the sitekey- Specified by:
setSiteKeysConfigurationin interfaceSiteKeyExtractor- Parameters:
siteKeysConfiguration- the configuration to set
-
startNewPage
public void startNewPage()Description copied from interface:SiteKeyExtractorNotifies about starting of a new page- Specified by:
startNewPagein interfaceSiteKeyExtractor
-
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
- Specified by:
waitForSitekeyCheckin interfaceSiteKeyExtractor- 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
-
setEnabled
public void setEnabled(boolean enabled)- Specified by:
setEnabledin interfaceSiteKeyExtractor
-