/// Evaluate a JavaScript string on the WebView
///
/// # Safety
/// All the FFI functions are unsafe.
Evaluate a JavaScript string on the WebView
Evaluate a JavaScript string on the WebView
pub unsafe fn evaluate_javascript(&self, javascript: &str) {
        let javascript = NSString::alloc(nil).init_str(javascript);
        let b = |_: id, error: id| {
            if error != nil {
                let str = msg_send![error, localizedDescription];
                let str = string_from_nsstring(str);
                println!("Error {}", str.as_ref().unwrap().as_str());
            }
        };
        let b = ConcreteBlock::new(b);
        let b = b.copy();
        self.webview.evaluateJavaScript_(javascript, &b);
    }
pub unsafe fn evaluate_javascript ( & self , javascript : & str ) { let javascript = NSString :: alloc ( nil ) . init_str ( javascript ) ; let b = | _ : id , error : id | { if error != nil { let str = msg_send ! [ error localizedDescription ] ; let str = string_from_nsstring ( str ) ; println ! ( " " str as_ref ( ) unwrap ( ) as_str ( ) ) ; } } ; let b = ConcreteBlock :: new ( b ) ; let b = b . copy ( ) ; self . webview . evaluateJavaScript_ ( javascript , & b ) ; }
Evaluate a JavaScript string on the WebView
Evaluate a JavaScript string on the WebView
&self
javascript
&str
safety
All the FFI functions are unsafe.
All the FFI functions are unsafe .