Class WebJS

  • All Implemented Interfaces:

    
    public final class WebJS
    
                        

    Convenience class to eval js on web pages

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Constructor Summary

      Constructors 
      Constructor Description
      WebJS(Context context)
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • WebJS

        WebJS(Context context)
        Parameters:
        context - Context to create webview
    • Method Detail

      • evalOnFinish

         final Unit evalOnFinish(String link, String userAgent, Map<String, String> headers, Long timeout, String js, Function1<String, Unit> callback)

        Eval de js code on the link after being loaded in a Webview

        Parameters:
        link - Link to be loaded in the webview
        userAgent - Optional user agent to be used while loading the link
        headers - Optional additional headers
        timeout - Time to wait after onPageFinished is called before getting the cookies
        callback - Callback of eval code result
      • cookiesOnFinish

         final Unit cookiesOnFinish(String link, String userAgent, Map<String, String> headers, Long timeout, Function1<String, Unit> cookies)

        Get the cookies of the link after being loaded in a Webview

        Parameters:
        link - Link to be loaded in the webview
        userAgent - Optional user agent to be used while loading the link
        headers - Optional additional headers
        timeout - Time to wait after onPageFinished is called before getting the cookies
        cookies - Callback of the cookies from the link
      • evalJs

         final Unit evalJs(String code, Function1<String, Unit> result)

        Eval js on a webview

        Parameters:
        code - Code to eval
        result - Callback of the eval code result