In iOS debugging, there is a special type of request: the page is H5, runs within the app, and is loaded using WKWebView. On the surface, such requests appear similar to regular app requests, but during packet capture, some situations may arise, such as:

  1. Sometimes they can be seen directly.
  2. Sometimes only a portion is visible.
  3. Sometimes they cannot be captured via proxy.

The key is which path the WebKit request takes.


1. First, Confirm Whether the Request Is Sent by WebKit

Open a specific page in the app, for example:

  • Activity page
  • Login page (H5)
  • Embedded web page

Then make a judgment: can the same URL be opened in Safari?


Verification Method

  1. Copy the URL from the page.
  2. Paste it into Safari and open it.
  3. Compare the page behavior.

If the content is consistent, the request can be considered to originate from WebKit (WKWebView).


2. Directly Capture with Safari Web Inspector

For WebKit requests, the first step is not necessarily proxy-based capture.

You can start with Safari’s built-in tool.


Enable Web Inspector

On iPhone:

  1. Settings → Safari
  2. Open “Advanced”
  3. Enable Web Inspector

On Mac:

  1. Open Safari
  2. Menu bar → Develop
  3. Connect the device

Capture Requests

  1. Open the H5 page in the app.
  2. In Mac Safari’s “Develop” menu, select the corresponding page.
  3. Open the Network panel.

Observe Results

You can directly see:

  • XHR requests
  • Fetch requests
  • JS execution status

These data come from within WebKit.


3. When Web Inspector Is Insufficient

Web Inspector has two limitations:

  • Cannot capture all underlying requests.
  • Does not support request modification.

If you need to:

  • View complete headers
  • Analyze HTTPS
  • Modify requests

You need to use proxy-based capture.


4. Capture WebKit Requests Using a Proxy

Prepare tools:

  • Charles
  • Proxyman
  • SniffMaster

Configure Proxy

Steps:

  1. Start the proxy tool.
  2. Obtain the port (e.g., 8888).
  3. Ensure iPhone and computer are on the same Wi-Fi.
  4. Set up HTTP proxy.

Port


Install Certificate

On iPhone:

  1. Download the certificate.
  2. Install the profile.
  3. Enable trust in “Certificate Trust Settings.”

Trigger Requests

Reopen the WebView page. Observe changes.

In the proxy tool, you can see:

  • Page load requests
  • Interface requests initiated by JS

If the page originates from WebKit, these requests will pass through the proxy normally.


5. A Common Confusion Scenario

In some pages:

  • Main page requests can be captured.
  • Some interface requests cannot be captured.

At this point, observe the URL:

  • If the interface domain differs
  • Or if a special protocol is used

It may bypass the proxy.


6. Capture Packets Directly via USB Connection

When the proxy cannot capture some requests, you can use SniffMaster (Packet Capture Master).


Operation Steps

  1. Connect iPhone via USB.
  2. Keep the device unlocked.
  3. Click “Trust” on the computer.
  4. Launch SniffMaster.
  5. Select the device.
  6. Install the profile.
  7. Enter Data Stream Capture / HTTPS Brute Force Capture Mode.
  8. Click Start.

Observe Results

Here, you can see:

  • All network connections initiated by WebView
  • Including requests that did not pass through the proxy

7. Capture Only Current WebView Traffic

Device-level capture includes:

  • System requests
  • Other app requests

You can reduce interference through filtering.


Filtering Method

  1. Click Select App.
  2. Check the current app.
  3. Trigger page loading again.

App


Further Filtering

Filter by domain:

api.example.com

Quickly locate interface requests.
Filter


Methods to Modify WebKit Requests

If you need to modify requests, for example:

  • Modify interface parameters
  • Simulate response data

You need to return to proxy-based capture.


Use Proxy Interception

In Charles, Proxyman, or SniffMaster:

  1. Enable Breakpoints or open the interceptor.
  2. Refresh the page.
  3. Intercept the request.
  4. Modify parameters.
  5. Continue sending.

If HTTPS Data Is Not Visible

If in the proxy:

  • The request exists
  • But the Response is not visible

You can perform two tests:

Verification Steps

  1. Open the same URL in Safari.
  2. Check if it can be decrypted.

Determine Results

  • Safari also cannot decrypt → Certificate issue
  • Safari works normally → Page contains internal validation

At this point, you can use SniffMaster to view the data structure.