JavascriptInterpreter

Trait JavascriptInterpreter 

Source
pub trait JavascriptInterpreter: Send + Sync {
    // Required method
    fn solve_challenge(
        &self,
        page_html: &str,
        host: &str,
    ) -> Result<String, InterpreterError>;

    // Provided method
    fn execute(
        &self,
        script: &str,
        host: &str,
    ) -> Result<String, InterpreterError> { ... }
}
Expand description

Abstraction over JavaScript runtimes capable of solving Cloudflare logic.

Required Methods§

Source

fn solve_challenge( &self, page_html: &str, host: &str, ) -> Result<String, InterpreterError>

Evaluate a challenge page and return the solved answer formatted with 10 decimal places.

Provided Methods§

Source

fn execute(&self, script: &str, host: &str) -> Result<String, InterpreterError>

Execute raw JavaScript within a pre-constructed environment.

Implementors§