Method, medium and device for browser version detection and automatic prompt
By using browser version detection and auto-completion methods, the development cost of subsequent browser version detection processing has been solved, enabling automated browser version prompts and webpage adaptation, thus improving user experience and website friendliness.
Patent Information
- Application Number
- CN202511682896.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2025-11-17
- Publication Date
- 2026-02-03
AI Technical Summary
In existing technologies, browser version detection and subsequent processing need to be implemented by project developers themselves, which increases development costs and difficulty. In addition, users' non-active neglect of browser version prompts leads to problems such as slow page loading or incomplete functionality.
By obtaining the user's browser UA identifier, the system uses a detector and the ThemeHandler module to compare browser kernel and version parameters, automatically outputs prompts, and uses an intelligent fingerprint comparison system to match the UI framework and theme color, generating matching CSS style sheets to achieve automatic prompts.
It reduces development costs, improves user experience, ensures optimal webpage performance, is highly adaptable, easily extensible, highly compatible, and can quickly and accurately extract website style elements.
Smart Images

Figure CN121456239A_ABST
Abstract
Description
Technical Field
[0002] This invention belongs to the field of browser management technology, specifically, it relates to a method, medium and device for browser version detection and automatic prompting. Background Technology
[0003] In today's rapidly digitalizing world, web browsers are widely used by internet users as an essential tool for information retrieval. However, intense competition among browser vendors and frequent updates to various browser versions have led to common problems for users when using certain websites or applications. These problems include slow page loading, incomplete functionality, or unusable features due to outdated browser versions. Although many websites display "Best Browsing Environment" suggestions at the bottom of their pages, these suggestions are often ineffective due to the lack of user engagement.
[0004] In existing technologies, most technologies or plugins only provide the function of browser environment detection, while the subsequent processing of the detection results still needs to be implemented by the project developers themselves, which undoubtedly increases the development cost and difficulty. Summary of the Invention
[0005] The purpose of this invention is to provide a method for browser version detection and automatic suggestion, so as to solve the technical problems existing in the prior art.
[0006] To achieve the above objectives, the technical solution adopted by the present invention is as follows: A method for browser version detection and auto-completion includes the following steps: Step S1: Obtain the user's browser UA identifier and pass the UA identifier to the detector; Step S2: Detector: Customize the browser kernel and version parameters, and compare the custom browser kernel and version parameters with the UA identifier in step S1. If the detection passes, exit; if the detection fails, trigger the include mechanism to check again whether the current browser is within the supported range. If it is within the supported range, enter the ThemeHandler module; if it is not within the supported range, output the forced reminder page output1. Step S3: Using the ThemeHandler module, obtain the UI framework and theme color of the webpage. Specifically, perform the following steps: (31) Call the getAllClassNames method to get the className data of all nodes on the webpage and output a collection; (32) In the intelligentFingerprintAnalyzer method, the collection is compared and analyzed with the built-in or custom fingerprint data to obtain the UI framework identifier of the current webpage; (33) Match the UI framework identifier with the framework configuration table built into the ThemeHandler module. The configuration table contains the core features of each framework. (34) After matching the corresponding framework configuration table, traverse the attributes in the configuration table and convert the key / value into the corresponding DOM node; (35) Match the theme color of the webpage: Call the getThemeColor method to obtain all the resources referenced in the link[rel=”stylesheet”] on the webpage and the style tag through network request, read the content, and grab the core attributes and corresponding DOM node names; use the data comparison and analysis capabilities provided by AIModel to analyze the main color and its derivative colors matched by the webpage through the weight ratio algorithm; (36) Combine the DOM nodes in (34) to generate matching CSS style sheets, and finally output visual elements that match the UI framework style of the web page on the web page, and all visual elements have independent style scope. Step S4: Output the standard prompt output2.
[0007] Preferably, the specific implementation method of step S1 is as follows: (11) Obtain the user's original UA string by using cross-browser compatibility technology through the standard HTTP protocol; (12) Through a multi-level weighted fuzzy matching and semantic parsing model, the original UA string is deeply analyzed to obtain the browser's structured identifier data, including: browser core engine type, version number, and special effects flag bit; (13) Based on the structured identifier data, apply the feature importance evaluation algorithm to filter feature fields that have a decisive impact on browser rendering behavior or API compatibility, and generate a set of core browser identifiers with high confidence. (14) Perform data cleaning on the core browser identifier set to filter out redundant information.
[0008] Preferably, the multi-level weighted fuzzy matching and semantic parsing model includes: Dynamic rule matching layer: Loads a dynamically updated browser feature rule library and uses regular expressions and keyword weighted matching to initially identify browser type; Fragmentation Pattern Recognition Layer: A clustering algorithm trained on a historical User Agent (UA) dataset identifies potential browser engine patterns that are non-standard or disguised UAs. Version number semantic parsing layer: Perform version number structure analysis on the successfully matched UA field, extract the major version, minor version and build number and calculate the version confidence.
[0009] Preferably, the feature importance evaluation algorithm performs the following steps: based on a predefined browser feature influence weight table, calculate the contribution of each identifier to the target feature; retain only the top K high-value features whose total contribution exceeds a global threshold; The contribution of each identifier to the target characteristic is calculated as follows:
[0010] in, Identifier The basic weights, Representing target characteristics The domain importance coefficient, This represents a binary influence indicator function; The sum of the contributions of each identifier is calculated as follows: .
[0011] Preferably, in step S2, when the forced reminder page fills the entire browser screen and the forced reminder page output1 is output, the original webpage rendering content is cleared.
[0012] Preferably, the comparative analysis in (32) is implemented as follows: (321) Before conducting comparative analysis, the className data of the web page nodes is preprocessed; (322) Use a feature extraction algorithm to convert the className data into a feature representation that the model can understand; (323) Construct an intelligent fingerprint comparison system using deep learning models or machine learning models; (324) The intelligent fingerprint comparison system learns the correlation and pattern between data, identifies the information in the className data set that matches the preset fingerprint data the most, and thus determines the UI framework identifier of the current webpage.
[0013] Preferably, in step (34), if no match is found, the default configuration option is used.
[0014] To achieve the above objectives, the present invention also provides a computer-readable storage medium having a computer program stored thereon, the computer program being executed by a processor to implement the method for browser version detection and automatic prompting.
[0015] To achieve the above objectives, the present invention also provides an apparatus for browser version detection and automatic suggestion, comprising: a processor and a memory; the memory for storing a computer program; the processor being connected to the memory and for executing the computer program stored in the memory, so that the apparatus for browser version detection and automatic suggestion performs the method for browser version detection and automatic suggestion.
[0016] Compared with the prior art, the present invention has the following beneficial effects: (1) The present invention has excellent adaptability: it can be used in both traditional js+html projects and new projects that conform to modern front-end specifications such as Node.js, VUE, Nuxt, etc., and the access cost is very low.
[0017] (2) The user experience of the present invention is good: when users browse the site, the warm prompts solve the bad experience caused by webpage compatibility problems and greatly improve the user experience.
[0018] (3) The present invention has good extensibility: the supported browser types and their minimum versions, as well as the output element node styles, can be customized as needed to meet the needs of different websites.
[0019] (4) The present invention has good compatibility: The present invention is written in highly compatible ES5 syntax, which has sufficient backward compatibility and ensures user experience.
[0020] (5) The present invention provides a built-in method that can quickly and accurately extract the style elements of the current website and output the element content that matches them. Attached Figure Description
[0021] Figure 1 This is a principle block diagram of Embodiment 3 of the present invention. Detailed Implementation
[0022] To enable those skilled in the art to have a clearer understanding of the present invention, the present invention will be further described in detail below with reference to embodiments. It should be understood that the specific embodiments described below are merely for illustrative purposes and to facilitate understanding. The technical solutions provided by the present invention are not limited to those provided in the following embodiments, nor should they limit the scope of protection of the present invention.
[0023] It should be noted that the illustrations provided in the following embodiments are only schematic representations of the basic concept of the present invention. Therefore, the drawings only show the components related to the present invention and are not drawn according to the actual number, shape and size of the components in the actual implementation. In the actual implementation, the shape, quantity and proportion of each component can be arbitrarily changed, and the layout of the components may also be more complex.
[0024] Example 1 This embodiment provides a method for browser version detection and automatic suggestion. The method actively collects the user's browser type and version information, compares it with the preset or custom browser version, and pops up a friendly reminder for users with outdated versions, recommending that they upgrade to a higher and more stable browser version. It can also actively block users with outdated browser versions from accessing the site and provide clear prompts to ensure the best webpage experience. In this process, the invention can intelligently extract the main color and interaction style of the current website, enabling rapid adaptation, while minimizing the workload of secondary development or integration for developers using the invention.
[0025] In this embodiment, the method for browser version detection and automatic suggestion specifically includes the following steps: Step S1: Obtain the User Agent (UA) identifier of the user's browser. NormalizeUserAgent: By using the standard HTTP protocol and cross-browser compatibility technology, it ensures reliable acquisition of the User Agent (UA) identifier and obtains the user's original UA string in various browser environments.
[0026] By using a multi-level weighted fuzzy matching and semantic parsing model, the original UA string is deeply analyzed to obtain the browser's structured identifier data, including: browser core engine type (the basic feature that determines the browser's rendering behavior), version number (the key basis for extracting version-sensitive features), and special effects flags (direct input for importance assessment).
[0027] In this step, the multi-level weighted fuzzy matching and semantic parsing model includes: Dynamic Rule Matching Layer: Loads a dynamically updated browser feature rule library (containing regular expressions and feature keywords for browser kernel, shell, and version number patterns), and initially identifies the browser type through weighted matching of regular expressions and keywords. Base Type: An extensible weighted rule engine, components of which include: Regular Expression Rule Library: Pre-built UA pattern regular expressions for browser kernel / shell (e.g., / (Chrome|CriOS)\ / (\d+\.\d+) / ); Keyword Weight Table: Assigns weights to feature words (e.g., "Edg / " → Edge weight +0.9, "OPR / " → Opera weight +0.8).
[0028] Fragmentation Pattern Recognition Layer: A clustering algorithm trained on a historical User Agent (UA) dataset identifies potential browser engine patterns for non-standard or spoofed UAs. This layer uses an unsupervised clustering algorithm to vectorize the features of the historical UA dataset, identifying hidden browser engine patterns in low-frequency, unconventional UA strings. Base Type: Lightweight unsupervised clustering model, with DBSCAN clustering algorithm as the preferred algorithm. Example of feature vectorization methods: character n-gram frequency (e.g., Trident → ['Tri', 'rid', 'ide', 'den']); special symbol density (statistical distribution of / , _, .).
[0029] Version Number Semantic Parsing Layer: This layer performs version number structure analysis on successfully matched User Agent (UA) fields, extracting the major version, minor version, and build number, and calculating version confidence (e.g., probability output based on version field completeness (e.g., field missing rate > 50% → confidence = 0.3)). This layer parses version fields using a predefined version number syntax rule tree (e.g., <major version>.<minor version>.<revision number> + <build number>). Non-standard version formats (e.g., those containing letters or dates) are normalized using regular expression capture groups and a semantic mapping table. Base Type: Parser based on the syntax rule tree.
[0030] Finally, the outputs of each layer are fused into structured identifier data through a weighted geometric average algorithm. The initial weights of the outputs of each layer are as follows: dynamic rule matching layer weight 0.4, fragmented pattern recognition layer weight 0.3, and version number semantic parsing layer weight 0.3. Based on this, the weights can be dynamically adjusted according to the historical accuracy of each layer.
[0031] Based on the above design, fuzzy matching (fault tolerance), semantic parsing (understanding version structure) and weighted decision-making are integrated. Machine learning or pattern mining techniques are introduced to handle long-tail, non-standard or customized UAs (such as some domestic browsers and web crawlers disguised as UAs) that are difficult to cover with fixed rules, thereby improving coverage and recognition rate. Compared with existing conventional single models, it significantly improves the ability and accuracy of identifying complex, fragmented and disguised UAs.
[0032] Based on structured identifier data, a feature importance assessment algorithm is applied to select feature fields that have a decisive impact on browser rendering behavior or API compatibility, generating a high-confidence core browser identifier set. The feature importance assessment algorithm performs the following steps: based on a predefined browser feature influence weight table, the contribution of each identifier to the target feature is calculated; only the top K high-value features whose total contribution exceeds a global threshold are retained, where K is a preset value or dynamically adjusted by feature entropy.
[0033] The weighting of browser characteristics is shown in the table below:
[0034] For identifier For target characteristics The calculation method for the basic contribution is as follows:
[0035] in, Identifier The basic weights, Representing target characteristics The domain importance coefficient, This represents a binary influence indicator function, if Influence ,but It takes the value 1, otherwise it takes the value 0.
[0036] The target characteristic domain coefficient table is as follows:
[0037] identifier The method for calculating the overall contribution of all features is as follows:
[0038] in, The significance lies in the fact that the squared term strengthens the weight of high-value characteristics.
[0039] Calculation example: Chrome browser Identifier: blink_version=125.0.6422.0 Target characteristics: Rendering behavior (T1), API compatibility (T2) 1. Basic parameters: = 0.9, =1.0, =0.9, ,
[0040] ,
[0041] The overall contribution of the identifier to all features: [0.9 x1.0x1x0.553]+[0.9 x0.9 x1x 0.447]=0.860 Through the above design, the feature set is simplified, significantly reducing the consumption of computing resources; at the same time, the prediction accuracy of key behaviors (such as browser rendering behavior) and the coverage of version-sensitive features are improved, and the error rate of API compatibility identification is reduced.
[0042] The core browser identifier set is cleaned to filter out redundant information. Existing conventional techniques can be used for data cleaning, such as information entropy fusion weighting algorithms, which will not be elaborated here. After obtaining the final user browser UA identifier, the UA identifier is passed to the detector, which then performs the next step.
[0043] II. Step S2: Detector execution steps In this embodiment, the detector supports custom browser kernel and version parameters. By customizing the browser kernel and version parameters and comparing them with the UA identifier in step S1, if the detection passes, the process exits; if the detection fails, the include mechanism is triggered to re-verify whether the current browser is within the supported range. If it is within the supported range, the ThemeHandler module is entered; if it is not within the supported range, a forced reminder page (output1) is output. When the forced reminder page fills the entire browser screen and output1 is output, the original webpage rendering content has already been cleared by the program.
[0044] 3. Step S3: Use the ThemeHandler module to obtain the UI framework (if any) and theme color of the webpage. Generally speaking, different UI frameworks add specific identifiers, or fingerprints, when setting styles for the DOM to ensure the correct display of their styles. ThemeHandler has a built-in set of fingerprint data for mainstream UI frameworks and also supports custom fingerprint data to meet different needs. The ThemeHandler module specifically executes the following steps: (31) Call the getAllClassNames method to get the className data of all nodes on the webpage and output a collection; (32) In the intelligentFingerprintAnalyzer method, the set is compared and analyzed with the built-in or custom fingerprint data to obtain the UI framework identifier of the current webpage; in this step, the implementation method of the comparison analysis is as follows: (321) Before the comparison analysis, the className data of the webpage node is preprocessed (including removing noise data, deduplication, and standardization processing to ensure the consistency and accuracy of the data); (322) Using feature extraction algorithms, the className data is converted into a feature representation form that the model can understand (such as TF-IDF, word embedding, etc., so that the model can understand and compare the analysis later); (323) A deep learning model or machine learning model (such as neural network, Bayesian classifier, etc.) is used to build an intelligent fingerprint comparison system; (324) The intelligent fingerprint comparison system learns the correlation and pattern between the data and identifies the information in the className data set that matches the preset fingerprint data the most, thereby determining the UI framework identifier of the current webpage; if the framework identifier is not obtained, the default UI framework elementui in the built-in data is enabled; (33) Match the UI framework identifier with the framework configuration table built into the ThemeHandler module. The configuration table contains the core features of each framework. (34) After matching the corresponding framework configuration table, iterate through the attributes in the configuration table and convert the key / value into the corresponding DOM node. The program will integrate information of most of the current mainstream frameworks. If no match is found, the program's default configuration items will be used. (35) Match the theme color of the webpage: Call the getThemeColor method to obtain all resources referenced in the link[rel=”stylesheet”] on the webpage and the style tag through network request, read the content, and grab the core attributes (background-color, border-color, color) and the corresponding DOM node names (such as div, p, button, etc.); use the data comparison and analysis capabilities provided by AIModel, and analyze the main color and its derivative colors matched by the webpage through the weight ratio algorithm. The analysis and comparison process is the same as the process of analyzing the UI framework, but the focus and weight logic are different. The comparison method and comparison tools are the same. (36) Combine the DOM nodes in (34) to generate matching CSS style sheets, and finally output visual elements that match the UI framework style of the web page on the web page. All visual elements have independent style scope. Specifically, the style settings are identified by unique codes, which will not cause problems such as duplicate names or style weight, and will not cause style conflicts with the original website.
[0045] IV. Step S4: Output the standard prompt output2 Regular notifications will be displayed prominently on the page, alerting users to potential risks without interfering with their operation of the current webpage. Users can manually close the notification and continue using the site. The frequency of these notifications is determined through intelligent analysis of user website usage patterns, aiming to minimize disruption to the user experience.
[0046] Through the above steps, the entire process of this invention is completed. For different users accessing different websites using different browsers, this invention can quickly and accurately detect and automatically remind users, greatly improving the friendliness of the website and the user experience, and indirectly increasing the user stickiness of the website.
[0047] Example 2 This embodiment provides a computer-readable storage medium on which a computer program is stored. The computer program is executed by a processor to implement the method for browser version detection and automatic suggestion provided in Embodiment 1. Those skilled in the art will understand that all or part of the steps of the method provided in Embodiment 1 can be implemented by hardware related to the computer program. The aforementioned computer program can be stored in a computer-readable storage medium. When the program is executed, it performs the steps of the method provided in Embodiment 1. The aforementioned storage medium includes various media capable of storing program code, such as ROM, RAM, magnetic disks, or optical disks.
[0048] Example 3 like Figure 1 As shown, this embodiment provides an apparatus for browser version detection and automatic suggestion, including: a processor and a memory; the memory is used to store a computer program; the processor is connected to the memory and is used to execute the computer program stored in the memory, so that the apparatus for browser version detection and automatic suggestion performs the method for browser version detection and automatic suggestion provided in Embodiment 1.
[0049] Specifically, memory includes various media that can store program code, such as ROM, RAM, magnetic disks, USB flash drives, memory cards, or optical discs.
[0050] Preferably, the processor can be a general-purpose processor, including a central processing unit (CPU), a network processor, etc.; it can also be a digital signal processor, an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, discrete gate or transistor logic devices, or discrete hardware components. The above embodiments are merely illustrative of the principles and effects of the present invention and are not intended to limit the invention. Any person skilled in the art can modify or change the above embodiments without departing from the spirit and scope of the present invention. Therefore, all equivalent modifications or changes made by those skilled in the art without departing from the spirit and technical concept disclosed in the present invention should still be covered by the claims of the present invention.
Claims
1. A method for browser version detection and automatic suggestion, characterized in that, Includes the following steps: Step S1: Obtain the user's browser UA identifier and pass the UA identifier to the detector; Step S2: Detector: Customize the browser kernel and version parameters, and compare the custom browser kernel and version parameters with the UA identifier in step S1. If the detection passes, exit; if the detection fails, trigger the include mechanism to check again whether the current browser is within the supported range. If it is within the supported range, enter the ThemeHandler module; if it is not within the supported range, output the forced reminder page output1. Step S3: Using the ThemeHandler module, obtain the UI framework and theme color of the webpage. Specifically, perform the following steps: (31) Call the getAllClassNames method to get the className data of all nodes on the webpage and output a collection; (32) In the intelligentFingerprintAnalyzer method, the collection is compared and analyzed with the built-in or custom fingerprint data to obtain the UI framework identifier of the current webpage; (33) Match the UI framework identifier with the framework configuration table built into the ThemeHandler module. The configuration table contains the core features of each framework. (34) After matching the corresponding framework configuration table, traverse the attributes in the configuration table and convert the key / value into the corresponding DOM node; (35) Match the theme color of the webpage: Call the getThemeColor method to obtain all the resources referenced in the link[rel=”stylesheet”] on the webpage and the style tag through network request, read the content, and grab the core attributes and corresponding DOM node names; use the data comparison and analysis capabilities provided by AIModel to analyze the main color and its derivative colors matched by the webpage through the weight ratio algorithm; (36) Combine the DOM nodes in (34) to generate matching CSS style sheets, and finally output visual elements that match the UI framework style of the web page on the web page, and all visual elements have independent style scope. Step S4: Output the standard prompt output2.
2. The method for browser version detection and automatic suggestion according to claim 1, characterized in that, The specific implementation method of step S1 is as follows: (11) Obtain the user's original UA string by using cross-browser compatibility technology through the standard HTTP protocol; (12) Through a multi-level weighted fuzzy matching and semantic parsing model, the original UA string is deeply analyzed to obtain the browser's structured identifier data, including: browser core engine type, version number, and special effects flag bit; (13) Based on the structured identifier data, apply the feature importance evaluation algorithm to filter feature fields that have a decisive impact on browser rendering behavior or API compatibility, and generate a set of core browser identifiers with high confidence. (14) Perform data cleaning on the core browser identifier set to filter out redundant information.
3. The method for browser version detection and automatic suggestion according to claim 2, characterized in that, The multi-level weighted fuzzy matching and semantic parsing model includes: Dynamic rule matching layer: Loads a dynamically updated browser feature rule library and uses regular expressions and keyword weighted matching to initially identify browser type; Fragmentation Pattern Recognition Layer: A clustering algorithm trained on a historical User Agent (UA) dataset identifies potential browser engine patterns that are non-standard or disguised UAs. Version number semantic parsing layer: Perform version number structure analysis on the successfully matched UA field, extract the major version, minor version and build number and calculate the version confidence.
4. The method for browser version detection and automatic suggestion according to claim 3, characterized in that, The feature importance evaluation algorithm performs the following steps: based on a predefined browser feature influence weight table, calculate the contribution of each identifier to the target feature; retain only the top K high-value features whose total contribution exceeds the global threshold; The contribution of each identifier to the target characteristic is calculated as follows: ,in, Identifier The basic weights, Representing target characteristics The domain importance coefficient, This represents a binary influence indicator function; The sum of the contributions of each identifier is calculated as follows: 。 5. The method for browser version detection and automatic suggestion according to claim 4, characterized in that, In step S2, when the forced reminder page fills the entire browser screen and outputs the forced reminder page output1, the original webpage rendering content is cleared.
6. The method for browser version detection and automatic suggestion according to claim 5, characterized in that, The comparative analysis in (32) is implemented as follows: (321) Before conducting comparative analysis, the className data of the web page nodes is preprocessed; (322) Use a feature extraction algorithm to convert the className data into a feature representation that the model can understand; (323) Construct an intelligent fingerprint comparison system using deep learning models or machine learning models; (324) The intelligent fingerprint comparison system learns the correlation and pattern between data, identifies the information in the className data set that matches the preset fingerprint data the most, and thus determines the UI framework identifier of the current webpage.
7. The method for browser version detection and automatic suggestion according to claim 6, characterized in that, In step (34), if no match is found, the default configuration option is used.
8. A computer-readable storage medium having a computer program stored thereon, characterized in that, The computer program is executed by a processor to implement the method for browser version detection and automatic prompting as described in any one of claims 1 to 7.
9. A device for browser version detection and automatic suggestion, characterized in that, include: Processor and memory; The memory is used to store computer programs; the processor is connected to the memory and is used to execute the computer programs stored in the memory, so that the device for browser version detection and automatic prompting performs the method for browser version detection and automatic prompting as described in any one of claims 1 to 7.