This is a helper function to write some resulting data from chrome to file. It will:

write_base64(res, con)

Arguments

res

A resulting list object with some data field containing base64 encoded data. (like Page$printToPDF())

con

A connection object. See base::writeBin().