H5 Mobile End Debug Weinre

Source: Internet
Author: User

Weinre is a word abbreviation, the full name is Web Remote review (web Inspector remote), pronounced with winery [? wa?n (?). RI]. Can be raised on the PC
Try running the page on the mobile side.

Weinre has 5 major functions

    1. Element: View/Modify DOM, view/modify Dom CSS

    2. Resources: View/Modify Localstorage, Sessionstorage

    3. Network: View Web Requests

    4. Timeline:

    5. Console: View console output

But can not do JS debugging!

Weinre principle

Target page: The page is debugged, the page has been embedded weinre remote JS, the following will be introduced;
Debug client: Local Web Inspector Debug client;
Debug Service Side (Agent): An HTTP Server that establishes communication with the debug client for the target page (target and client constantly get/post requests to the agent).

The principle is that any operation command of the client will be sent to target execution, and any operation of the same target will be sent to the client.

Installation Tutorials:

Weinre is based on the NODEJS program, install the Weinre Package (node. js needs to be installed before this)
npm install -g weinre
Start the Weinre service (proxy agent service)
weinre --boundHost 10.32.69.133 --httpPort 8888      //注意:boundHost必须为IP地址,不能为域名。

If the following is displayed, the service is started.

2016-01-19T10:37:26.772Z weinre: starting server at http://10.32.69.133:8888

Create a page and add the following JS (to represent the introduction of target/target-script-min.js from the proxy service).

<!- IP是weinre服务的IP --><script src="http://10.32.69.133:8888/target/target-script-min.js"></script>

Go to the operator interface to enjoy the operation.

Multi-Targets

WEINRE support multi-targets, different target through debug ID differentiated, Target JS full format: <script src= "{Proxy service address}:{Proxy service port}/target/ Target-script-min.js#{debug ID} "></script>
The debug ID parameter is used to distinguish between the targetd, if not pass the word with "anonymous" instead, generally with the IP address as the debug ID.

 
 

H5 Mobile End Debug Weinre

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.