A boolean specifying whether debugging mode is on or not.
A string specifying the initial URL.
browser-pane is a pane that embeds a pane that can display HTML. Navigation in the pane happens either by the user clicking on hyperlinks, or by the application using browser-pane-navigate. The various callbacks gives the program information on what happens in the window and can be used to control (for example, to block or redirect pages).
When before-navigate-callback is non-nil, it is called before any navigation (whether programmatic or by the user), and gives the application control over whether to perform the navigation. The callback must have this signature:
is the pane that navigates, and
is a string to which it wants to navigate.
is true when the navigation is for a sub-frame inside the current URL, otherwise
nil or the name of a sub-frame when the navigation is to a sub-frame.
To perform a redirection, just call browser-pane-navigate to the required URL, and return
pane is the pane that wants to open a new window, and url is a string containing the URL that the new window will navigate to. context is a string containing the URL of the page from which the request comes.
On Microsoft Windows, new-window-callback is invoked from the "NewWindow3" event (or "NewWindow2" for old versions) of the sink of the underlying IWebBrowser2. If not cancelled, the pane opens a new normal Internet Explorer window.
document-complete-callback is called when, as far as the system is concerned, all the data for the URL has been loaded and is displayed in the pane. There is only one call to document-complete-callback for each navigation of the pane.
If navigate-complete-callback is non-nil, it is called whenever a navigation completes. navigate-complete-callback can be called several times for each navigation of the pane. It must be a function with the signature:
Notes: For most purposes the
is more useful than
, the value of the URL in the pane (that is, what the accessor
browser-pane-url returns) is still set to the actual URL. The success flag (which you can read with
browser-pane-successful-p) is set to
can be non-nil even if there was an error in the navigation, if the server supplied another URL. In this case, on Microsoft Windows only, the success flag is set to
:redirected. You can read it with
On Microsoft Windows
is the code in the "NavigateError" event. If
is non-nil then
will be the same. On Cocoa
will be the same as
in the case of server-side failure, otherwise it is one of the
On Microsoft Windows this means displaying either the substitution page from the server if there is one, or displaying automatically generated (by the underlying IWebBrowser2) error page.
Cancel. On Microsoft Windows this means not displaying the automatically generated error page, but displaying server substitution if there is any.
Stop the navigation immediately.
To redirect on error,
should just call browser-pane-navigate with the new page and return
Other panes that are used to go forward in the pane should be enabled or disabled.
Other panes that are used to go backward in the pane should be enabled or disabled.
Other panes that may try to anything with the pane may need updating. Note that this callback is called quite often with
t, so make sure it usually does not do much work in this case.
event-name is a string specifying the event. args is a vector containing the arguments in order. The callback is called before any code that is used to implement the callbacks, which is called afterwards with the same argument vector. That means that the callback should not set anything in the vector, except when debugging.
is intended to add functionality that is not given by the callbacks, and for debugging (but see also
:debug). If you need more control, you probably want to define your pane directly: for the basics see:
specifies that the pane should be in debugging mode. Currently, on Microsoft Windows this means that it prints each event and the arguments that it receives. Whenever an event is sent to the sink associated with the embedded browser, the method name (which is the same as the event name in this case) and the argument are printed to
mp:*background-standard-output*. On Cocoa it prints some diagnostics to
browse-pane-url returns the current
of the pane. Initially the value is the keyword
:url, but once the browser completed navigation to some URL it is changed to this. Note that the
changes even if the navigation was not successful, as long as it was not stopped or cancelled and there was no substitution page.
browse-pane-title returns the title of the current document. Note that during navigation
browse-pane-url may not be synchronised. They are synchronised when
is called, until the next
browser-pane-successful-p tests whether the navigation to the current URL completed successfully, returning
nil for failure and
t for success. On Microsoft Windows only it can also return
:substituted, which means that the server returned an error but also supplied a substitution page. On Cocoa,
browser-pane-successful-p returns only
CAPI User Guide and Reference Manual (Windows version) - 25 Feb 2015