cl-webkit is a binding to [WebKitGTK+] for Common Lisp, currently targeting WebKit version 2. The WebKitGTK+ library adds web browsing capabilities to an application, leveraging the full power of the WebKit browsing engine.
The cl-webkit API closely follows the WebKit2 API, with the exception that class based interfaces are preferred over functional interfaces in cases where both are provided.
That is, *_{new,get,set}
methods are excluded in favour of
make-instance
and slot accessors wherever possible.
For documentation on how to use the WebKit2 API, please refer to the C API documentation.
Backwards compatibility (with older WebKit2 API versions) is not a priority. The binding targets the latest version of Webkit2Gtk+ available on mainstream distributions.
- A working installation of WebKit2GTK+ (whichever package provides
libwebkit2gtk-4.0.so
, e.g.,libwebkit2gtk
on Debian). - A [CFFI] compatible Common Lisp implementation. The package is developed using [SBCL] but should work on any implementation that supports CFFI.
- A recent checkout of [cl-cffi-gtk]
Assuming you have [Quicklisp] installed, do
- Clone to
~/common-lisp/quicklisp/local-projects/cl-webkit
- > lisp
- > (ql:quickload :cl-webkit2)
To run tests, you need to additionally install Calispel,
float-features and FiveAM (all of these are available via
Quicklisp). After that, simply running (asdf:test-system :cl-webkit2)
should be enough.
Contributing implies an agreement to redistribute the work under the project’s license (see below); please make sure that you own the rights to the work you contribute.
- Add message sending to all extensions in WebkitWebWebContext.
- Add user script handlers support.
- Fix the type passed to language-related functions.
- Add micro Webkit version to
*features*
.
- Remove support for Webkit shared lib version 5.0 due to libsoup conflicts.
- Add bindings for WebKitUserContentFilterStore.
- Add more properties for WebKitWebView.
- Add WEBKIT_HIT_TEST_RESULT_CONTEXT_SELECTION value for WebKitHitTestResult enum.
- Fix several implicit dependency issues.
- Fix SoapMessageHeaders’ access from WebKitURIResponse.
- Add SoapMessageHeaders bindings.
- Use them everywhere, in custom scheme processing too.
- Add WebKitWebResource bindings.
- Add WebKitUriSchemeResponse bindings and use them in scheme callbacks by default.
- Add GAction-related functions for WebKitContextMenuAction.
- Fix typing for context menu item-related functions.
- Fix string processing for custom URLs – no longer segfaulting on long strings.
- Add support for libwebkit2gtk-5.0.
- Add advanced editing commands with
webkit-web-view-execute-editing-command-with-arguments
as the way to execute those. - Bugfixes in custom schemes and color chooser requests.
- Add webkit-web-view-set-cors-allowlist, a binding for a recently (2.34.1) introduced
webkit_web_view_set_cors_allowlist
. - Bug Fix: Catch any condition in C callbacks to avoid crashing the whole Lisp process due to unhandled conditions.
- Add a binding for
webkit_web_view_try_close
.
- Add full bindings for
WebKitURIRequest
andWebKitNotification
. - Support libwebkit2gtk-4.1.
- Rename starred functions to non-starred for consistency:
webkit-web-view-can-execute-editing-command*
->webkit-web-view-can-execute-editing-command
.webkit-web-view-send-message-to-page*
->webkit-web-view-send-message-to-page
- Add
webkit-web-view-can-execute-editing-command*
for easier execution command checking.
- Export
webkit-web-view-execute-editing-command
properly.
Additions:
webkit-web-view-send-message-to-page*
to sendWebKitUserMesssages
in a nicer Lispy way.- More
WebKitSettings
settings. - Bind all the subtypes of
WebKitPermissionRequest
. - Bindings for:
webkit_user_content_manager_remove_script
webkit_user_content_manager_remove_style_sheet
- New
g-variant-get-maybe-string
: checksGVariant
for nullness and returns a contained string if possible. - The
WebKitURISchemeRequest
callbacks run on separate thread now. make-jsc-function
should return the originalJSCValue
as a second value.
Minor API-breaking changes:
webkit-web-context-register-uri-scheme-callback
now has one less optional arguments.
Bug Fixes:
- Fix mistyped JSC-related exports.
- Use :string type instead of :pointer for
WebKitUserMessage
names. - webkit2.uri-response is not loaded in cl-webkit.asd.
- Make
webkit-web-view-evaluate-javascript
process the returned values and turn them into the matching Lisp values (seejsc-value-to-lisp
docstring for transformation rules). - The callback to the
webkit-web-view-evaluate-javascript
now accepts two required arguments – the Lispy data, transformed from the results of code evaluation, and an original JSCValue it was transformed from. - Add tests (webkit2/tests/ subdirectory and
cl-webkit2/tests
system), mostly for JS evaluation results.
cl-webkit is distributed under the MIT license.
Please note that this licence only covers the binding itself. Refer to the distribution terms of the third-party dependencies for details.