Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
rshankras avatar

Webkit Integration

  • 75 installs
  • 591 repo stars
  • Updated July 24, 2026
  • rshankras/claude-code-apple-skills

Helps with ai & agent building tasks.

About

webkit-integration is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted development.

  • webkit-integration
  • AI & Agent Building
  • AI-coding skill

Webkit Integration by the numbers

  • 75 all-time installs (skills.sh)
  • +1 installs in the week ending Aug 5, 2026 (Skillselion tracking)
  • Ranked #5,486 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/rshankras/claude-code-apple-skills --skill webkit-integration

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs75
repo stars591
Last updatedJuly 24, 2026
Repositoryrshankras/claude-code-apple-skills

What it does

Helps with ai & agent building tasks.

Files

SKILL.mdMarkdownGitHub ↗

WebKit Integration for SwiftUI

Embed and control web content in SwiftUI apps using the native WebView struct and WebPage observable class. Covers loading, navigation, JavaScript execution, and view customization.

When This Skill Activates

  • User wants to display web content inside a SwiftUI app
  • User needs to load URLs, HTML strings, or data blobs in a web view
  • User asks about JavaScript interop from SwiftUI
  • User needs navigation control (back, forward, reload) for embedded web content
  • User wants to customize web view behavior (gestures, text selection, link previews)
  • User needs to capture snapshots or export PDFs from web content
  • User asks about intercepting navigation requests or custom URL schemes
  • User wants to configure private browsing or custom user agents

Decision Tree

What do you need?
|
+-- Display a URL or HTML content
|   +-- Simple, no interaction needed
|   |   +-- WebView(url:) --> see webview-basics.md
|   +-- Need loading state, reload, custom config
|       +-- WebPage + WebView(page) --> see webview-basics.md
|
+-- Navigate programmatically (back, forward, intercept)
|   +-- Back/forward list, navigation events
|   |   +-- see navigation.md
|   +-- Intercept or cancel navigation requests
|       +-- NavigationDeciding protocol --> see navigation.md
|
+-- Execute JavaScript or communicate with web content
|   +-- callJavaScript, arguments, content worlds
|       +-- see javascript-advanced.md
|
+-- Capture snapshots, export PDF, web archive
|   +-- page.snapshot(), page.pdf(), page.webArchiveData()
|       +-- see javascript-advanced.md
|
+-- Handle custom URL schemes
    +-- URLSchemeHandler protocol --> see javascript-advanced.md

API Availability

APIMinimum OSImport
WebViewiOS 26 / macOS 26SwiftUI + WebKit
WebPageiOS 26 / macOS 26WebKit
WebPage.ConfigurationiOS 26 / macOS 26WebKit
NavigationDecidingiOS 26 / macOS 26WebKit
WKContentWorldiOS 14 / macOS 11WebKit
WKSnapshotConfigurationiOS 11 / macOS 10.13WebKit
WKPDFConfigurationiOS 14 / macOS 11WebKit

Quick Start

Simplest Usage

import SwiftUI
import WebKit

struct BrowserView: View {
    var body: some View {
        WebView(url: URL(string: "https://developer.apple.com")!)
    }
}

With WebPage for Full Control

import SwiftUI
import WebKit

struct ControlledBrowserView: View {
    @State private var page = WebPage()

    var body: some View {
        WebView(page)
            .onAppear {
                page.load(URLRequest(url: URL(string: "https://developer.apple.com")!))
            }
    }
}

Top Mistakes

MistakeProblemFix
Using WebView(url:) when you need navigation controlNo access to back/forward, reload, or eventsUse WebPage + WebView(page)
Forgetting import WebKit alongside import SwiftUIWebView is in SwiftUI but WebPage requires WebKitAlways import both
Not observing currentNavigationEventMissing loading states, errors go unnoticedUse onChange(of: page.currentNavigationEvent)
Calling callJavaScript before page finishes loadingScript fails because DOM is not readyWait for .finished navigation event
Using persistent data store for private browsingUser data is saved to diskUse .nonPersistent() on WebsiteDataStore
Not handling nil return from decidePolicyFor(navigationAction:)Navigation proceeds when it should be cancelledReturn nil to cancel, return NavigationPreferences to allow
Passing JavaScript without argument bindingVulnerable to injection, hard to debugUse arguments: parameter for named values

Review Checklist

  • [ ] Using WebPage when any control beyond simple display is needed
  • [ ] Both SwiftUI and WebKit are imported
  • [ ] Navigation events observed for loading indicators and error handling
  • [ ] JavaScript execution waits for page to finish loading
  • [ ] Private browsing uses .nonPersistent() data store
  • [ ] Navigation interception returns correct values (preferences to allow, nil to cancel)
  • [ ] JavaScript arguments passed via arguments: parameter, not string interpolation
  • [ ] Custom URL scheme handler registered on configuration before page loads
  • [ ] Find-in-page enabled with findNavigator(isPresented:) if needed
  • [ ] Appropriate gesture and interaction modifiers applied (back/forward, magnification, text selection)
  • [ ] Content background customized if needed for visual integration

Reference Files

FileContents
webview-basics.mdWebView creation, WebPage setup, configuration, find-in-page, customization modifiers
navigation.mdLoading content, back/forward list, navigation events, NavigationDeciding protocol
javascript-advanced.mdJavaScript execution, content worlds, snapshots, PDF export, custom URL schemes

Cross-References

  • For macOS window management around web views, see macos/architecture-patterns/
  • For navigation architecture that hosts a web view, see ios/navigation-patterns/
  • For Liquid Glass design around web content, see design/liquid-glass/

References

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.