A web scan code result accurate return jumping method and system based on browser identification
By encoding the browser type in the scanning app and querying the mapping table, accurate feedback of scanning results on web pages is achieved, solving the problem of inaccurate return of scanning results in existing technologies and improving the continuity and reliability of the interaction.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- FUJIAN JIUXING PIPE IND TECHNOLOGY CO LTD
- Filing Date
- 2026-04-27
- Publication Date
- 2026-06-19
Smart Images

Figure CN122240958A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile internet and hybrid application development technology, and more particularly to a method for developing mobile applications on the Android platform using native scanning. The QR code application receives a QR code scanning request from a web page and accurately redirects the user to the original web page based on the scan result, depending on the user's current browser type. Methods and systems. Background Technology
[0002] With the widespread adoption of H5 (HTML5) technology, more and more enterprise business systems are being deployed on mobile devices using web applications. However, due to browser security sandbox mechanisms, web pages cannot directly access the device's camera for QR code scanning.
[0003] Existing solutions mainly fall into two categories: (1) It depends on specific platform capabilities, such as the wx.scanQRCode interface provided by WeChat JS-SDK, but it is only used within WeChat and has poor universality; (2) Using a general bridging App solution: The web page invokes an independent scanning app through a custom URL scheme (such as myscanner: / / scan?callback=...). After the app completes the scanning, it returns the result through the callback URL.
[0004] However, the above general solution has significant drawbacks: After scanning the QR code, the app cannot recognize the type of browser the user initially used; The system defaults to opening the callback URL in any installed browser, causing users to be redirected from Chrome to Edge or the system's default browser; In multi-tab scenarios, it is impossible to return to the original tab, resulting in the loss of form data; Closed browser environments like WeChat strictly block external links, causing callbacks to fail directly.
[0005] Therefore, there is an urgent need for a QR code scanning result feedback mechanism that can sense and adapt to the user's current browser environment in order to ensure the continuity and reliability of web application interactions. Summary of the Invention
[0006] The purpose of this invention is to overcome the problem in the prior art that the scanning results cannot accurately jump back to the original browser, and to provide a method and system for accurate jump back of Web scanning results based on browser recognition.
[0007] To achieve the above objectives, the present invention adopts the following technical solution: When the web page launches the QR code scanning app, it proactively encodes the current browser type into the callback URL. After parsing this parameter, the QR code scanning app queries the built-in browser type-Android package name mapping table and prioritizes using Custom Tabs and specifying the target package name to achieve accurate launch. For WeChat, a two-stage redirection strategy is used to bypass its security restrictions.
[0008] The beneficial effects of this invention include: (1) Ensure that the scan result is returned to the user's original browser and tab to avoid loss of context; (2) Supports accurate recognition and redirection in mainstream Android browsers; (3) Significantly improves the success rate of scanning QR codes in special environments such as WeChat; (4) It does not depend on a specific platform SDK and has good versatility and portability. Attached Figure Description Figure 1 This is a schematic diagram of the system architecture of the present invention; Figure 2 This is a flowchart of the method for accurately bouncing back the scan results of the present invention.
Claims
1. A method and system for accurate bounce-back of Web QR code scanning results based on browser recognition, characterized in that, Includes the following steps: S1. When the web page invokes the native QR code scanning application, it identifies the current browser type through user agent information and sets the browser type accordingly. Encode it as a parameter in the callback URL; S2. After the native QR code scanning application starts, it parses the callback URL and obtains the browser type parameter carried therein; S3. Based on the pre-set mapping table between browser types and Android application package names, query the target browser corresponding to the browser type. Package name; S4. If the target browser is already installed, append the scan results to the query by using Custom Tabs technology and specifying the target browser package name. The parameters are loaded into the callback URL and opened in the target browser; S5. If the target browser is not installed or the redirection fails, then fall back to the system's default browser to open the callback URL.
2. The method as described in claim 1, characterized in that, The browser types mentioned include: Chrome, Edge, Firefox, WeChat, and Huawei. Browser, Xiaomi Browser, OPPO Browser, Vivo Browser, Samsung Browser.
3. The method as described in claim 1, characterized in that, In step S4, when the browser type is "WeChat", the following steps are executed: Two-stage redirection: First, it triggers the internal WeChat business page link weixin: / / dl / business / , then after a preset delay, it redirects via the general... The Intent redirects to a callback URL that carries the scan results.
4. The method as described in claim 1, characterized in that, The callback URL also includes a business source identifier, a timestamp, and a unique session identifier. This is used to restore the context state on the web.
5. A system for implementing the method as described in any one of claims 1–4, characterized in that, include: The web module is used to generate a QR code scanning command that carries browser type parameters; The native QR code scanning app module is used to parse browser types, call scanning services, and perform precise redirects. The browser mapping database stores the correspondence between browser types and Android package names.