htmlPage: Open a web page in a browser.

Description Usage Arguments Details Value Author(s) See Also Examples

Description

Open a web page in a browser and provide a handle to that web page.

Usage

1
2
3
4
htmlPage(html = "", head = "",
         host = "127.0.0.1", client = getOption("DOM.client"))
filePage(file, client = getOption("DOM.client"))
urlPage(url, client = getOption("DOM.client"))

Arguments

html

A character vector containing HTML code, which will be used as the body of the web page that is opened.

head

A character vector that will be added to the head of the web page.

host

The client host. By default this is the localhost, but in theory it allows for a remote client.

client

A definition of the client, as created by makeClient.

file

A path to a file on the local file system, which should be a text file containing HTML (plus possibly SVG, CSS, javascript) describing a web page.

url

A URL to a web page on the internet.

Details

By default, the web page described by html, file, or url is opened in the default browser (getOptions("browser")). A headless browser (PhantomJS) is supported, which may be useful for testing.

For filePage() and urlPage() to work, the RDOM.user.js user script must be installed in the browser (for greasemonkey with Firefox). There is also RDOM.tamper.js (for Tampermonkey with, e.g., Chrome). In addition, for filePage(), in Firefox at least, greasemonkey.fileIsGreaseable must be set to true in about:config. urlPage() currently only supports the http:// protocol (not https://).

For client=phantomClient to work, PhantomJS must be installed.

Value

A page identifier, to be used to send DOM requests to the web page, or to close the web page.

Author(s)

Paul Murrell

See Also

appendChild

Examples

1
2
3
headlessPage <- htmlPage(client=phantomClient)
appendChild(headlessPage, htmlNode("<p>test</p>"))
closePage(headlessPage)

pmur002/DOM documentation built on May 25, 2019, 10:20 a.m.