Skip to content

Commit

Permalink
v0.1.0 (#85)
Browse files Browse the repository at this point in the history
* Make barret an author

* spelling

* Init CRAN comments

* init revdep (even though init pkg release)

* Remove `LazyData: true` as no data exists

* Fix urls

* Quote `Chrome DevToolsProtocol` in Description

* Use version `0.1.0`

* Create NEWS.md

* Update installation instructions. Remove dev package note

* Update README.md

* Update cran-comments.md

* Remove `devtools::check_win_release()` as it did not return
  • Loading branch information
schloerke authored Apr 19, 2022
1 parent eaf3875 commit 1884e3b
Showing 12 changed files with 112 additions and 62 deletions.
2 changes: 2 additions & 0 deletions .Rbuildignore
Original file line number Diff line number Diff line change
@@ -8,3 +8,5 @@
^pkgdown$
^README\.Rmd$
^sidebar.png$
^revdep$
^cran-comments\.md$
8 changes: 4 additions & 4 deletions DESCRIPTION
Original file line number Diff line number Diff line change
@@ -1,15 +1,14 @@
Package: chromote
Title: Headless Chrome Web Browser Interface
Version: 0.0.0.9003
Version: 0.1.0
Authors@R: c(
person("Winston", "Chang", role = c("aut", "cre"), email = "[email protected]"),
person("Barret", "Schloerke", role = c("ctb"), email = "[email protected]"),
person("Barret", "Schloerke", role = c("aut"), email = "[email protected]"),
person(given = "RStudio", role = c("cph", "fnd"))
)
Description: An implementation of the Chrome Devtools Protocol, for controlling a headless Chrome web browser.
Description: An implementation of the 'Chrome DevTools Protocol', for controlling a headless Chrome web browser.
License: GPL-2
Encoding: UTF-8
LazyData: true
SystemRequirements: Google Chrome or other Chromium-based browser. chromium: chromium (rpm) or chromium-browser (deb)
Imports:
curl,
@@ -31,3 +30,4 @@ URL: https://github.com/rstudio/chromote
BugReports: https://github.com/rstudio/chromote/issues
Config/testthat/edition: 3
Config/Needs/website: tidyverse/tidytemplate
Language: en-US
3 changes: 3 additions & 0 deletions NEWS.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
# chromote 0.1.0

* Initial package release
6 changes: 3 additions & 3 deletions R/chromote.R
Original file line number Diff line number Diff line change
@@ -13,7 +13,7 @@ NULL
#'
#' A `Chromote` object represents the browser as a whole, and it can have
#' multiple _targets_, which each represent a browser tab. In the Chrome
#' Devtools Protocol, each target can have one or more debugging _sessions_ to
#' DevTools Protocol, each target can have one or more debugging _sessions_ to
#' control it. A `ChromoteSession` object represents a single _session_.
#'
#' A `Chromote` object can have any number of `ChromoteSession` objects as
@@ -156,7 +156,7 @@ Chromote <- R6Class(
#'
#' @param width,height Width and height of the new window.
#' @param targetId
#' [Target](https://chromedevtools.github.io/devtools-protocol/tot/Target)
#' [Target](https://chromedevtools.github.io/devtools-protocol/tot/Target/)
#' ID of an existing target to attach to. When a `targetId` is provided, the
#' `width` and `height` arguments are ignored. If NULL (the default) a new
#' target is created and attached to, and the `width` and `height`
@@ -205,7 +205,7 @@ Chromote <- R6Class(
#' @param msg A JSON-serializable list containing `method`, and `params`.
#' @param callback Method to run when the command finishes successfully.
#' @param error Method to run if an error occurs.
#' @param timeout Number of milliseconds for Chrome Devtools Protocol
#' @param timeout Number of milliseconds for Chrome DevTools Protocol
#' execute a method.
#' @param sessionId Determines which [`ChromoteSession`] with the
#' corresponding to send the command to.
12 changes: 6 additions & 6 deletions R/chromote_session.R
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
# This represents one _session_ in a Chromote object. Note that in the Chrome
# Devtools Protocol a session is a debugging interface connected to a
# DevTools Protocol a session is a debugging interface connected to a
# _target_; a target is a browser window/tab, or an iframe. A single target
# can have more than one session connected to it.

#' ChromoteSession class
#' @export
#' @param timeout_ Number of seconds for \pkg{chromote} to wait for a Chrome
#' Devtools Protocol response. If `timeout_` is [`rlang::missing_arg()`] and
#' DevTools Protocol response. If `timeout_` is [`rlang::missing_arg()`] and
#' `timeout` is provided, `timeout_` will be set to `2 * timeout / 1000`.
#' @param timeout Number of milliseconds for Chrome Devtools Protocol execute a
#' @param timeout Number of milliseconds for Chrome DevTools Protocol execute a
#' method.
#' @param width Width, in pixels, of the `Target` to create if `targetId` is
#' `NULL`
#' @param height Height, in pixels, of the `Target` to create if `targetId` is
#' `NULL`
#' @param targetId
#' [Target](https://chromedevtools.github.io/devtools-protocol/tot/Target)
#' [Target](https://chromedevtools.github.io/devtools-protocol/tot/Target/)
#' ID of an existing target to attach to. When a `targetId` is provided, the
#' `width` and `height` arguments are ignored. If NULL (the default) a new
#' target is created and attached to, and the `width` and `height`
@@ -215,7 +215,7 @@ ChromoteSession <- R6Class(
#' increased.
#' @param wait_ If `FALSE`, return a [promises::promise()] that will resolve
#' when the `ChromoteSession` has saved the screenshot. Otherwise, block
#' until the `ChromoteSession` has saved the screnshot.
#' until the `ChromoteSession` has saved the screenshot.
#' @examples
#' \dontrun{# Create a new `ChromoteSession` object.
#' b <- ChromoteSession$new()
@@ -443,7 +443,7 @@ ChromoteSession <- R6Class(
#' @param msg A JSON-serializable list containing `method`, and `params`.
#' @param callback Method to run when the command finishes successfully.
#' @param error Method to run if an error occurs.
#' @param timeout Number of milliseconds for Chrome Devtools Protocol
#' @param timeout Number of milliseconds for Chrome DevTools Protocol
#' execute a method.
send_command = function(msg, callback = NULL, error = NULL, timeout = NULL) {
if (!private$is_active_) {
4 changes: 2 additions & 2 deletions R/protocol.R
Original file line number Diff line number Diff line change
@@ -2,8 +2,8 @@

utils::globalVariables(c("self", "private", "callback_", "error_", "timeout", "timeout_", "wait_"))

# Given a protocol spec (essentially, the Chrome Devtools Protocol JSON
# converted to an R object), returns a list of domains of the Devtools
# Given a protocol spec (essentially, the Chrome DevTools Protocol JSON
# converted to an R object), returns a list of domains of the DevTools
# Protocol (like Browser, Page, Runtime). Each domain has a function for each
# command and event (like Browser$getVersion, Page$navigate, etc). The
# `protocol` input is the protocol object from the browser, translated from
Loading

0 comments on commit 1884e3b

Please sign in to comment.