iOS dev Safari Debug WebView page

Source: Internet
Author: User

App Hybrid development is now the norm, but as an app developer, the use of H5 pages can not be easily limited to use, some simple debugging methods are necessary to understand.

Here's a quick step on how to debug content within the Web using the WebView process.

A true machine or simulator opens the Web Inspector, "Settings", "Safari", "Advanced"

Second, open the computer Safari, "preferences", "Advanced", "Show development options in the menu bar"


I'll test it using the simulator below.

Third, at this time, we do not run the app, you can check the simulator first, found that there is no things.

Four, then we run the app and open a webview to load a H5 page. To see step three here, you will find the following:

Inside the red box is the WebView page we're running.

We open Safari, click on the red box above, will pop up a page checker, similar to:

Here is the content on the WebView, we can do some debugging, with Windows under F12 Debugging a truth.

In the pop-up page inspector, you can see the various information that is currently loading the Web page, including the source code, network, resources and scripts, console output, and so on. And it and the Web front-end debugging the same way, you can directly modify the CSS style of the Web page, the layout of the source code and other changes, using the debugger for script debugging, without the need to rerun the entire app.

Five, this side I use "Baidu" example

1, WebView load Baidu website "http://www.baidu.com"

2. Open Safari's Web checker

3, for example, I want to change these names

Follow steps 1, 2, 3:

The final results are as follows:

Of course this is the most basic and simplest operation, like other changes in the font size, label length, etc., you can try to see

If you know a bit of front-end Web development, then the more powerful, web debugging ...

Enjoy ~

iOS dev Safari Debug WebView page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.