Debug the built-in browser interface of WeChat PC
Many web pages use WeChat authorization, which means that many pages can only be opened in WeChat's built-in browser. But at this time, I want to look at the code of the webpage and debug it.
Let’s solve this problem today: because the microcredit is also the Chromium kernel, just right-click and F12 are banned. The console is castrated, all we have to do is to add the console back!
View the browser kernel location
<html>
<script type="text/javascript">
window.open('chrome://version')
</script>
</html>
Run this code (http-server). As a front-end, this is not difficult to send~, and then send it to the PC of WeChat, open your website with the built-in browser
This code is mainly to see the version of chrome and the location of the kernel
Note that the red line transducer portion --resources-dir-path=
is location of the kernel
copy path behind the open. For example, mine is ( C:\Users\XXXX\AppData\Roaming\Tencent\WeChat\All Users\CefResources\2583
)
Maybe everyone’s position is different, according to your own situation
Download chrome console
You can go to a Web search devtools_resources
or use the link at the end of my article download.
After decompression is a pak
file, copied to the just opened our directory.
Modify WeChat shortcut
When 目标后面
adding this paragraph, pay attention to the spaces. Remember to save, then restart WeChat
-remote-debugging-port=8000
As for the advanced usage of CEF, you need to refer to the official documentation to test. Do not expand here. Since the PC version of WeChat has a built-in browser, it is a modified version of Chrome's shell, and most of the functions supported by Google Chrome's CEF are also supported by WeChat.
Episode
At this point, some may have succeeded, but some right-click pages still do not appear. This time we just devtools_resources.pak
pack a copy to微信安装目录
My WeChat is on the D drive, this is also different from person to person, just put it in the root directory, and then restart again
Successfully found the console
Right click again and find the console.
When it comes to the console, isn’t there anything you want?
devtools_resources download
Link: https://pan.baidu.com/s/1dOkJQaG6zxcosFvdbQA6cw
Extraction code: 4d0z