Skip the answer limit in Questionnaire Star WeChat - the browser pretends to be a WeChat environment

1. Background

The questionnaire released by the school is used to collect relevant personal information, but the questionnaire can only be answered in WeChat, which is not conducive to the execution of JavaScript in my browser (web page) to automatically fill in the questionnaire content script. To this end, by consulting Internet information, it is proposed that by modifying the default user agent of the browser to a user-defined user agent, the questionnaire star server can detect that my browser access is a WeChat access, thereby completing the JavaScript script in the browser to quickly fill in the questionnaire content.

2. Method

The purpose of the experiment in this paper is to solve the pop-up window that appears during the questionnaire filling process on the web page, so as to realize the script to fill in the questionnaire content and submit the questionnaire manually. The questionnaire star pop-up window on the web page is as follows:

insert image description here

There are two ways of solving the pop-up window on the web page. One way of thinking is to block the pop-up window. The experimental results show that after blocking the pop-up window and submitting the questionnaire, the webpage still detects that I am not visiting through WeChat, which makes me unable to submit the content successfully, so this method is invalid. The method is detailed here . Another way of thinking is to simulate my browser as a WeChat environment, access the Questionnaire Star questionnaire webpage through a browser disguised as a WeChat environment, and then the pop-up window can be dismissed and the questionnaire content can be successfully submitted. The specific experimental process and results of this idea are introduced below.

3. Results and Discussion

First of all, according to the operation steps proposed in this article , we can reach the network status tab of the browser. As shown below:
insert image description here

Under the Network Status tab, the browser uses the browser default settings. We get the userAgent related information of the current browser by entering navigator.userAgent in the console. The information shows that we are now accessing the questionnaire star webpage through Chrome on Windows . In order to realize that the browser disguises itself as a WeChat environment, we need to modify the userAgent to the relevant information of WeChat on the mobile phone. This information is given below:

、、、、
Mozilla/5.0 (iPhone; CPU iPhone OS 12_0 like Mac OS X) > AppleWebKit/605.1.15 (KHTML, like Gecko) Mobile/12A365 > MicroMessenger/8.0.34 NetType/WIFI
、、、、

The above information shows that the content of the information has been disguised as MicroMessenger (WeChat) on the iPhone . To do this, we copy the above information into the custom user-agent content box in your browser's network status bar and uncheck the Use browser default settings option. Next, refresh the questionnaire star webpage again, and you can find that the pop-up window has been eliminated. As shown below:

insert image description here

In the picture above, after filling in the content in the questionnaire star, click the submit button to complete the questionnaire submission.

4. Summary and Outlook

The method of modifying the browser user agent proposed in this paper solves the pop-up window that requires WeChat to access the webpage when filling out the questionnaire on the questionnaire star webpage. This method can effectively and quickly solve the pop-up window problem.

However, this method still has some shortcomings. For example, for different webpage-side questionnaires, this method needs to set user agent information on the webpage through the status bar of the webpage, which is inconvenient for users. For this reason, in the future, it can be discussed that the browser automatically activates the user agent information of the WeChat terminal when accessing the questionnaire star webpage, so as to reduce the user's manual operation process. In addition, the user agent information of the WeChat terminal can also be embedded in the JavaScript script, so that the user agent information of the WeChat terminal can be executed before the webpage is loaded to replace the default information of the browser .

Guess you like

Origin blog.csdn.net/weixin_44392735/article/details/129831275