47.2 Embedded WebKit Widgets

If Emacs was compiled with the appropriate support packages, it is able to show browser widgets in its buffers. The command M-x xwidget-webkit-browse-url asks for a URL to display in the browser widget. The URL normally defaults to the URL at or before point, but if there is an active region (see The Mark and the Region), the default URL comes from the region instead, after removing any whitespace from it. The command then creates a new buffer with the embedded browser showing the specified URL. The buffer is put in the Xwidget-WebKit mode (similar to Image mode, see Viewing Image Files), which provides one-key commands for scrolling the widget, changing its size, and reloading it. Type C-h b in that buffer to see the key bindings.

By default, typing a self-inserting character inside an xwidget webkit buffer will do nothing, or trigger some special action. To make those characters and other common editing keys insert themselves when pressed, you can enable xwidget-webkit-edit-mode, which redefines them to be passed through to the WebKit xwidget.

You can also enable xwidget-webkit-edit-mode by typing e inside the xwidget webkit buffer.

xwidget-webkit-isearch-mode is a minor mode that behaves similarly to incremental search (see Incremental Search), but operates on the contents of a WebKit widget instead of the current buffer. It is bound to C-s and C-r inside xwidget-webkit buffers. When it is invoked by C-r, the initial search will be performed in reverse direction.

Typing any self-inserting character will cause the character to be inserted into the current search query. Typing C-s will cause the WebKit widget to display the next search result, while typing C-r will cause it to display the previous one.

To leave incremental search, you can type C-g.

The command xwidget-webkit-browse-history displays a buffer containing a list of pages previously loaded by the current WebKit buffer, and lets you navigate to those pages by hitting RET.

It is bound to H.