GitHub

/webview-quirks

WebView Quirks

Three engines, not one browser: WKWebView, WebView2 and WebKitGTK, plus static-build pitfalls.

npx skills@latest add agmmnn/desktop-feel --skill webview-quirks

Tauri, Electron · 13 rules · Updated November 28, 2026

What it does

  • Works on one OS only. Test plan per engine WQ-01
  • Blur/filters crawl on Linux. Drop or reduce on WebKitGTK WQ-02
  • Blank window or crash on Linux. DMABUF workaround WQ-03
  • Drag-and-drop sorting dead on Windows. Turn off shell file-drop handling WQ-04
  • Timers or animations stop in hidden windows. Background throttling policy WQ-05
  • API missing on macOS only. Feature-detect, polyfill WQ-06
  • Build fails with "window is not defined". No browser globals at module scope WQ-07
  • API routes / image optimization missing in the build. Static bundle only WQ-08
  • The dev window opens blank. The URL the shell loads is fixed WQ-09
  • Dev server reloads during every Rust build. Ignore src-tauri/target WQ-10
  • Window focus/size logic wrong. Ask the shell WQ-11
  • Odd WebView2 behavior after adding browser arguments. Keep the default flags WQ-12
  • Dark mode ignored or half-applied on Linux. Don't trust the media query alone WQ-13

When to use it

When something works on one OS and not another, is slow only on Linux, or the dev window is blank.

Example prompts

You don’t need special wording. Describe the problem the way you’d describe it to a teammate.

  • /webview-quirks the sidebar blur is unusably slow on Ubuntu
  • /webview-quirks drag-and-drop sorting doesn't work on Windows
  • /webview-quirks tauri dev shows a blank window

Rules

Each rule has a stable ID. Review and audit output link back here.

WQ-01Test in every engine

Minimum: macOS (WKWebView), Windows (WebView2), and the Linux distribution you support (WebKitGTK version matters). Safari Technology Preview approximates WKWebView; it is not the same as running the app.

Look for
no test plan for WKWebView / WebKitGTK
Verify on
each OS
Severity
Low

WQ-02Blur and filters on Linux

WebKitGTK has run filter: blur() and filter animations through slow CPU paths (WebKit bugs 240865, 252948, 264966); large blurs can drop to seconds per frame. On Linux: remove decorative blur, animate opacity instead of filter: opacity(), and replace backdrop-filter with a solid translucent color.

Look for
filter: blur, backdrop-filter, filter animations
Verify on
Linux
Severity
Low

WQ-03Linux rendering workaround

On some Linux GPU/driver combinations, WebKitGTK's DMABUF renderer shows a blank window or crashes. The documented workaround is the environment variable WEBKIT_DISABLE_DMABUF_RENDERER=1, at the cost of the faster path. Apply it only on Linux (launcher script or std::env::set_var before the builder runs) and only if users hit it. See Tauri's "Linux graphics issues" page.

Look for
blank window or crash on Linux with DMABUF
Verify on
Linux
Severity
Low

WQ-04HTML5 drag and drop on Windows

When the shell handles file drops (dragDropEnabled, on by default), HTML5 drag and drop inside the page doesn't work on Windows. If the UI uses HTML5 DnD (sortable lists, kanban), turn it off for that window and handle dropped files with the HTML5 API instead:

Look for
HTML5 DnD in UI with dragDropEnabled left on
Verify on
Windows
Severity
Low

WQ-05Background throttling

Engines throttle timers and requestAnimationFrame in hidden or minimized windows; WKWebView can suspend the view entirely after a few minutes. If work must continue while hidden (a timer, a recording, a sync), move it to Rust. Tauri's backgroundThrottling window policy changes this on macOS only; it is unsupported on Windows and Linux, so it can't be the whole fix.

Look for
timers/animations that must run while hidden; reliance on backgroundThrottling (macOS only)
Verify on
each OS
Severity
Low

WQ-06Late APIs on macOS

WKWebView follows Safari's release schedule and the user's macOS version. Check support for the oldest macOS you ship, feature-detect, and provide a fallback.

Look for
APIs Safari ships late, used without @supports / in checks
Verify on
macOS
Severity
Low

WQ-07No browser globals at module scope

SSG/SSR-capable frameworks (Next.js, React Router, Start, Astro, SvelteKit) prerender in Node. Top-level window, document or @tauri-apps/api usage throws at build time. Access them inside effects/onMount, or await import() them.

Look for
window, document, @tauri-apps/api imported/used at module top level in SSG frameworks
Verify on
code
Severity
Low

WQ-08Static bundle only

Tauri serves files; there is no server. SSR, API routes, server actions, ISR and next/image optimization don't exist. Next.js needs output: "export" and images.unoptimized: true. Server logic moves to Rust commands.

Look for
SSR, API routes, next/image optimization, ISR
Verify on
code
Severity
Low

WQ-09The URL the shell loads is fixed

In development the shell loads one fixed URL: Tauri's build.devUrl, or whatever Electron's main process passes to loadURL. If the dev server behind that URL picks another port because the default is taken, the window opens blank. Fix that server's port and make it fail instead of moving (strictPort: true in Vite).

Look for
the server behind Tauri devUrl or Electron loadURL without strictPort; a dev server the shell never loads doesn't count
Verify on
code
Severity
Low

WQ-10Ignore the Rust build in the dev watcher

Dev watcher ignores the Rust build.

Look for
Vite/Astro watcher not ignoring src-tauri/target
Verify on
code
Severity
Low

WQ-11Ask the shell

document.hasFocus(), screen.* and devicePixelRatio describe the web view, not the native window (focus across native windows, monitor scale, fullscreen state). Use the shell's window API for window decisions.

Look for
document.hasFocus(), screen.*, devicePixelRatio used for window decisions
Verify on
code
Severity
Low

WQ-12Keep the default browser arguments

On Windows, Tauri starts WebView2 with --disable-features=msWebOOUI,msPdfOOUI,msSmartScreenProtection. Setting additionalBrowserArgs replaces that string, so those Edge features come back. Merge your flags into the defaults instead of replacing them:

Look for
additionalBrowserArgs without msWebOOUI,msPdfOOUI,msSmartScreenProtection
Verify on
code
Severity
Medium

WQ-13Linux dark mode

On Linux, prefers-color-scheme doesn't reliably follow the GTK or desktop dark setting, and WebKitGTK only draws dark form controls for pages that declare color-scheme (DN-17). An app that themes only from the media query can stay light on a dark desktop, or end up with dark pages and light controls.

Look for
theme only from prefers-color-scheme; no in-app theme setting
Verify on
Linux
Severity
Medium

Read the full skill on GitHub