public interface SiteKeyExtractor
AdblockWebView's internals and verifies the Site Key
What is expected from this class:
AdblockWebViewSiteKeyVerifier to verify itSiteKeyVerifier is set to
`siteKeysConfiguration` property
AdblockWebView accepts the extractor
by calling AdblockWebView.setSiteKeyExtractor(SiteKeyExtractor)
For example, custom HTTP request can be made and resulting HTTP headers can be used to
extract the Site Key from the header
Or Site Key might be extracted from html root tag by injecting
javascript into AdblockWebView and using JS handler to get the key back to WebView| Modifier and Type | Method and Description |
|---|---|
android.webkit.WebResourceResponse |
extract(android.webkit.WebResourceRequest request)
This method is called by the
AdblockWebView during
WebViewClient.shouldInterceptRequest(WebView, WebResourceRequest)
This method must perform custom HTTP request or return one of states from
AdblockWebView.WebResponseResult |
void |
setEnabled(boolean enabled) |
void |
setSiteKeysConfiguration(org.adblockplus.libadblockplus.sitekey.SiteKeysConfiguration siteKeysConfiguration)
This method is called by the
AdblockWebView during
AdblockWebView.setSiteKeysConfiguration(SiteKeysConfiguration)
You can later use siteKeysConfiguration in order to verify the sitekey |
void |
startNewPage()
Notifies about starting of a new page
|
boolean |
waitForSitekeyCheck(java.lang.String url,
boolean isMainFrame)
Blocks the calling thread while checking the sitekey
|
android.webkit.WebResourceResponse extract(android.webkit.WebResourceRequest request)
AdblockWebView during
WebViewClient.shouldInterceptRequest(WebView, WebResourceRequest)
This method must perform custom HTTP request or return one of states from
AdblockWebView.WebResponseResultrequest - a request that might be used for understanding
additional options (e.g. is the request intended for the main frame)void startNewPage()
boolean waitForSitekeyCheck(java.lang.String url,
boolean isMainFrame)
Will be removed later in a favor of setting internal WebViewClient for every SiteKeyExtractor
url - a request url which is held back by this callisMainFrame - a boolean indicating whether this is a main or a subframe requestvoid setSiteKeysConfiguration(org.adblockplus.libadblockplus.sitekey.SiteKeysConfiguration siteKeysConfiguration)
AdblockWebView during
AdblockWebView.setSiteKeysConfiguration(SiteKeysConfiguration)
You can later use siteKeysConfiguration in order to verify the sitekeysiteKeysConfiguration - the configuration to setvoid setEnabled(boolean enabled)