| Line 1... |
Line 1... |
| 1 |
% File src/library/utils/man/browseURL.Rd
|
1 |
% File src/library/utils/man/browseURL.Rd
|
| 2 |
% Part of the R package, https://www.R-project.org
|
2 |
% Part of the R package, https://www.R-project.org
|
| 3 |
% Copyright 1995-2017 R Core Team
|
3 |
% Copyright 1995-2018 R Core Team
|
| 4 |
% Distributed under GPL 2 or later
|
4 |
% Distributed under GPL 2 or later
|
| 5 |
|
5 |
|
| 6 |
\name{browseURL}
|
6 |
\name{browseURL}
|
| 7 |
\alias{browseURL}
|
7 |
\alias{browseURL}
|
| 8 |
\title{Load URL into an HTML Browser}
|
8 |
\title{Load URL into an HTML Browser}
|
| Line 30... |
Line 30... |
| 30 |
needed (and might be harmful) if the \code{browser} program/function
|
30 |
needed (and might be harmful) if the \code{browser} program/function
|
| 31 |
itself does encoding, and can be harmful for \samp{file://} URLs on some
|
31 |
itself does encoding, and can be harmful for \samp{file://} URLs on some
|
| 32 |
systems and for \samp{http://} URLs passed to some CGI applications.
|
32 |
systems and for \samp{http://} URLs passed to some CGI applications.
|
| 33 |
Fortunately, most URLs do not need encoding.}
|
33 |
Fortunately, most URLs do not need encoding.}
|
| 34 |
}
|
34 |
}
|
| 35 |
#ifdef unix
|
- |
|
| 36 |
\details{
|
35 |
\details{
|
| - |
|
36 |
\describe{
|
| - |
|
37 |
\item{On Unix-alikes:}{
|
| 37 |
The default browser is set by option \code{"browser"}, in turn set by
|
38 |
The default browser is set by option \code{"browser"}, in turn set by
|
| 38 |
the environment variable \env{R_BROWSER} which is by default set in
|
39 |
the environment variable \env{R_BROWSER} which is by default set in
|
| 39 |
file \file{\var{\link{R_HOME}}/etc/Renviron} to a choice
|
40 |
file \file{\var{\link{R_HOME}}/etc/Renviron} to a choice
|
| 40 |
made manually or automatically when \R was configured. (See
|
41 |
made manually or automatically when \R was configured. (See
|
| 41 |
\code{\link{Startup}} for where to override that default value.)
|
42 |
\code{\link{Startup}} for where to override that default value.)
|
| Line 68... |
Line 69... |
| 68 |
To suppress showing URLs altogether, set \code{browser = "false"}.
|
69 |
To suppress showing URLs altogether, set \code{browser = "false"}.
|
| 69 |
|
70 |
|
| 70 |
The behaviour for arguments \code{url} which are not URLs is
|
71 |
The behaviour for arguments \code{url} which are not URLs is
|
| 71 |
platform-dependent. Some platforms accept absolute file paths; fewer
|
72 |
platform-dependent. Some platforms accept absolute file paths; fewer
|
| 72 |
accept relative file paths.
|
73 |
accept relative file paths.
|
| 73 |
}
|
74 |
|
| 74 |
\examples{
|
- |
|
| 75 |
\dontrun{## for KDE users who want to open files in a new tab
|
- |
|
| 76 |
options(browser = "kfmclient newTab")
|
- |
|
| 77 |
browseURL("https://www.r-project.org")
|
- |
|
| 78 |
}}
|
75 |
}
|
| 79 |
#endif
|
- |
|
| 80 |
#ifdef windows
|
76 |
\item{On Windows:}{
|
| 81 |
\details{
|
- |
|
| 82 |
The default browser is set by option \code{"browser"}, in turn set by
|
77 |
The default browser is set by option \code{"browser"}, in turn set by
|
| 83 |
the environment variable \env{R_BROWSER} if that is set, otherwise to
|
78 |
the environment variable \env{R_BROWSER} if that is set, otherwise to
|
| 84 |
\code{NULL}.
|
79 |
\code{NULL}.
|
| 85 |
To suppress showing URLs altogether, use the value \code{"false"}.
|
80 |
To suppress showing URLs altogether, use the value \code{"false"}.
|
| 86 |
|
81 |
|
| 87 |
Some browsers have required \code{:} be replaced by \code{|} in file
|
82 |
Some browsers have required \code{:} be replaced by \code{|} in file
|
| 88 |
paths: others do not accept that. All seem to accept \code{\\} as a
|
83 |
paths: others do not accept that. All seem to accept \code{\\} as a
|
| 89 |
path separator even though the RFC1738 standard requires \code{/}.
|
84 |
path separator even though the RFC1738 standard requires \code{/}.
|
| 90 |
|
85 |
|
| 91 |
To suppress showing URLs altogether, set \code{browser = "false"}.
|
86 |
To suppress showing URLs altogether, set \code{browser = "false"}.
|
| - |
|
87 |
}
|
| - |
|
88 |
}% {describe}
|
| 92 |
}
|
89 |
}
|
| - |
|
90 |
|
| 93 |
\examples{
|
91 |
\examples{
|
| - |
|
92 |
\dontrun{
|
| - |
|
93 |
## for KDE users who want to open files in a new tab
|
| - |
|
94 |
options(browser = "kfmclient newTab")
|
| - |
|
95 |
|
| 94 |
\dontrun{browseURL("https://www.r-project.org")
|
96 |
browseURL("https://www.r-project.org")
|
| - |
|
97 |
|
| - |
|
98 |
## On Windows-only, something like
|
| 95 |
browseURL("file://d:/R/R-2.5.1/doc/html/index.html",
|
99 |
browseURL("file://d:/R/R-2.5.1/doc/html/index.html",
|
| 96 |
browser = "C:/Program Files/Mozilla Firefox/firefox.exe")
|
100 |
browser = "C:/Program Files/Mozilla Firefox/firefox.exe")
|
| 97 |
}}
|
101 |
}}
|
| 98 |
#endif
|
102 |
|
| 99 |
\section{URL schemes}{
|
103 |
\section{URL schemes}{
|
| 100 |
Which URL schemes are accepted is platform-specific: expect
|
104 |
Which URL schemes are accepted is platform-specific: expect
|
| 101 |
\samp{http://}, \samp{https://} and \samp{ftp://} to work, but
|
105 |
\samp{http://}, \samp{https://} and \samp{ftp://} to work, but
|
| 102 |
\samp{mailto:} may or may not (and if it does may not use the user's
|
106 |
\samp{mailto:} may or may not (and if it does may not use the user's
|
| 103 |
preferred email client).
|
107 |
preferred email client).
|