1, installation Weinre
Weinre Official website: http://people.apache.org/~pmuellr/weinre/docs/latest/Home.html
There are two types of installation available: NPM installs and downloads the installation package.
We use the NPM installation method as an example to install.
1) We need to install node. JS first. node. JS Official website: https://nodejs.org/
You can choose the appropriate version to download according to your operating system. Here I use WINDOWS10 (64) as an example to install.
When the installation is complete, open the Windows command prompt and enter the ' NPM ' command.
If such information appears, it indicates that node. JS installation succeeded.
2) Install weinre via NPM below.
Open the Windows command prompt and enter the "NPM install-g weinre" command.
If such information appears, the Weinre installation is successful.
3) After the installation is complete, you need to open a local listening server, such as my current IP address is: 10.203.18.117.
Open the Windows command prompt, enter the Weinre–httpprot 9999 (enter a custom port number) –boundhost 10.203.18.117 (Listener server IP address) command to enter.
appears, indicating a successful listener.
2. Access to Weinre and commissioning
1) In the browser, enter the listening address of the setting: http://10.203.18.117:9999
2) Introduce a remote call page.
View the example of the Target script description in the Listener address:
<script src= "Http://10.203.18.117:9999/target/target-script-min.js#anonymous" ></script>
Put the reference in the project. For example:.. Foxitsoftware\webpdf\viewer\webapp\mobile\index.html.
The example JS code is introduced to the index.html page.
3) Access call.
Now, we use our mobile phone to access our project address. Then look at the page you just clicked in.
Click [Elements] to view the HTML elements and modify the corresponding CSS code.
The selected style, in the phone, is marked with a pink effect.
Ps: Problems that may occur during installation
When I open the Windows command prompt, I enter "weinre" to prompt "not an internal or external command, or a program or batch file that can be run." 】
Solution Description:
(1) The Weinre installation path (c:\users\foxit\appdata|roaming\npm\) needs to be placed in the node. JS Path (the author path is C:\Program Files\nodejs).
:
(2) Configuring environment variables for Nodejs
Reopen the Windows command prompt and enter "weinre" to take effect.
Mobile Web Debugging Tools weinre instructions for use