Package knf.hydra.core.tools.web
Class WebJS
-
- All Implemented Interfaces:
public final class WebJSConvenience class to eval js on web pages
-
-
Method Summary
Modifier and Type Method Description final UnitevalOnFinish(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 final UnitcookiesOnFinish(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 final UnitevalJs(String code, Function1<String, Unit> result)Eval js on a webview -
-
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)
- Parameters:
link- Link to be loaded in the webviewuserAgent- Optional user agent to be used while loading the linkheaders- Optional additional headerstimeout- Time to wait after onPageFinished is called before getting the cookiescallback- 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 webviewuserAgent- Optional user agent to be used while loading the linkheaders- Optional additional headerstimeout- Time to wait after onPageFinished is called before getting the cookiescookies- Callback of the cookies from the link
-
-
-
-