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
Element: View/Modify DOM, view/modify Dom CSS
Resources: View/Modify Localstorage, Sessionstorage
Network: View Web Requests
Timeline:
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