Home > Backend Development > PHP Tutorial > How to determine when an external browser access is opened from WeChat?

How to determine when an external browser access is opened from WeChat?

WBOY
Release: 2023-03-02 12:16:02
Original
2264 people have browsed it

How to determine when an external browser access is opened from WeChat?

After opening a webpage in WeChat, you can select "Open in browser" in the upper right corner to open the webpage in an external browser. Is there any way to open it and determine whether this URL is brought from WeChat?

Note: I don’t want to judge whether to open this web page in WeChat. This can be done simply by using UA. I want to judge in the open external browser that the last visit was in WeChat, and I can’t judge based on the address. from parameter, because others can forge it

Reply content:

How to determine when an external browser access is opened from WeChat?

After opening a webpage in WeChat, you can select "Open in browser" in the upper right corner to open the webpage in an external browser. Is there any way to open it and determine whether this URL is brought from WeChat?

Note: I don’t want to judge whether to open this web page in WeChat. This can be done simply by using UA. I want to judge in the open external browser that the last visit was in WeChat, and I can’t judge based on the address. from parameter, because others can forge it

The original webpage URL has WeChat parameters added at the WeChat entrance. Then you can judge whether it is in WeChat by just checking whether there are parameters. Of course, if your link is in Moments and the chat is clicked, WeChat will also add relevant parameters by default, like this from=timeline, from=groupmessage from=singlemessage.

Another method is to use the UA of WeChat’s built-in browser to determine whether the webpage is opened in WeChat

Determine whether WeChat is opened:
How to determine when an external browser access is opened from WeChat?

Related labels:
source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template