App-Symbol von WebView Inspector

WebView Inspector

Eine WKWebView in Safari inspizieren

Entwicklerwerkzeuge iOS & macOS

Derzeit nicht im App Store

Kategorie
Entwicklerwerkzeuge
Läuft auf
iPhone, iPad, Mac
Entwickler
Cihat SALİK

Enable Safari Web Inspector on a WKWebView

Diese Schritt-für-Schritt-Anleitung gibt es nur auf Englisch und Türkisch. Auf Englisch lesen

Set isInspectable to true on the web view, turn on Web Inspector on the device, then choose the page in the Develop menu of Safari on a Mac. Apps linked against the iOS 16.4 and macOS 13.3 SDKs or later need this even in debug builds, because a WKWebView is not inspectable by default.

  1. Set isInspectable in your app

    let webView = WKWebView(frame: .zero, configuration: WKWebViewConfiguration())
    
    #if DEBUG
    if #available(iOS 16.4, macOS 13.3, *) {
        webView.isInspectable = true
    }
    #endif

    The property belongs to WKWebView, not to WKWebViewConfiguration, and you set it on each view. You can change it at any point in the view's life. In Objective-C it is webView.inspectable = YES. Anyone who turns on Web Inspector can inspect a view with this setting, so keep the #if DEBUG unless release builds should be inspectable too.

  2. Turn on Web Inspector on the iPhone or iPad

    Open Settings, go to Apps, then Safari, then Advanced, and turn on Web Inspector. On iOS 17 and earlier the path is Settings, Safari, Advanced. Simulators always have it on, and a Mac app does not need this step.

  3. Show the Develop menu in Safari on the Mac

    Choose Safari, then Settings, open the Advanced pane and check Show features for web developers.

  4. Open the inspector

    Connect the device with a cable and trust the Mac if the device asks. Run your app, open the Develop menu, choose the device, simulator or your Mac, then choose the page under your app's name.

If the web view is not in the Develop menu

Check that this exact view has isInspectable set, since the setting does not carry over to other views. Then check the Web Inspector switch on the device and the trust prompt. A JSContext has the same isInspectable property, and giving it a name makes it easy to find in the menu.

Apple documentation: Enabling inspecting content in your apps · Inspecting iOS and iPadOS

Looking for the app that took over this App Store listing? See Paidly: Invoice Maker

Beschreibung

WebView Inspector war ein kleines Werkzeug, um eine URL in einer WKWebView zu laden und sie aus Safari zu inspizieren. Es wurde durch Paidly ersetzt, eine andere App für Rechnungen und Angebote, und der eingebaute Browser ist weg.

Dieselbe Aufgabe lässt sich ohne eigene App lösen. Jede WKWebView in Ihrem eigenen Projekt wird mit einer Zeile Code und Safari auf einem Mac inspizierbar — mit den Schritten auf dieser Seite.

Fragen zu WebView Inspector

Auf welchen Geräten läuft WebView Inspector?
WebView Inspector läuft auf iPhone, iPad, Mac. Die App ist in SwiftUI für Apple-Plattformen geschrieben und folgt daher dem Systemdesign, dem dynamischen Schriftbild und VoiceOver.
Was kostet WebView Inspector?
WebView Inspector ist derzeit nicht im App Store. Diese Seite bleibt für Datenschutzerklärung, Nutzungsbedingungen und Support online — auch für alle, die die App noch installiert haben.
Wer macht WebView Inspector?
Cihat SALİK, ein unabhängiger Entwickler in Istanbul, schreibt und veröffentlicht WebView Inspector und alle anderen Apps hier. Den Support beantwortet dieselbe Person, die den Code geschrieben hat.
Wie bekomme ich Hilfe zu WebView Inspector?
Die Support-Seite zu WebView Inspector beantwortet die häufigsten Fragen, und eine E-Mail an [email protected] erreicht den Entwickler direkt.

Aus derselben Ecke der Spielzeugkiste

Wenn WebView Inspector Ihr Ding ist, wohnen diese Apps in derselben Nachbarschaft — alle von derselben Hand gemacht.