Closed RLesur closed 5 years ago
I've added an inspect()
method to the CDPSession
class.
The inspector opens by default in RStudio.
I think this is convenient.
So, I've modified the README to explain first how to play interactively with headless Chrome in a R session. Despite this is not the ultimate goal of crrri
I think that R developers will be frustrated if they cannot interact through the R console.
Here are some screenshots I've added in the README
Pretty big PR and very nice improvment ! It is really powerful ! I need to get my head around this to fully understand your changes and new features.
About the Browser vs Page Handling, should we aim at something like puppeteer:
This seems now possible with your changes. Don't know if it does matter or not to be able to controle Browser and page precisely. The new_tab
endpoint seems ok. Maybe this will sort out by adding more examples.
What do you think ?
Even if I tried to developed these new methods keeping in mind how puppeteer deals with browser/pages, I don't see a great value by changing the Remote
/Chrome
class.
The Browser
and Target
domains seem to work now. IMO, this is sufficient.
I will do only minor adjustments in the Remote
class.
it is fine with we. Though, I still want to understand why browser Domain work whereas we don't have a connection to the browser target I'll see later.
As detailed before, seven functions corresponding to HTTP endpoints are available in this PR.
Other changes:
CDPRemote
/Chrome
classesconnect()
method gains a target_id
argument.listTargets()
method is addedCDPSession
classconnect()
method, the ws_url
argument overrides the host
and port
arguments. It was the goal but wasn't implemented: this PR implements this part.connect()
method must return a connection object or a promise. In case of error, we must use stop()
(for a synchronous returned valued) or promise_reject()
(for an asynchronous value). In master, some errors were thrown instead of returning a rejected promise. The PR changes this part to throw an error for a sync value and return a rejected promise for an async value.inspect()
, activateTab()
and closeTab()
Major update of the README file with screenshots to show first an interactive use case in RStudio.
@cderv Thanks for your sharp eyes! I merge this branch now and we will improve the remaining points on master.
This PR will close #27
For now, the following functions are developed:
My goal is to add new methods to
CDPSession
andCDPRemote
built on top of these functions.