javascript - Fetching images with JavascriptResponse in CefBrowser (Without downloading twice) -


i'm attempting use cefsharp (offscreen) image information in webpage. i'd avoid downloading content twice (i'm aware can pull src string image tag, , download image again). right now, code:

using (var browser = new chromiumwebbrowser("http://example.com")) {     //all wait entire frame loaded.     await loadpageasync(browser);      var res1 = await browser.evaluatescriptasync("document.getelementsbytagname('img')[0].src");     //res1.result = source of image (a string)      var res2 = await browser.evaluatescriptasync("document.getelementsbytagname('img')[0]");     //this causes appcrash on cefsharp.browsersubprocess.exe } 

the way figure it, cefsharp downloading these images render webpage. i'd avoid making second request pull these images client, , pull them directly client. possible? limitations of javascriptresponse object, , why causing appcrash here?

some thoughts: thought base64 encoding image , pulling out way, require me generate canvas , fill canvas every time each image want, generate base64 string, bring c# string, , decode image. don't know how efficient be, i'm hoping there better solution.

try executing javascript...

how base64 encoded data html image

cefsharp should have filereader api.

then can have evaluatescriptasync call return base64 encoded image data.


Comments

Popular posts from this blog

c# - Validate object ID from GET to POST -

node.js - Custom Model Validator SailsJS -

php - Find a regex to take part of Email -