cefsharp 获取高度

G.browser.GetBrowser().MainFrame.ExecuteJavaScriptAsync("$(document).height()");

 

 

 

// Get Document Height  
var task = frame.EvaluateScriptAsync("(function() { var body = document.body, html = document.documentElement; return  Math.max( body.scrollHeight, body.offsetHeight, html.clientHeight, html.scrollHeight, html.offsetHeight ); })();", null);

task.ContinueWith(t =>  
{  
    if (!t.IsFaulted)  
    {  
        var response = t.Result;  
        EvaluateJavaScriptResult = response.Success ? (response.Result ?? "null") : response.Message;  
    }  
}, TaskScheduler.FromCurrentSynchronizationContext());  

 

posted @ 2018-12-26 13:28  大da脸  阅读(1026)  评论(0编辑  收藏  举报