WebkitGtkSharp: Difference between revisions

From Wiki Maui Linux NET
Jump to navigation Jump to search
Created page with "{{Infobox software | name = WebKitGtkSharp | logo = WebKit_logo.svg | developer = GNOME Project, WebKitGTK team, Xamarin, and community contributors | released = {{Start date|2009}} | programming_language = C# | operating_system = Cross-platform | platform = .NET, Mono | genre = Web rendering library bindings | license = GNU Lesser General Public License | website = [https://github.com/GtkSharp/GtkSharp GitHub r..."
 
 
Line 78: Line 78:


== See also ==
== See also ==
* [[WebKitGTK]]
* [[GtkSharp]]
* [[GtkSharp]]
* [[GLibSharp]]
* [[GLibSharp]]
Line 84: Line 83:
* [[CairoSharp]]
* [[CairoSharp]]
* [[Mono (software)]]
* [[Mono (software)]]
* [[.NET (software framework)]]


== External links ==
== External links ==

Latest revision as of 13:19, 20 October 2025

WebKitGtkSharp
Developer(s) GNOME Project, WebKitGTK team, Xamarin, and community contributors
Initial release

2009

Latest version
Programming language C#
Operating system Cross-platform
Platform .NET, Mono
Type Web rendering library bindings
License GNU Lesser General Public License
Website GitHub repository


WebKitGtkSharp is a set of C# bindings for the WebKitGTK library, which provides a full-featured web content engine based on the WebKit rendering engine. It is part of the GtkSharp ecosystem and allows .NET and Mono applications to embed modern web browsing and HTML rendering capabilities.

Overview of WebKitGTK

WebKitGTK is the GNOME platform port of the WebKit rendering engine used in browsers such as Safari and GNOME Web (Epiphany). It provides GTK-based applications with the ability to display and interact with web content using standard web technologies like HTML, CSS, JavaScript, and SVG.

Key features of WebKitGTK include:

  • Modern web standards support (HTML5, CSS3, ECMAScript)
  • Integrated JavaScript engine (JavaScriptCore)
  • DOM manipulation and event handling
  • Web security and sandboxing
  • Offscreen and accelerated rendering
  • Custom URI schemes, network access, and inspector tools

WebKitGtkSharp

WebKitGtkSharp provides managed .NET bindings to the native WebKitGTK library. It allows C# developers to embed a full web view widget into GTK applications and interact programmatically with web content, DOM elements, and JavaScript contexts.

With WebKitGtkSharp, developers can:

  • Embed web browsers into desktop applications using GTK
  • Load and render local or remote web pages
  • Execute and interact with JavaScript from managed code
  • Handle navigation, resource loading, and DOM events
  • Build hybrid applications combining native UI and web technologies

The bindings follow the WebKitGTK API closely while providing idiomatic .NET integration, including event-based callbacks and object wrappers for DOM elements.

Relationship to other GtkSharp components

WebKitGtkSharp depends on and integrates with other GtkSharp libraries:

  • GtkSharp – Provides the container and widget system for embedding the WebView component.
  • GLibSharp – Supplies the base GObject and main loop system used by WebKitGTK.
  • GioSharp – Handles network and resource access for web content.
  • CairoSharp – Used internally for rendering web pages to GTK surfaces.

Version compatibility

WebKitGtkSharp versions correspond to the WebKitGTK and GTK releases:

  • **WebKitGtkSharp 1.x** – Based on early WebKitGTK 1.x (deprecated)
  • **WebKitGtkSharp 2.x** – Updated for WebKitGTK 2.x and GTK 3
  • **WebKitGtkSharp 4.x** – Planned for GTK 4 and modern .NET runtimes

Example

A simple example of using WebKitGtkSharp to load a web page:

using Gtk;
using WebKit;

public class Example
{
    public static void Main()
    {
        Application.Init();
        Window win = new Window("WebKitGtkSharp Example");
        WebView view = new WebView();
        win.Add(view);
        win.Resize(800, 600);
        win.DeleteEvent += (o, e) => Application.Quit();
        win.ShowAll();

        view.LoadUri("https://www.gnome.org");
        Application.Run();
    }
}

See also