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)
  • Constructor Details

    • HttpHeaderSiteKeyExtractor

      public HttpHeaderSiteKeyExtractor​(AdblockWebView webView)
  • Method Details

    • extract

      public android.webkit.WebResourceResponse extract​(android.webkit.WebResourceRequest request)
      Description copied from interface: SiteKeyExtractor
      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
      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:
      setEnabled in interface SiteKeyExtractor
      Overrides:
      setEnabled in class BaseSiteKeyExtractor
    • startNewPage

      public void startNewPage()
      Description copied from interface: SiteKeyExtractor
      Notifies about starting of a new page
    • waitForSitekeyCheck

      public boolean waitForSitekeyCheck​(java.lang.String url, boolean isMainFrame)
      Description copied from interface: SiteKeyExtractor
      Blocks the calling thread while checking the sitekey

      Will be removed later in a favor of setting internal WebViewClient for every SiteKeyExtractor

      Parameters:
      url - a request url which is held back by this call
      isMainFrame - a boolean indicating whether this is a main or a subframe request
      Returns:
      true if had to wait