wails icon indicating copy to clipboard operation
wails copied to clipboard

Add webkitgtk6 option

Open Sammy-T opened this issue 2 months ago • 15 comments

Description

This adds an option to run or build an app on Linux using webkitgtk-6.0.

Depends on:

  • gtk4

Fixes #3193

Type of change

  • [ ] Bug fix (non-breaking change which fixes an issue)
  • [x] New feature (non-breaking change which adds functionality)
  • [ ] Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • [x] This change requires a documentation update

[!IMPORTANT] Features which have been removed/deprecated from webkit or gtk4 have been marked with todos. If they can be reimplemented, using this library option could potentially match the functionality of the current implementation.

How Has This Been Tested?

  • [ ] Windows
  • [ ] macOS
  • [x] Linux

Ubuntu 22.04

The performance is usually noticeable on an app with scrolled content or a complex layout.

Running/Building the app with this PR's changes requires:

  • Setting the app's Linux program name option
  • Adding -tags webkit_6 to the Wails dev or build command

Warnings:

Message Reason?
New application windows must be added after the GApplication::startup signal has been emitted. It should already be added after the startup signal so I think this warning is more about how it's set up.

Test Configuration

# Wails
Version         | v2.10.2
Package Manager | apt


# System
WARNING: failed to read int from file: open /sys/devices/system/cpu/cpu0/online: no such file or directory
┌──────────────────────────────────────────────────────────┐
| OS           | Ubuntu                                    |
| Version      | 22.04                                     |
| ID           | ubuntu                                    |
| Branding     |                                           |
| Go Version   | go1.24.5                                  |
| Platform     | linux                                     |
| Architecture | amd64                                     |
| CPU          | Intel(R) Core(TM) i5-6300HQ CPU @ 2.30GHz |
| Memory       | 16GB                                      |
└──────────────────────────────────────────────────────────┘

# Dependencies
┌──────────────────────────────────────────────────────────────────────────┐
| Dependency | Package Name          | Status    | Version                 |
| *docker    | docker.io             | Installed |                         |
| gcc        | build-essential       | Installed | 11.4.0                  |
| libgtk-3   | libgtk-3-dev          | Installed | 3.24.33-1ubuntu2.2      |
| libwebkit  | libwebkit2gtk-4.0-dev | Installed | 2.48.5-0ubuntu0.22.04.1 |
| npm        | npm                   | Installed | 11.5.2                  |
| *nsis      | nsis                  | Available | 3.08-2                  |
| pkg-config | pkg-config            | Installed | 0.29.2-1ubuntu3         |
|                                                                          |
└──────────────────────── * - Optional Dependency ─────────────────────────┘

# Diagnosis
Optional package(s) installation details:
  - nsis: sudo apt install nsis

Requires webkitgtk-6 and gtk4.

Checklist:

  • [ ] I have updated website/src/pages/changelog.mdx with details of this PR
  • [x] My code follows the general coding style of this project
  • [x] I have performed a self-review of my own code
  • [ ] I have commented my code, particularly in hard-to-understand areas
  • [ ] I have made corresponding changes to the documentation
  • [ ] My changes generate no new warnings
  • [ ] I have added tests that prove my fix is effective or that my feature works
  • [ ] New and existing unit tests pass locally with my changes

Summary by CodeRabbit

  • New Features

    • Full WebKit 6 Linux frontend: modern webview, window lifecycle and controls, menus, clipboard, keyboard accelerators, screen detection, file dialogs, inspector/DevTools, and asset serving.
  • Chores

    • Platform split to support legacy WebKit and new WebKit 6 paths; build variants now select appropriate frontend and webview integrations.
  • New Features

    • Added WebKit6-backed request/response handling for the asset server and clipboard APIs.

✏️ Tip: You can customize this high-level summary in your review settings.

Sammy-T avatar Sep 09 '25 13:09 Sammy-T