<h1>Web View API</h1><h3><tt><nowiki> (import webview)</nowiki></tt></h3>This multi-platform library for [https://www.call-cc.org/|CHICKEN]allows you to show HTML user interfaces in a window, inject JavaScriptcode and HTML content into the page and receive messages from JavaScripton the page.<h2>Web View</h2><h3><tt><nowiki> (webview? VALUE) ⇒ BOOLEAN</nowiki></tt></h3>Predicate for the tagged pointer type representing a web view window.<h3><tt><nowiki> (webview TITLE PROC [#:url URL] [#:width WIDTH] [#:height HEIGHT] [#:resizable? RESIZABLE] [#:debug? DEBUG]) ⇒ VOID</nowiki></tt></h3>Creates a web view window with the given <tt>TITLE</tt> and runs anevent loop until the user closes the window or termination is requestedusing <tt>webview-terminate!</tt>.The message callback is invoked as <tt>(PROC WEBVIEW STRING)</tt>whenever a script on the web page calls <tt>window.external.invoke(STRING)</tt>.If you specify a <tt>URL</tt> that is not <tt>#f</tt>, the page at thatlocation is loaded into the web view. Otherwise, a blank page is loadedwhich sends a <tt>"load"</tt> message when ready and contains a<tt>&lt;div id="app"&gt;</tt> element that you can fill with customcontent, for example using <tt>webview-inject</tt>.Window properties may be specified using the <tt>WIDTH</tt>,<tt>HEIGHT</tt> and <tt>RESIZABLE</tt> keyword arguments. When the<tt>DEBUG</tt> keyword argument is not <tt>#f</tt>, the web view willallow access to debugging tools, if the platform supports it.<h3><tt><nowiki> (webview-terminate! WEBVIEW) ⇒ VOID</nowiki></tt></h3>Requests termination of the event loop for the given <tt>WEBVIEW</tt>.<h3><tt><nowiki> (webview-title-set! WEBVIEW TITLE) ⇒ VOID</nowiki></tt></h3>Sets the <tt>TITLE</tt> of the given <tt>WEBVIEW</tt> window.<h3><tt><nowiki> (webview-fullscreen-set! WEBVIEW FULLSCREEN) ⇒ VOID</nowiki></tt></h3>Changes the <tt>FULLSCREEN</tt> state of the given <tt>WEBVIEW</tt>window.<h3><tt><nowiki> (webview-eval WEBVIEW SCRIPT) ⇒ VOID</nowiki></tt></h3>Asynchronously triggers evaluation of the given <tt>SCRIPT</tt> code inthe context of the page displayed by the given <tt>WEBVIEW</tt>.<h3><tt><nowiki> (webview-inject WEBVIEW ID HTML) ⇒ VOID</nowiki></tt></h3>Asynchronously triggers replacement of the DOM element with the given<tt>ID</tt> on the page displayed by the given <tt>WEBVIEW</tt> with thegiven <tt>HTML</tt> content.<tt>HTML</tt> content is specified in the form accepted by<tt>write-html</tt>.<h2>Dialogs</h2><h3><tt><nowiki> (webview-dialog WEBVIEW TITLE [VALUE] [#:open | #:save | #:error | #:warning] [#:directory]) ⇒ VALUE</nowiki></tt></h3>Shows a modal dialog with the given <tt>TITLE</tt> in the context of thegiven <tt>WEBVIEW</tt>.If the <tt>#:open</tt> or <tt>#:save</tt> flags are given, a fileselection dialog is shown and <tt>VALUE</tt> may be the path to a filethat will be pre-selected. The <tt>#:directory</tt> flag indicates thatdirectories rather than regular files should be selected. The procedurewill return the path to a selected file or <tt>#f</tt> in case thedialog is cancelled.Otherwise, a message dialog is shown and the <tt>#:error</tt> or<tt>#:warning</tt> flags may be used to switch from an information iconto a different look. In this case, <tt>VALUE</tt> is the message todisplay in the dialog and the procedure will not return a meaningfulresult.<h2>Logging</h2><h3><tt><nowiki> (webview-log MESSAGE) ⇒ VOID</nowiki></tt></h3>Outputs a message using a platform-specific logging mechanism.<h2>Content Generation</h2><h3><tt><nowiki> char-set:no-js-escape</nowiki></tt></h3>A SRFI-14 set of characters that do not need to be escaped inside aJavaScript string.<h3><tt><nowiki> (write-js STRING [PORT] [QUOTES]) ⇒ VOID</nowiki></tt></h3>Writes a <tt>STRING</tt> to the given <tt>PORT</tt> or the currentoutput port using JavaScript escaping rules. If <tt>QUOTES</tt> is givenand not <tt>#f</tt>, its content is printed before and after the<tt>STRING</tt> contents. If <tt>QUOTES</tt> is not given, double quotesare put around the string.<h3><tt><nowiki> (html-tag-rule TAG) ⇒ RULE</nowiki></tt></h3><h3><tt><nowiki> (html-tag-rule TAG RULE) ⇒ VOID</nowiki></tt></h3>Retrieves or sets the content rule for HTML elements named <tt>TAG</tt>.The <tt>RULE</tt> can be one of the symbols <tt>normal</tt>,<tt>raw</tt> or <tt>void</tt>.<h3><tt><nowiki> (write-html ELEMENT [PORT]) ⇒ VOID</nowiki></tt></h3>Writes an HTML5 rendering of the X-expression <tt>ELEMENT</tt> to thegiven <tt>PORT</tt> or the current output port.<tt>ELEMENT</tt> must conform to the following grammar:<verbatim> X-EXPR = ELEMENT | CONTENT ELEMENT = (SYMBOL ((SYMBOL CONTENT ...) ...) X-EXPR ...) ;; element with optional attributes | (SYMBOL X-EXPR ...) ;; element without attributes CONTENT = STRING ;; character data | SYMBOL ;; symbolic entity reference | INTEGER ;; numeric entity reference</verbatim>If the tag symbol of the element is <tt>html</tt>, an HTML5 documenttype declaration is written before the element itself.

This page was generated in about
0.006s by
Fossil 2.9 [0fd79a3e09] 2019-07-13 13:05:19