/usr/share/doc/racket/net/sendurl.html is in racket-doc 6.1-4.
This file is owned by root:root, with mode 0o644.
The actual contents of the file can be viewed below.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 | <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html><head><meta http-equiv="content-type" content="text/html; charset=utf-8"/><title>6 Send URL: Opening a Web Browser</title><link rel="stylesheet" type="text/css" href="../scribble.css" title="default"/><link rel="stylesheet" type="text/css" href="../racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-style.css" title="default"/><link rel="stylesheet" type="text/css" href="../manual-racket.css" title="default"/><link rel="stylesheet" type="text/css" href="../doc-site.css" title="default"/><script type="text/javascript" src="../scribble-common.js"></script><script type="text/javascript" src="../manual-racket.js"></script><script type="text/javascript" src="../doc-site.js"></script><script type="text/javascript" src="../local-redirect/local-redirect.js"></script><script type="text/javascript" src="../local-redirect/local-user-redirect.js"></script><!--[if IE 6]><style type="text/css">.SIEHidden { overflow: hidden; }</style><![endif]--></head><body id="doc-racket-lang-org"><div class="tocset"><div class="tocview"><div class="tocviewlist tocviewlisttopspace"><div class="tocviewtitle"><table cellspacing="0" cellpadding="0"><tr><td style="width: 1em;"><a href="javascript:void(0);" title="Expand/Collapse" class="tocviewtoggle" onclick="TocviewToggle(this,"tocview_0");">▼</a></td><td></td><td><a href="index.html" class="tocviewlink" data-pltdoc="x">Net:<span class="mywbr"> </span> Networking Libraries</a></td></tr></table></div><div class="tocviewsublistonly" style="display: block;" id="tocview_0"><table cellspacing="0" cellpadding="0"><tr><td align="right">1 </td><td><a href="http-client.html" class="tocviewlink" data-pltdoc="x">HTTP Client</a></td></tr><tr><td align="right">2 </td><td><a href="url.html" class="tocviewlink" data-pltdoc="x">URLs and HTTP</a></td></tr><tr><td align="right">3 </td><td><a href="uri-codec.html" class="tocviewlink" data-pltdoc="x">URI Codec:<span class="mywbr"> </span> Encoding and Decoding URIs</a></td></tr><tr><td align="right">4 </td><td><a href="websocket.html" class="tocviewlink" data-pltdoc="x">Web<span class="mywbr"> </span>Socket</a></td></tr><tr><td align="right">5 </td><td><a href="ftp.html" class="tocviewlink" data-pltdoc="x">FTP:<span class="mywbr"> </span> Client</a></td></tr><tr><td align="right">6 </td><td><a href="" class="tocviewselflink" data-pltdoc="x">Send URL:<span class="mywbr"> </span> Opening a Web Browser</a></td></tr><tr><td align="right">7 </td><td><a href="smtp.html" class="tocviewlink" data-pltdoc="x">SMTP:<span class="mywbr"> </span> Sending E-<wbr></wbr>Mail</a></td></tr><tr><td align="right">8 </td><td><a href="sendmail.html" class="tocviewlink" data-pltdoc="x"><span class="stt">sendmail</span>:<span class="mywbr"> </span> Sending E-<wbr></wbr>Mail</a></td></tr><tr><td align="right">9 </td><td><a href="head.html" class="tocviewlink" data-pltdoc="x">Headers:<span class="mywbr"> </span> Parsing and Constructing</a></td></tr><tr><td align="right">10 </td><td><a href="imap.html" class="tocviewlink" data-pltdoc="x">IMAP:<span class="mywbr"> </span> Reading Mail</a></td></tr><tr><td align="right">11 </td><td><a href="pop3.html" class="tocviewlink" data-pltdoc="x">POP3:<span class="mywbr"> </span> Reading Mail</a></td></tr><tr><td align="right">12 </td><td><a href="mime.html" class="tocviewlink" data-pltdoc="x">MIME:<span class="mywbr"> </span> Decoding Internet Data</a></td></tr><tr><td align="right">13 </td><td><a href="base64.html" class="tocviewlink" data-pltdoc="x">Base 64:<span class="mywbr"> </span> Encoding and Decoding</a></td></tr><tr><td align="right">14 </td><td><a href="qp.html" class="tocviewlink" data-pltdoc="x">Quoted-<wbr></wbr>Printable:<span class="mywbr"> </span> Encoding and Decoding</a></td></tr><tr><td align="right">15 </td><td><a href="dns.html" class="tocviewlink" data-pltdoc="x">DNS:<span class="mywbr"> </span> Domain Name Service Queries</a></td></tr><tr><td align="right">16 </td><td><a href="nntp.html" class="tocviewlink" data-pltdoc="x">NNTP:<span class="mywbr"> </span> Newsgroup Protocol</a></td></tr><tr><td align="right">17 </td><td><a href="tcp.html" class="tocviewlink" data-pltdoc="x">TCP:<span class="mywbr"> </span> Unit and Signature</a></td></tr><tr><td align="right">18 </td><td><a href="tcp-redirect.html" class="tocviewlink" data-pltdoc="x">TCP Redirect:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">tcp^</span></span> via Channels</a></td></tr><tr><td align="right">19 </td><td><a href="ssl-tcp-unit.html" class="tocviewlink" data-pltdoc="x">SSL Unit:<span class="mywbr"> </span> <span class="RktSym"><span class="RktStxLink">tcp^</span></span> via SSL</a></td></tr><tr><td align="right">20 </td><td><a href="cgi.html" class="tocviewlink" data-pltdoc="x">CGI Scripts</a></td></tr><tr><td align="right">21 </td><td><a href="cookie.html" class="tocviewlink" data-pltdoc="x">Cookie:<span class="mywbr"> </span> HTTP Client Storage</a></td></tr><tr><td align="right"></td><td><a href="doc-bibliography.html" class="tocviewlink" data-pltdoc="x">Bibliography</a></td></tr><tr><td align="right"></td><td><a href="doc-index.html" class="tocviewlink" data-pltdoc="x">Index</a></td></tr></table></div></div></div><div class="tocsub"><div class="tocsubtitle">On this page:</div><table class="tocsublist" cellspacing="0"><tr><td><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">send-<wbr></wbr>url</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%2Ffile%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">send-<wbr></wbr>url/<span class="mywbr"> </span>file</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%2Fcontents%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">send-<wbr></wbr>url/<span class="mywbr"> </span>contents</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">external-<wbr></wbr>browser</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._browser-preference~3f%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">browser-<wbr></wbr>preference?</span></span></a></td></tr><tr><td><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._unix-browser-list%29%29" class="tocsublink" data-pltdoc="x"><span class="RktSym"><span class="RktValLink">unix-<wbr></wbr>browser-<wbr></wbr>list</span></span></a></td></tr></table></div></div><div class="maincolumn"><div class="main"><div class="navsettop"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="ftp.html" title="backward to "5 FTP: Client"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Net: Networking Libraries"" data-pltdoc="x">up</a> <a href="smtp.html" title="forward to "7 SMTP: Sending E-Mail"" data-pltdoc="x">next →</a></span> </div><h3 x-source-module="(lib "net/scribblings/net.scrbl")" x-part-tag=""sendurl"">6<tt> </tt><a name="(part._sendurl)"></a><a name="(mod-path._net/sendurl)"></a>Send URL: Opening a Web Browser</h3><p><div class="SIntrapara"><table cellspacing="0" cellpadding="0" class="defmodule"><tr><td align="left"><span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=require.html%23%2528form._%2528%2528lib._racket%252Fprivate%252Fbase..rkt%2529._require%2529%2529&version=6.1" class="RktStxLink Sq" data-pltdoc="x">require</a></span><span class="stt"> </span><a href="" class="RktModLink" data-pltdoc="x"><span class="RktSym">net/sendurl</span></a><span class="RktPn">)</span></td><td align="right"><span class="RpackageSpec"><span class="Smaller"> package:</span> <span class="stt">net-lib</span></span></td></tr></table></div><div class="SIntrapara">Provides <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> for opening a URL
in the user’s chosen web browser.</div></p><p>See also <a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?tag=%28mod-path._.%27browser%2Fexternal.%27%29&version=6.1" class="RktModLink Sq" data-pltdoc="x"><span class="RktSym">browser/external</span></a>, which requires
<span class="RktSym">racket/gui</span>, but can prompt the user for a browser if no
browser preference is set.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._net/sendurl..rkt)._send-url))"></a><span title="Provided from: net/sendurl | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValDef RktValLink" data-pltdoc="x">send-url</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">str</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">separate-window?</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:escape</span><span class="hspace"> </span><span class="RktVar">escape?</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">str</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">separate-window?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">escape?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr></table></blockquote></div><div class="SIntrapara">Opens <span class="RktVar">str</span>, which represents a URL, in a platform-specific
manner. For some platforms and configurations, the
<span class="RktVar">separate-window?</span> parameter determines if the browser creates
a new window to display the URL or not.</div></p><p>On Windows, <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> normally uses <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=subprocess.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._shell-execute%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">shell-execute</a></span>
to launch a browser. (If the URL appears to contain a fragment, it may
use an intermediate redirecting file due to a bug in IE7.)</p><p>On Mac OS X, <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> runs <span class="stt">osascript</span> to start the
user’s chosen browser.</p><p>On Unix, <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> uses a user-preference, or when none is
set, it will look for a known browser. See the description of
<span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="RktValLink" data-pltdoc="x">external-browser</a></span> for details.</p><p>If <span class="RktVar">escape?</span> is true, then <span class="RktVar">str</span> is escaped (by UTF-8
encoding followed by “%” encoding) to avoid dangerous shell
characters: single quotes, double quotes, backquotes, dollar signs,
backslashes, non-ASCII characters, and non-graphic characters. Note
that escaping does not affect already-encoded characters in
<span class="RktVar">str</span>.</p><p>On all platforms, <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="RktValLink" data-pltdoc="x">external-browser</a></span> parameter can be set to a
procedure to override the above behavior —<wbr></wbr> the procedure will be
called with the <span class="RktSym">url</span> string.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._net/sendurl..rkt)._send-url/file))"></a><span title="Provided from: net/sendurl | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%2Ffile%29%29" class="RktValDef RktValLink" data-pltdoc="x">send-url/file</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">path</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">separate-window?</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:fragment</span><span class="hspace"> </span><span class="RktVar">fragment</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:query</span><span class="hspace"> </span><span class="RktVar">query</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">path</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Manipulating_Paths.html%23%2528def._%2528%2528lib._racket%252Fprivate%252Fmisc..rkt%2529._path-string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">path-string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">separate-window?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">fragment</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">query</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> (with <span class="RktPn">#:escape?</span><span class="stt"> </span><span class="RktVal">#t</span>), but accepts
a path to a file to be displayed by the browser, along with optional
<span class="RktVar">fragment</span> (with no leading <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#</span><span class="hspace"></span></span>) and <span class="RktVar">query</span>
(with no leading <span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>) strings. Use <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%2Ffile%29%29" class="RktValLink" data-pltdoc="x">send-url/file</a></span> to
display a local file, since it takes care of the peculiarities of
constructing the correct <span class="RktInBG"><span class="hspace"></span><span class="RktIn">file://</span><span class="hspace"></span></span> URL.</div></p><p>The <span class="RktVar">path</span>, <span class="RktVar">fragment</span>, and <span class="RktVar">query</span> arguments are
all encoded in the same way as a path provided to <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span>,
which means that already-encoded characters are used as-is.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><table cellspacing="0" cellpadding="0" class="prototype RForeground"><tr><td><span class="RktPn">(</span><a name="(def._((lib._net/sendurl..rkt)._send-url/contents))"></a><span title="Provided from: net/sendurl | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%2Fcontents%29%29" class="RktValDef RktValLink" data-pltdoc="x">send-url/contents</a></span></span></td><td><span class="hspace"> </span></td><td><span class="RktVar">contents</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span>[</td><td><span class="RktVar">separate-window?</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:fragment</span><span class="hspace"> </span><span class="RktVar">fragment</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:query</span><span class="hspace"> </span><span class="RktVar">query</span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td></tr><tr><td><span class="hspace"> </span></td><td><span class="hspace"> </span></td><td><span class="RktPn">#:delete-at</span><span class="hspace"> </span><span class="RktVar">seconds</span>]<span class="RktPn">)</span></td><td><span class="hspace"> </span></td><td>→</td><td><span class="hspace"> </span></td><td><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr></table></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">contents</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">separate-window?</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#t</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">fragment</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">query</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=strings.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._string%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">string?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">seconds</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fbase..rkt%2529._or%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">or/c</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=number-types.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._number%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">number?</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._false%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">false/c</a></span><span class="RktPn">)</span><span class="hspace"> </span>=<span class="hspace"> </span><span class="RktVal">#f</span></td></tr></table></blockquote></div><div class="SIntrapara">Similar to <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%2Ffile%29%29" class="RktValLink" data-pltdoc="x">send-url/file</a></span>, but it consumes the contents of a
page to show and displays it from a temporary file.</div></p><p>When <span class="RktSym">send-url/content</span> is called, it scans old generated files
(this happens randomly, not on every call) and removes them to avoid
cluttering the temporary directory. If the <span class="RktPn">#:delete-at</span>
argument is a number, then the temporary file is more eagerly removed
after the specified number of seconds; the deletion happens in a
thread, so if Racket exits earlier, the deletion will not happen. If
the <span class="RktPn">#:delete-at</span> argument is <span class="RktVal">#f</span>, no eager deletion
happens, but old temporary files are still deleted as described
above.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>parameter</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._net/sendurl..rkt)._external-browser))"></a><span title="Provided from: net/sendurl | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="RktValDef RktValLink" data-pltdoc="x">external-browser</a></span></span><span class="RktPn"></span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._browser-preference~3f%29%29" class="RktValLink" data-pltdoc="x">browser-preference?</a></span></p></blockquote></td></tr><tr><td><span class="RktPn">(</span><span title="Provided from: net/sendurl | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="RktValDef RktValLink" data-pltdoc="x">external-browser</a></span></span><span class="hspace"> </span><span class="RktVar">cmd</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=void.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._void%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">void?</a></span></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">cmd</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._browser-preference~3f%29%29" class="RktValLink" data-pltdoc="x">browser-preference?</a></span></td></tr></table></blockquote></div><div class="SIntrapara">A parameter that can hold a procedure to override how a browser is
started, or <span class="RktVal">#f</span> to use the default platform-dependent command.</div></p><p>On Unix, the command that is used depends on the
<span class="RktVal">'</span><span class="RktVal">external-browser</span> preference. If the preference is unset,
<span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> uses the first of the browsers from
<span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._unix-browser-list%29%29" class="RktValLink" data-pltdoc="x">unix-browser-list</a></span> for which the executable is found.
Otherwise, the preference should hold a symbol indicating a known
browser (from the <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._unix-browser-list%29%29" class="RktValLink" data-pltdoc="x">unix-browser-list</a></span>), or it a pair of a prefix
and a suffix string that are concatenated around the <span class="RktSym">url</span> string
to make up a shell command to run. In addition, the
<span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="RktValLink" data-pltdoc="x">external-browser</a></span> paremeter can be set to one of these values,
and <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> will use it instead of the preference value.</p><p>Note that the URL is encoded to make it work inside shell double-quotes:
URLs can still hold characters like <span class="RktInBG"><span class="hspace"></span><span class="RktIn">#</span><span class="hspace"></span></span>, <span class="RktInBG"><span class="hspace"></span><span class="RktIn">?</span><span class="hspace"></span></span>, and
<span class="RktInBG"><span class="hspace"></span><span class="RktIn">&</span><span class="hspace"></span></span>, so if the <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="RktValLink" data-pltdoc="x">external-browser</a></span> is set to a pair of
prefix/suffix strings, they should use double quotes around the url.</p><p>If the preferred or default browser can’t be launched,
<span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> fails. See <span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Filesystem.html%23%2528def._%2528%2528lib._racket%252Ffile..rkt%2529._get-preference%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">get-preference</a></span> and
<span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=Filesystem.html%23%2528def._%2528%2528lib._racket%252Ffile..rkt%2529._put-preferences%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">put-preferences</a></span> for details on setting preferences.</p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>procedure</p></div></div><p class="RForeground"><span class="RktPn">(</span><a name="(def._((lib._net/sendurl..rkt)._browser-preference~3f))"></a><span title="Provided from: net/sendurl | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._browser-preference~3f%29%29" class="RktValDef RktValLink" data-pltdoc="x">browser-preference?</a></span></span><span class="hspace"> </span><span class="RktVar">a</span><span class="RktPn">)</span><span class="hspace"> </span>→<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=booleans.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._boolean%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">boolean?</a></span></p></blockquote></td></tr><tr><td><span class="hspace"> </span><span class="RktVar">a</span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._any%252Fc%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">any/c</a></span></td></tr></table></blockquote></div><div class="SIntrapara">Returns <span class="RktVal">#t</span> if <span class="RktSym">v</span> is a valid browser preference,
<span class="RktVal">#f</span> otherwise. See <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._external-browser%29%29" class="RktValLink" data-pltdoc="x">external-browser</a></span> for more
information.</div></p><p><div class="SIntrapara"><blockquote class="SVInsetFlow"><table cellspacing="0" cellpadding="0" class="boxed RBoxed"><tr><td><blockquote class="SubFlow"><div class="RBackgroundLabel SIEHidden"><div class="RBackgroundLabelInner"><p>value</p></div></div><p class="RForeground"><a name="(def._((lib._net/sendurl..rkt)._unix-browser-list))"></a><span title="Provided from: net/sendurl | Package: net-lib"><span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._unix-browser-list%29%29" class="RktValDef RktValLink" data-pltdoc="x">unix-browser-list</a></span></span><span class="hspace"> </span>:<span class="hspace"> </span><span class="RktPn">(</span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=data-structure-contracts.html%23%2528def._%2528%2528lib._racket%252Fcontract%252Fprivate%252Fmisc..rkt%2529._listof%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">listof</a></span><span class="hspace"> </span><span class="RktSym"><a href="http://download.racket-lang.org/docs/6.1/html/local-redirect/index.html?doc=reference&rel=symbols.html%23%2528def._%2528%2528quote._%7E23%7E25kernel%2529._symbol%7E3f%2529%2529&version=6.1" class="RktValLink Sq" data-pltdoc="x">symbol?</a></span><span class="RktPn">)</span></p></blockquote></td></tr></table></blockquote></div><div class="SIntrapara">A list of symbols representing Unix executable names that may be tried
in order by <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span>. The <span class="RktSym"><a href="#%28def._%28%28lib._net%2Fsendurl..rkt%29._send-url%29%29" class="RktValLink" data-pltdoc="x">send-url</a></span> function
internally includes information on how to launch each executable with
a URL.</div></p><div class="navsetbottom"><span class="navleft"><form class="searchform"><input class="searchbox" style="color: #888;" type="text" value="...search manuals..." title="Enter a search string to search the manuals" onkeypress="return DoSearchKey(event, this, "6.1", "../");" onfocus="this.style.color="black"; this.style.textAlign="left"; if (this.value == "...search manuals...") this.value="";" onblur="if (this.value.match(/^ *$/)) { this.style.color="#888"; this.style.textAlign="center"; this.value="...search manuals..."; }"/></form> <a href="../index.html" title="up to the documentation top" data-pltdoc="x" onclick="return GotoPLTRoot("6.1");">top</a></span><span class="navright"> <a href="ftp.html" title="backward to "5 FTP: Client"" data-pltdoc="x">← prev</a> <a href="index.html" title="up to "Net: Networking Libraries"" data-pltdoc="x">up</a> <a href="smtp.html" title="forward to "7 SMTP: Sending E-Mail"" data-pltdoc="x">next →</a></span> </div></div></div><div id="contextindicator"> </div></body></html>
|