# NOT RUN {
chrome <- Chrome$new()
# fetch information about headless Chrome
fetch_version()
# fetch the Chromium/Chrome protocol
protocol <- fetch_protocol()
# get the list of opened tabs
list_targets()
# open an url in a new tab
new_target <- new_tab(url = "http://r-project.org")
# the new tab is referenced in the list of opened tabs
list_targets()
# inspect a target in a web browser
if(interactive()) inspect_target(target_id = new_target$id)
# close the previous created tab
close_target(target_id = new_target$id)
chrome$close()
# }
Run the code above in your browser using DataLab