CN107133165B - Browser compatibility detection method and device - Google Patents
Browser compatibility detection method and device Download PDFInfo
- Publication number
- CN107133165B CN107133165B CN201710174275.0A CN201710174275A CN107133165B CN 107133165 B CN107133165 B CN 107133165B CN 201710174275 A CN201710174275 A CN 201710174275A CN 107133165 B CN107133165 B CN 107133165B
- Authority
- CN
- China
- Prior art keywords
- browser
- page
- detection
- detection characteristic
- target
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F11/00—Error detection; Error correction; Monitoring
- G06F11/36—Prevention of errors by analysis, debugging or testing of software
- G06F11/3604—Analysis of software for verifying properties of programs
- G06F11/3608—Analysis of software for verifying properties of programs using formal methods, e.g. model checking, abstract interpretation
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Computer Hardware Design (AREA)
- Quality & Reliability (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Debugging And Monitoring (AREA)
- Information Transfer Between Computers (AREA)
- User Interface Of Digital Computer (AREA)
Abstract
The invention discloses a browser compatibility detection method and device. Wherein, the method comprises the following steps: acquiring page resources of a target page to be detected; judging whether the service code corresponding to the page resource is matched with each detection characteristic logic, wherein the detection characteristic logic is a matching expression matched with the browser characteristics, and the browser is used for displaying a target page; and if the business code corresponding to the page resource is judged not to be matched with the at least one detection characteristic logic, obtaining a detection result, wherein the detection result is used for indicating that the business code is not compatible with the browser. The invention solves the technical problem of lower detection accuracy caused by adopting the existing compatible detection mode.
Description
Technical Field
The invention relates to the field of computers, in particular to a browser compatibility detection method and device.
Background
For the problem of compatibility of different browsers with the HTML5, a common detection method is to perform compatibility detection by using an existing detection tool, where the detection tool may be HTML5test.com, modernizr.js, and determine whether the HTML5 characteristics are supported by each browser according to a detection result detected by the detection tool, so as to know whether the different browsers are compatible with the HTML5 characteristics.
However, the above detection method can only detect whether the browser itself supports the HTML5 feature, that is, the detected detection result can only show whether the current browser is compatible with the HTML5 feature, and the detection result is single, and thus more precise and accurate compatibility detection cannot be implemented for the current browser.
In view of the above problems, no effective solution has been proposed.
Disclosure of Invention
The embodiment of the invention provides a browser compatibility detection method and device, which at least solve the technical problem of low detection accuracy caused by the adoption of the existing compatible detection mode.
According to an aspect of the embodiments of the present invention, a method for detecting browser compatibility is provided, including: acquiring page resources of a target page to be detected; judging whether the service code corresponding to the page resource is matched with each detection characteristic logic, wherein the detection characteristic logic is a matching expression matched with the characteristics of a browser, and the browser is used for displaying the target page; and if the service code corresponding to the page resource is judged not to be matched with at least one detection characteristic logic, obtaining a detection result, wherein the detection result is used for indicating that the service code is not compatible with the browser.
According to another aspect of the embodiments of the present invention, there is also provided a device for detecting browser compatibility, including: the first acquisition unit is used for acquiring page resources of a target page to be detected; a judging unit, configured to judge whether a service code corresponding to the page resource matches each detection characteristic logic, where the detection characteristic logic is a matching expression matching characteristics of a browser, and the browser is configured to display the target page; a second obtaining unit, configured to obtain a detection result when it is determined that the service code corresponding to the page resource does not match at least one of the detection characteristic logics, where the detection result is used to indicate that the service code is incompatible with the browser.
In the embodiment of the invention, the service codes corresponding to the page resources of the displayed page are matched and judged by using each detection characteristic logic, and are not limited to a single compatibility detection result, so that the compatibility of the target page in each browser is accurately detected, and meanwhile, the service codes corresponding to the page resources incompatible with the browser in the page are accurately positioned. Therefore, the effects of accurately positioning the compatibility detection precision to the service code and improving the accuracy and precision of browser compatibility detection are achieved, and the problem of low accuracy of browser compatibility detection in the prior art is solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a schematic application environment diagram of an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 2 is a flowchart of an alternative browser compatibility detection method according to an embodiment of the present invention;
fig. 3 is a schematic diagram illustrating an effect of an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 5 is a flowchart of an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 6 is a flowchart of an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 7 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 8 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 9 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 10 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 11 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 12 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 13 is a diagram illustrating an alternative browser compatibility detection method according to an embodiment of the present invention;
FIG. 14 is a schematic diagram of an alternative browser compatibility detection apparatus according to an embodiment of the present invention;
fig. 15 is a schematic diagram of an alternative browser compatibility detection apparatus according to an embodiment of the present invention.
Detailed Description
In order to make the technical solutions of the present invention better understood, the technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used is interchangeable under appropriate circumstances such that the embodiments of the invention described herein are capable of operation in sequences other than those illustrated or described herein. Furthermore, the terms "comprises," "comprising," and "having," and any variations thereof, are intended to cover a non-exclusive inclusion, such that a process, method, system, article, or apparatus that comprises a list of steps or elements is not necessarily limited to those steps or elements expressly listed, but may include other steps or elements not expressly listed or inherent to such process, method, article, or apparatus.
Example 1
In the embodiment of the invention, an embodiment of the browser compatibility detection method is provided. As an optional implementation manner, the browser compatibility detection method may be but is not limited to be applied to an application environment shown in fig. 1, a browser for loading and displaying a page is run in a terminal 102, a server 106 acquires page information of a target page to be detected from the terminal 102 through a network 104, then, the server 106 acquires a page resource of the target page according to the page information, determines whether a service code corresponding to the page is matched with each detection characteristic logic, where the detection characteristic logic is a matching expression matched with a browser characteristic, and acquires a detection result for indicating that the service code is incompatible with the browser if it is determined that the service code corresponding to the page resource is not matched with at least one detection characteristic logic. Further, but not limited to, pushing the obtained detection result to the terminal 102 for displaying.
In this embodiment of the present invention, as another optional implementation (not shown in the figure), when the terminal 102 is a hardware device with a strong data processing capability, the compatibility detection process may be independently implemented in the terminal 102, that is, directly obtain a page resource of a target page to be detected on the terminal 102, determine whether a service code corresponding to the page resource matches a detection characteristic logic, and obtain and display the detection result for indicating that the service code is incompatible with a browser on the terminal 102 when it is determined that the service code does not match at least one detection characteristic logic.
In this embodiment, after the page resource of the target page to be detected is acquired, the detection and judgment for judging whether the service code is compatible with the browser is realized by judging whether the service code corresponding to the page resource is matched with each detection characteristic logic, where the detection characteristic logic is a matching expression matched with the browser characteristic, and when the service code corresponding to the page resource is judged not to be matched with at least one detection characteristic logic, a detection result indicating that the service code is incompatible with the browser is acquired. That is to say, each detection characteristic logic is used for matching and judging the service code corresponding to the page resource, so that the precision of the compatibility detection is accurately positioned to the service code, and the method is not limited to obtaining a single detection result whether the browser is compatible with the page or not, thereby realizing the effect of improving the accuracy of the browser detection, and further overcoming the problem of lower accuracy of the browser compatibility detection in the prior art.
Optionally, in this embodiment, the terminal may include, but is not limited to, at least one of the following: mobile phones, tablet computers, notebook computers, desktop PCs, and other hardware devices running browsers for displaying target pages. The network may include, but is not limited to, at least one of: wide area networks, metropolitan area networks, and local area networks. The above is only an example, and the present embodiment is not limited to this.
According to an embodiment of the present invention, a method for detecting browser compatibility is provided, as shown in fig. 2, the method includes:
s202, acquiring page resources of a target page to be detected;
s204, judging whether the service code corresponding to the page resource is matched with each detection characteristic logic, wherein the detection characteristic logic is a matching expression matched with the browser characteristics, and the browser is used for displaying a target page;
s206, if the business code corresponding to the page resource is judged not to be matched with the at least one detection characteristic logic, a detection result is obtained, wherein the detection result is used for indicating that the business code is not compatible with the browser.
Optionally, in this embodiment, the browser compatibility detection method may be, but is not limited to, applied to a scenario in which whether a service code corresponding to a page resource of a page is compatible with a browser for displaying the page. Specifically, after the page resource of the target page to be detected is acquired, whether the service code corresponding to the page resource is matched with each detection characteristic logic is judged, wherein the detection characteristic logic is a matching expression matched with the browser characteristic, and therefore the detection result of whether the service code is compatible with the browser is determined according to the judgment result. That is, each detection characteristic logic is used for carrying out matching judgment on the service codes corresponding to the page resources of the displayed page, and the method is not limited to a single compatibility detection result any more, so that the compatibility of the target page in each browser is accurately detected, and meanwhile, the service codes corresponding to the page resources incompatible with the browser in the page are accurately positioned. Therefore, the effects of accurately positioning the compatibility detection precision to the service code and improving the accuracy and precision of browser compatibility detection are achieved, and the problem of low accuracy of browser compatibility detection in the prior art is solved.
Optionally, in this embodiment, the browser property may be, but is not limited to, an Html5 property, which is referred to as an H5 property for short. It should be noted that, in this embodiment, the H5 characteristics include a plurality of different characteristics, and the supporting degrees of the H5 characteristics by the various browsers are different. Whether the service codes corresponding to the page resources are matched with the detection characteristic logic or not is judged through detection, namely whether the service codes are matched with a matching expression of the H5 characteristic supported by the browser or not is judged, so that whether the service codes corresponding to the page resources are compatible with the browser or not is accurately detected, the compatibility of a target page where the page resources are located and the browser is further judged, and the position of the service codes with display errors due to incompatibility can be further positioned.
Optionally, in this embodiment, before acquiring the page resource of the target page to be detected, the method further includes: acquiring basic data respectively corresponding to each browser, wherein the basic data can include but is not limited to a characteristic identifier of browser characteristics; and comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic to obtain a detection characteristic logic group corresponding to the browser, wherein the detection characteristic logic group comprises detection characteristic logics respectively matched with the browser characteristics.
For example, as shown in fig. 3, the information related to the characteristics of part of H5 is shown, such as the characteristic identifier (item) of the H5 characteristic listed in the 1 st column in the table, the characteristic content (item-desc) of the H5 characteristic listed in the 2 nd column in the table, the type (type) of the H5 characteristic listed in the 3 rd column in the table, and the detection characteristic logic (also referred to as a matching expression) configured corresponding to the H5 characteristic listed in the last 1 column in the table (detect _ judge _ value).
Optionally, in this embodiment, the basic data may be obtained, but is not limited to, by controlling a browser to access a predetermined test page, where a plug-in for storing the obtained basic data to the predetermined data is embedded in the test page, for example, the plug-in may be modelizer.
Optionally, in this embodiment, before acquiring the page resource of the target page to be detected, the method further includes: the different H5 characteristics are respectively configured as corresponding detection characteristic logic, and the process thereof can be illustrated in fig. 4, for example, taking pictures in the H5 characteristic as an example, and configured as the detection characteristic logic: equal _ picture. Therefore, the service codes corresponding to different page resources are matched and judged by using the detection characteristic logic, and a compatibility detection result is obtained.
Optionally, in this embodiment, the acquiring the page resource of the target page to be detected includes: acquiring page information of an input target page; and acquiring the page resource of the target page according to the page information. The page resource of the target page acquired according to the page information comprises at least one of the following:
1) and when the page information comprises the path information of the page resource for storing the target page, acquiring the page resource according to the path information.
2) And when the page information comprises path information used for storing the page resource of the target page and control information used for acquiring the page resource, acquiring the page resource according to the control information and the path information.
The control information may, but is not limited to, carry at least one of the following: the dynamic configuration file comprises a dynamic configuration file corresponding to a target page, authentication information used for logging in the target page, and indication information used for indicating the target page to be displayed on the mobile terminal, wherein the dynamic configuration file can include but is not limited to operation information of a dynamic loading operation to be executed on the target page. That is, the control information is used to perform corresponding control operation before acquiring the page resource according to the path information, so as to ensure that accurate path information is acquired. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the page resource may include, but is not limited to, at least one of the following: document Object Model (DOM), client scripting language (JS), and Cascading Style Sheets (CSS). The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, after acquiring the page resource of the target page, since the Web code is often a compressed code, in order to increase the loading speed of the browser, format preprocessing may be performed on the acquired page resource, but not limited to, as shown in steps S502 to S510 in fig. 5, step S504-2 formatting processing is performed on the DOM resource, and the compatibility detection determination is performed by using the content after the formatting processing. Executing step S504-1 to the CSS resource and the JS resource to judge whether a source file exists, executing step S504-2 formatting processing when judging that the source file does not exist, and utilizing the formatted content to carry out compatibility detection judgment; when it is determined that the source file exists, steps S506 to S508 are executed to obtain the corresponding source file, so as to perform compatibility detection determination by using the source file.
Optionally, in this embodiment, different browsers may configure a set of detection characteristic logic groups, but not limited to, respectively, where the detection characteristic logic group includes one or more detection characteristic logics respectively matching with the browser characteristics.
It should be noted that, the process of determining whether the service code corresponding to the page resource is logically matched with each detection characteristic may be, but is not limited to, steps S602 to S612 shown in fig. 6, acquiring a set of browser identifiers to be detected, and sequentially acquiring the browser identifiers from the set of browser identifiers to be detected; performing the following operations on the target browser identified by the browser identification: acquiring a detection characteristic logic group corresponding to a target browser, wherein the detection characteristic logic group comprises one or more detection characteristic logics which are respectively matched with the characteristics of the target browser; and judging whether the service code is matched with the detection characteristic logic in the detection characteristic logic group. And after the traversal operation is finished, obtaining a detection result, and if the service code is judged not to be matched with the at least one detection characteristic logic, obtaining a detection result for indicating that the service code is incompatible with the target browser.
Optionally, in this embodiment, after the detection result is obtained, the detection result may be, but is not limited to, displayed at a terminal. The method for displaying the detection result may include, but is not limited to:
1) by directly presenting the detection results in a list format, the presentation content can be as shown in fig. 7,
2) the detection results are shown according to the HTML5 property aggregation, and the showing/packing button can be clicked to view the question details under different browsers, and the showing content can be shown in FIG. 8. Additionally, for a particular compatibility issue, but not limited to, locating a business code that exhibits incompatibility, as shown in the block of FIG. 9, is the located business code that has a problem (i.e., incompatibility).
According to the embodiment provided by the application, the service codes corresponding to the page resources of the displayed page are matched and judged by using each detection characteristic logic, and are not limited to a single compatibility detection result any more, so that the compatibility of the target page in each browser is accurately detected, and meanwhile, the service codes corresponding to the page resources incompatible with the browser in the page are accurately positioned. Therefore, the effects of accurately positioning the compatibility detection precision to the service code and improving the accuracy and precision of browser compatibility detection are achieved, and the problem of low accuracy of browser compatibility detection in the prior art is solved.
As an optional scheme, the determining whether the service code corresponding to the page resource is logically matched with each detection characteristic includes:
s1, sequentially acquiring browser identifiers from the browser identifier set to be detected;
s2, executing the following operations on the target browser identified by the browser identification:
s22, acquiring a detection characteristic logic group corresponding to the target browser, wherein the detection characteristic logic group comprises one or more detection characteristic logics respectively matched with the browser characteristics of the target browser;
s24, judging whether the service code matches with the detection characteristic logic in the detection characteristic logic group;
s26, if the business code is judged not to be matched with the at least one detection characteristic logic, a detection result for indicating that the business code is not compatible with the target browser is obtained.
Optionally, in this embodiment, the set of browser identifiers to be detected may include, but is not limited to, different browsers in related technologies, for example, an IE browser, a chrome browser, and other application browsers. And judging the corresponding compatibility by detecting whether the service code corresponding to the page resource of the target page is matched with the detection characteristic logic corresponding to the browser, thereby realizing the improvement of the accuracy of the compatibility detection.
Optionally, in this embodiment, the step S24, the determining whether the service code matches the detection characteristic logic in the detection characteristic logic group includes:
s2401, repeatedly executing the following steps until the detection feature logic in the detection feature logic group is traversed:
s2401-1, obtaining the current detection characteristic logic from the detection characteristic logic group;
s2401-2, judging whether the service code is matched with the current detection characteristic logic;
s2401-3, if the service code matches with the current detection characteristic logic, taking the next detection characteristic logic in the detection characteristic logic group as the current detection characteristic logic;
s2401-4, if the service code is not matched with the current detection characteristic logic, positioning the position of the service code, and taking the next detection characteristic logic in the detection characteristic logic group as the current detection characteristic logic.
Specifically, referring to fig. 6, after acquiring the set of browser identifiers to be detected, the target browsers identified by the browser identifiers are sequentially acquired, and corresponding detection and determination operations are executed until the set of browser identifiers is traversed. The detection and determination operation may be, but is not limited to: and acquiring a detection characteristic logic group corresponding to the target browser, sequentially judging whether the service code corresponding to the page resource is matched with each detection characteristic logic in the detection characteristic logic, and recording a judgment result. And after the traversing operation is finished, obtaining a detection result.
According to the embodiment provided by the application, the detection characteristic logic groups corresponding to different browsers are traversed to carry out matching judgment, so that incompatible problem service codes existing in the service codes corresponding to the page resources of the acquired target page are accurately positioned, and the accuracy and precision of compatibility detection are further ensured.
As an optional solution, acquiring the logical group of detection characteristics corresponding to the target browser includes:
s1, acquiring basic data corresponding to the target browser, wherein the basic data comprises a characteristic identifier of the browser characteristic of the target browser;
s2, respectively comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic;
and S3, storing the detection characteristic logic matched with the characteristic identified by the characteristic identification in the basic data into the detection characteristic logic group corresponding to the target browser.
Optionally, in this embodiment, the basic data may be, but is not limited to, basic data obtained after a target browser accesses a test page, where a plug-in for storing the obtained basic data in a predetermined database is embedded in the test page.
Optionally, in this embodiment, the detection characteristic logic may be, but is not limited to, as shown in fig. 3, by comparing the obtained basic data of the target browser with each detection characteristic logic, and storing the detection characteristic logic matching the characteristic (e.g., the H5 characteristic) identified by the characteristic identifier in the basic data into the detection characteristic logic group corresponding to the target browser, so as to achieve obtaining the detection characteristic logic group corresponding to the browser characteristic (e.g., the H5 characteristic).
According to the embodiment provided by the application, the characteristic identified by the characteristic identification in the basic data corresponding to the target browser is respectively compared with each detection characteristic logic; and storing the detection characteristic logic matched with the characteristic identified by the characteristic identification in the basic data into a detection characteristic logic group corresponding to the target browser, so that the detection characteristic logic corresponding to the browser characteristic is obtained first, the matching judgment is conveniently carried out by quickly utilizing the detection characteristic logic and the service code of the page resource of the target page to be detected, the matching time is saved, and the effect of improving the matching efficiency is achieved.
As an optional scheme, the acquiring the page resource of the target page to be detected includes:
s1, acquiring page information of the input target page, wherein the page information at least comprises path information of page resources for storing the target page;
and S2, acquiring the page resource according to the path information.
Optionally, in this embodiment, the page information further includes control information for acquiring the page resource, where before acquiring the page resource according to the path information, the page information further includes at least one of the following:
1) when the control information carries a dynamic configuration file corresponding to the target page, executing dynamic loading operation according to the indication of the dynamic configuration file;
for example, for dynamic loading of DOM resources in a Web page, a script dynamic injection mode and a background execution expansion mode can be adopted. As shown in fig. 10, by writing a selenium automation operation code, compiling, uploading a dynamic configuration file, the background scanning engine executes an action injected by a user by using a java reflection mechanism, and thus, dynamic loading of DOM resources is completed. That is, dynamic loading is performed on the DOM dynamic resource embedded in the target page in the manner described above, and other static resources can be obtained according to the path information in the page information.
2) When the control information carries authentication information used for logging in a target page, executing login operation according to the authentication information;
for example, in the case that the page resource needs to be logged in, as shown in fig. 11, when it is known that login authentication is needed according to the control information in the page information, Ptlogin is performed first by using the authentication information in the acquired control information, and then the page resource is acquired according to the path information.
3) And when the control information carries indication information used for indicating the target page to be displayed on the mobile terminal, jumping to the initial position indicated by the path information matched with the mobile terminal.
For example, a web driver is used to obtain a page resource, where a mobile end-specific User-Agent (service code automatic jump scenario) needs to be set for a mobile end-specific HTML5 page to complete a request for automatic jump, and as shown in the content in the block shown in fig. 12, the page resource is jumped to a starting position indicated by path information matched with the mobile terminal to obtain the page resource corresponding to the mobile terminal.
According to the embodiment provided by the application, the corresponding page resources are obtained according to the obtained page information and the corresponding mode and path information, so that the compatibility detection and judgment of the service codes corresponding to the page resources are realized, and the effect of improving the accuracy of the compatibility detection is achieved.
As an optional scheme, before acquiring the page resource of the target page to be detected, the method further includes:
s1, sequentially acquiring browser identifiers from the browser identifier set to be detected;
and S2, acquiring basic data obtained after the target browser identified by the browser identification accesses the test page, wherein the test page is embedded with a plug-in used for storing the obtained basic data into a preset database, and the basic data comprises the characteristic identification of the browser characteristic of the target browser.
Specifically, as described with reference to fig. 13, the browser identifiers are sequentially obtained from the set of browser identifiers to be detected; and respectively controlling different browsers to access a specific HTML5 compatibility test page according to the browser identifiers, wherein a modelnzr.js library is introduced into the test page, so that basic data used for expressing the support degree of the H5 characteristics by each browser is acquired, and further, the basic data are analyzed, sorted and put in storage, as shown in FIG. 13.
According to the embodiment provided by the application, the basic data of each browser is collected in advance, so that the comparison operation can be directly executed after the page resource of the target page to be detected is obtained, the matching judgment time is saved, and the effect of improving the detection efficiency is realized.
It should be noted that, for simplicity of description, the above-mentioned method embodiments are described as a series of acts or combination of acts, but those skilled in the art will recognize that the present invention is not limited by the order of acts, as some steps may occur in other orders or concurrently in accordance with the invention. Further, those skilled in the art should also appreciate that the embodiments described in the specification are preferred embodiments and that the acts and modules referred to are not necessarily required by the invention.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
According to an embodiment of the present invention, there is also provided a browser compatibility detection apparatus for implementing the browser compatibility detection method, as shown in fig. 14, the apparatus includes:
1) a first obtaining unit 1402, configured to obtain a page resource of a target page to be detected;
2) a judging unit 1404, configured to judge whether a service code corresponding to a page resource matches each detection characteristic logic, where the detection characteristic logic is a matching expression matching characteristics of a browser, and the browser is configured to display a target page;
3) a second obtaining unit 1406, configured to obtain a detection result when it is determined that the service code corresponding to the page resource does not match the at least one detection characteristic logic, where the detection result is used to indicate that the service code is incompatible with the browser.
Optionally, in this embodiment, the browser compatibility detecting apparatus may be applied to, but not limited to, a scenario in which a service code corresponding to a page resource of a page is compatible with a browser for displaying the page. Specifically, after the page resource of the target page to be detected is acquired, whether the service code corresponding to the page resource is matched with each detection characteristic logic is judged, wherein the detection characteristic logic is a matching expression matched with the browser characteristic, and therefore the detection result of whether the service code is compatible with the browser is determined according to the judgment result. That is, each detection characteristic logic is used for carrying out matching judgment on the service codes corresponding to the page resources of the displayed page, and the method is not limited to a single compatibility detection result any more, so that the compatibility of the target page in each browser is accurately detected, and meanwhile, the service codes corresponding to the page resources incompatible with the browser in the page are accurately positioned. Therefore, the effects of accurately positioning the compatibility detection precision to the service code and improving the accuracy and precision of browser compatibility detection are achieved, and the problem of low accuracy of browser compatibility detection in the prior art is solved.
Optionally, in this embodiment, the browser property may be, but is not limited to, an Html5 property, which is referred to as an H5 property for short. It should be noted that, in this embodiment, the H5 characteristics include a plurality of different characteristics, and the supporting degrees of the H5 characteristics by the various browsers are different. Whether the service codes corresponding to the page resources are matched with the detection characteristic logic or not is judged through detection, namely whether the service codes are matched with a matching expression of the H5 characteristic supported by the browser or not is judged, so that whether the service codes corresponding to the page resources are compatible with the browser or not is accurately detected, the compatibility of a target page where the page resources are located and the browser is further judged, and the position of the service codes with display errors due to incompatibility can be further positioned.
Optionally, in this embodiment, before acquiring the page resource of the target page to be detected, the method further includes: acquiring basic data respectively corresponding to each browser, wherein the basic data can include but is not limited to a characteristic identifier of browser characteristics; and comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic to obtain a detection characteristic logic group corresponding to the browser, wherein the detection characteristic logic group comprises detection characteristic logics respectively matched with the browser characteristics.
For example, as shown in fig. 3, the information related to the characteristics of the part H5 is shown, such as the characteristic identifier of the H5 characteristic listed in the 1 st column of the table, the characteristic content of the H5 characteristic listed in the 2 nd column of the table, the type of the H5 characteristic listed in the 3 rd column of the table, and the detection characteristic logic (also referred to as a matching expression) configured corresponding to the H5 characteristic listed in the last 1 column of the table.
Optionally, in this embodiment, the basic data may be obtained, but is not limited to, by controlling a browser to access a predetermined test page, where a plug-in for storing the obtained basic data to the predetermined data is embedded in the test page, for example, the plug-in may be modelizer.
Optionally, in this embodiment, before acquiring the page resource of the target page to be detected, the method further includes: the different H5 characteristics are respectively configured as corresponding detection characteristic logic, and the process thereof can be illustrated in fig. 4, for example, taking pictures in the H5 characteristic as an example, and configured as the detection characteristic logic: equal _ picture. Therefore, the service codes corresponding to different page resources are matched and judged by using the detection characteristic logic, and a compatibility detection result is obtained.
Optionally, in this embodiment, the acquiring the page resource of the target page to be detected includes: acquiring page information of an input target page; and acquiring the page resource of the target page according to the page information. The page resource of the target page acquired according to the page information comprises at least one of the following:
1) and when the page information comprises the path information of the page resource for storing the target page, acquiring the page resource according to the path information.
2) And when the page information comprises path information used for storing the page resource of the target page and control information used for acquiring the page resource, acquiring the page resource according to the control information and the path information.
The control information may, but is not limited to, carry at least one of the following: the dynamic configuration file comprises a dynamic configuration file corresponding to a target page, authentication information used for logging in the target page, and indication information used for indicating the target page to be displayed on the mobile terminal, wherein the dynamic configuration file can include but is not limited to operation information of a dynamic loading operation to be executed on the target page. That is, the control information is used to perform corresponding control operation before acquiring the page resource according to the path information, so as to ensure that accurate path information is acquired. The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, the page resource may include, but is not limited to, at least one of the following: document Object Model (DOM), client scripting language (JS), and Cascading Style Sheets (CSS). The above is only an example, and this is not limited in this embodiment.
Optionally, in this embodiment, after acquiring the page resource of the target page, since the Web code is often a compressed code, in order to increase the loading speed of the browser, format preprocessing may be performed on the acquired page resource, but not limited to, as shown in steps S502 to S510 in fig. 5, step S504-2 formatting processing is performed on the DOM resource, and the compatibility detection determination is performed by using the content after the formatting processing. Executing step S504-1 to the CSS resource and the JS resource to judge whether a source file exists, executing step S504-2 formatting processing when judging that the source file does not exist, and utilizing the formatted content to carry out compatibility detection judgment; when it is determined that the source file exists, steps S506 to S508 are executed to obtain the corresponding source file, so as to perform compatibility detection determination by using the source file.
Optionally, in this embodiment, different browsers may configure a set of detection characteristic logic groups, but not limited to, respectively, where the detection characteristic logic group includes one or more detection characteristic logics respectively matching with the browser characteristics.
It should be noted that, the process of determining whether the service code corresponding to the page resource is logically matched with each detection characteristic may be, but is not limited to, steps S602 to S612 shown in fig. 6, acquiring a set of browser identifiers to be detected, and sequentially acquiring the browser identifiers from the set of browser identifiers to be detected; performing the following operations on the target browser identified by the browser identification: acquiring a detection characteristic logic group corresponding to a target browser, wherein the detection characteristic logic group comprises one or more detection characteristic logics which are respectively matched with the characteristics of the target browser; and judging whether the service code is matched with the detection characteristic logic in the detection characteristic logic group. And after the traversal operation is finished, obtaining a detection result, and if the service code is judged not to be matched with the at least one detection characteristic logic, obtaining a detection result for indicating that the service code is incompatible with the target browser.
Optionally, in this embodiment, after the detection result is obtained, the detection result may be, but is not limited to, displayed at a terminal. The method for displaying the detection result may include, but is not limited to:
1) by directly presenting the detection results in a list format, the presentation content can be as shown in fig. 7,
2) the detection results are shown according to the HTML5 property aggregation, and the showing/packing button can be clicked to view the question details under different browsers, and the showing content can be shown in FIG. 8. Additionally, for a particular compatibility issue, but not limited to, locating a business code that exhibits incompatibility, as shown in the block of FIG. 9, is the located business code that has a problem (i.e., incompatibility).
According to the embodiment provided by the application, the service codes corresponding to the page resources of the displayed page are matched and judged by using each detection characteristic logic, and are not limited to a single compatibility detection result any more, so that the compatibility of the target page in each browser is accurately detected, and meanwhile, the service codes corresponding to the page resources incompatible with the browser in the page are accurately positioned. Therefore, the effects of accurately positioning the compatibility detection precision to the service code and improving the accuracy and precision of browser compatibility detection are achieved, and the problem of low accuracy of browser compatibility detection in the prior art is solved.
As an alternative, the judging unit 1404 includes:
1) the first acquisition module is used for sequentially acquiring browser identifiers from a browser identifier set to be detected;
2) a processing module, configured to perform the following operations on the target browser identified by the browser identifier:
s1, acquiring a detection characteristic logic group corresponding to the target browser, wherein the detection characteristic logic group comprises one or more detection characteristic logics respectively matched with the browser characteristics of the target browser;
s2, judging whether the service code matches with the detection characteristic logic in the detection characteristic logic group;
s3, if the business code is judged not to be matched with the at least one detection characteristic logic, a detection result for indicating that the business code is not compatible with the target browser is obtained.
Optionally, in this embodiment, the set of browser identifiers to be detected may include, but is not limited to, different browsers in related technologies, for example, an IE browser, a chrome browser, and other application browsers. And judging the corresponding compatibility by detecting whether the service code corresponding to the page resource of the target page is matched with the detection characteristic logic corresponding to the browser, thereby realizing the improvement of the accuracy of the compatibility detection.
Optionally, in this embodiment, the processing module determines whether the service code matches the detection feature logic in the detection feature logic group by:
s1, repeatedly executing the following steps until the detection characteristic logic in the detection characteristic logic group is traversed:
s12, obtaining the current detection characteristic logic from the detection characteristic logic group;
s14, judging whether the service code is matched with the current detection characteristic logic;
s16, if the service code matches with the current detection characteristic logic, the next detection characteristic logic in the detection characteristic logic group is used as the current detection characteristic logic;
and S18, if the service code does not match with the current detection characteristic logic, positioning the position of the service code, and taking the next detection characteristic logic in the detection characteristic logic group as the current detection characteristic logic.
Specifically, referring to fig. 6, after acquiring the set of browser identifiers to be detected, the target browsers identified by the browser identifiers are sequentially acquired, and corresponding detection and determination operations are executed until the set of browser identifiers is traversed. The detection and determination operation may be, but is not limited to: and acquiring a detection characteristic logic group corresponding to the target browser, sequentially judging whether the service code corresponding to the page resource is matched with each detection characteristic logic in the detection characteristic logic, and recording a judgment result. And after the traversing operation is finished, obtaining a detection result.
According to the embodiment provided by the application, the detection characteristic logic groups corresponding to different browsers are traversed to carry out matching judgment, so that incompatible problem service codes existing in the service codes corresponding to the page resources of the acquired target page are accurately positioned, and the accuracy and precision of compatibility detection are further ensured.
As an optional scheme, the processing module obtains the logical group of detection characteristics corresponding to the target browser by:
s1, acquiring basic data corresponding to the target browser, wherein the basic data comprises a characteristic identifier of the browser characteristic of the target browser;
s2, respectively comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic;
and S3, storing the detection characteristic logic matched with the characteristic identified by the characteristic identification in the basic data into the detection characteristic logic group corresponding to the target browser.
Optionally, in this embodiment, the basic data may be, but is not limited to, basic data obtained after a target browser accesses a test page, where a plug-in for storing the obtained basic data in a predetermined database is embedded in the test page.
Optionally, in this embodiment, the detection characteristic logic may be, but is not limited to, as shown in fig. 3, by comparing the obtained basic data of the target browser with each detection characteristic logic, and storing the detection characteristic logic matching the characteristic (e.g., the H5 characteristic) identified by the characteristic identifier in the basic data into the detection characteristic logic group corresponding to the target browser, so as to achieve obtaining the detection characteristic logic group corresponding to the browser characteristic (e.g., the H5 characteristic).
According to the embodiment provided by the application, the characteristic identified by the characteristic identification in the basic data corresponding to the target browser is respectively compared with each detection characteristic logic; and storing the detection characteristic logic matched with the characteristic identified by the characteristic identification in the basic data into a detection characteristic logic group corresponding to the target browser, so that the detection characteristic logic corresponding to the browser characteristic is obtained first, the matching judgment is conveniently carried out by quickly utilizing the detection characteristic logic and the service code of the page resource of the target page to be detected, the matching time is saved, and the effect of improving the matching efficiency is achieved.
As an alternative, the first obtaining unit 1402 includes:
1) the second acquisition module is used for acquiring the page information of the input target page, wherein the page information at least comprises path information of page resources used for storing the target page;
2) and the third acquisition module is used for acquiring the page resources according to the path information.
Optionally, in this embodiment, the page information further includes control information for acquiring a page resource, where the page information further includes at least one of:
(1) and the loading module is used for executing dynamic loading operation according to the indication of the dynamic configuration file when the dynamic configuration file corresponding to the target page is carried in the control information before the page resource is acquired according to the path information.
For example, for dynamic loading of DOM resources in a Web page, a script dynamic injection mode and a background execution expansion mode can be adopted. As shown in fig. 10, by writing a selenium automation operation code, compiling, uploading a dynamic configuration file, the background scanning engine executes an action injected by a user by using a java reflection mechanism, and thus, dynamic loading of DOM resources is completed. That is, dynamic loading is performed on the DOM dynamic resource embedded in the target page in the manner described above, and other static resources can be obtained according to the path information in the page information.
(2) The authentication module is used for executing login operation according to authentication information when the control information carries the authentication information used for logging in a target page before acquiring page resources according to the path information;
for example, in the case that the page resource needs to be logged in, as shown in fig. 11, when it is known that login authentication is needed according to the control information in the page information, Ptlogin is performed first by using the authentication information in the acquired control information, and then the page resource is acquired according to the path information.
(3) And the skipping module is used for skipping to the initial position indicated by the path information matched with the mobile terminal when the control information carries indication information used for indicating the target page to be displayed on the mobile terminal before the page resource is acquired according to the path information.
For example, a web driver is used to obtain a page resource, where a mobile end-specific User-Agent (service code automatic jump scenario) needs to be set for a mobile end-specific HTML5 page to complete a request for automatic jump, and as shown in the content in the block shown in fig. 12, the page resource is jumped to a starting position indicated by path information matched with the mobile terminal to obtain the page resource corresponding to the mobile terminal.
According to the embodiment provided by the application, the corresponding page resources are obtained according to the obtained page information and the corresponding mode and path information, so that the compatibility detection and judgment of the service codes corresponding to the page resources are realized, and the effect of improving the accuracy of the compatibility detection is achieved.
As an optional scheme, the method further comprises the following steps:
1) the third acquiring unit is used for sequentially acquiring the browser identifications from the browser identification set to be detected before acquiring the page resources of the target page to be detected;
2) and the fourth acquisition unit is used for acquiring basic data obtained after the target browser identified by the browser identifier accesses the test page, wherein the test page is embedded with a plug-in used for storing the obtained basic data into a preset database, and the basic data comprises a characteristic identifier of the browser characteristic of the target browser.
Specifically, as described with reference to fig. 13, the browser identifiers are sequentially obtained from the set of browser identifiers to be detected; and respectively controlling different browsers to access a specific HTML5 compatibility test page according to the browser identifiers, wherein a modelnzr.js library is introduced into the test page, so that basic data used for expressing the support degree of the H5 characteristics by each browser is acquired, and further, the basic data are analyzed, sorted and put in storage, as shown in FIG. 13.
According to the embodiment provided by the application, the basic data of each browser is collected in advance, so that the comparison operation can be directly executed after the page resource of the target page to be detected is obtained, the matching judgment time is saved, and the effect of improving the detection efficiency is realized.
Example 3
According to an embodiment of the present invention, there is also provided a browser compatibility detection device for implementing the browser compatibility detection method, as shown in fig. 15, the device includes:
1) a communication interface 1502 configured to acquire a page resource of a target page to be detected;
2) a processor 1504, connected to the communication interface 1502, configured to determine whether a service code corresponding to a page resource matches each detection characteristic logic, where the detection characteristic logic is a matching expression matching the browser characteristics, and the browser is configured to display a target page; if the business code corresponding to the page resource is judged not to be matched with the at least one detection characteristic logic, obtaining a detection result, wherein the detection result is used for indicating that the business code is not compatible with the browser;
3) the memory 1506 is connected to the communication interface 1502 and the processor 1504, and is configured to store the page resource of the target page, the service code corresponding to the page resource, and the detection characteristic logic.
Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
Example 4
The embodiment of the invention also provides a storage medium. Optionally, in this embodiment, the storage medium may be located in at least one of a plurality of network devices in a network.
Optionally, in this embodiment, the storage medium is configured to store program code for performing the following steps:
s1, acquiring page resources of the target page to be detected;
s2, judging whether the service code corresponding to the page resource is matched with each detection characteristic logic, wherein the detection characteristic logic is a matching expression matched with the browser characteristics, and the browser is used for displaying the target page;
s3, if the business code corresponding to the page resource is judged not to be matched with the at least one detection characteristic logic, a detection result is obtained, wherein the detection result is used for indicating that the business code is not compatible with the browser.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic or optical disk, and other various media capable of storing program codes.
Optionally, the specific examples in this embodiment may refer to the examples described in embodiment 1 and embodiment 2, and this embodiment is not described herein again.
The above-mentioned serial numbers of the embodiments of the present invention are merely for description and do not represent the merits of the embodiments.
The integrated unit in the above embodiments, if implemented in the form of a software functional unit and sold or used as a separate product, may be stored in the above computer-readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied in the form of a software product, which is stored in a storage medium and includes several instructions for causing one or more computer devices (which may be personal computers, servers, network devices, etc.) to execute all or part of the steps of the method according to the embodiments of the present invention.
In the above embodiments of the present invention, the descriptions of the respective embodiments have respective emphasis, and for parts that are not described in detail in a certain embodiment, reference may be made to related descriptions of other embodiments.
In the several embodiments provided in the present application, it should be understood that the disclosed client may be implemented in other manners. The above-described embodiments of the apparatus are merely illustrative, and for example, the division of the units is only one type of division of logical functions, and there may be other divisions when actually implemented, for example, a plurality of units or components may be combined or may be integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, units or modules, and may be in an electrical or other form.
The units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
In addition, functional units in the embodiments of the present invention may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The integrated unit can be realized in a form of hardware, and can also be realized in a form of a software functional unit.
The foregoing is only a preferred embodiment of the present invention, and it should be noted that, for those skilled in the art, various modifications and decorations can be made without departing from the principle of the present invention, and these modifications and decorations should also be regarded as the protection scope of the present invention.
Claims (17)
1. A browser compatibility detection method is characterized by comprising the following steps:
acquiring basic data corresponding to each browser, wherein the basic data comprises characteristic identifiers of browser characteristics; comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic to obtain detection characteristic logic groups respectively corresponding to each browser, wherein the detection characteristic logic groups comprise detection characteristic logics respectively matched with the browser characteristics;
acquiring page resources of a target page to be detected;
judging whether the service code corresponding to the page resource is matched with each detection characteristic logic in the corresponding detection characteristic logic group or not, wherein the detection characteristic logic is a matching expression matched with the browser characteristic, and the browser is used for displaying the target page;
and if the service code corresponding to the page resource is judged not to be matched with at least one detection characteristic logic in the detection characteristic logic group, obtaining a detection result, wherein the detection result is used for indicating that the service code is incompatible with the browser.
2. The method of claim 1, wherein determining whether the service code corresponding to the page resource logically matches the respective detected characteristic comprises:
sequentially acquiring browser identifications from a browser identification set to be detected;
performing the following operations on the target browser identified by the browser identification:
acquiring a detection characteristic logic group corresponding to the target browser, wherein the detection characteristic logic group comprises one or more detection characteristic logics respectively matched with the browser characteristics of the target browser;
judging whether the service code is matched with the detection characteristic logic in the detection characteristic logic group;
and if the service code is judged not to be matched with at least one detection characteristic logic, acquiring the detection result for indicating that the service code is not compatible with the target browser.
3. The method of claim 2, wherein said determining whether said service code matches said detection feature logic of said set of detection feature logics comprises:
repeatedly executing the following steps until the detection characteristic logic in the detection characteristic logic group is traversed:
acquiring current detection characteristic logic from the detection characteristic logic group;
judging whether the service code is matched with the current detection characteristic logic or not;
if the service code is matched with the current detection characteristic logic, taking the next detection characteristic logic in the detection characteristic logic group as the current detection characteristic logic;
and if the service code is not matched with the current detection characteristic logic, positioning the position of the service code, and taking the next detection characteristic logic in the detection characteristic logic group as the current detection characteristic logic.
4. The method of claim 2, wherein obtaining the logical set of detection characteristics corresponding to the target browser comprises:
acquiring basic data corresponding to the target browser, wherein the basic data comprises a characteristic identifier of browser characteristics of the target browser;
respectively comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic;
storing detection characteristic logic matched with the characteristic identified by the characteristic identification in the basic data into the detection characteristic logic group corresponding to the target browser.
5. The method according to claim 1, wherein the acquiring page resources of the target page to be detected comprises:
acquiring input page information of the target page, wherein the page information at least comprises path information of the page resource used for storing the target page;
and acquiring the page resource according to the path information.
6. The method according to claim 5, wherein the page information further includes control information for acquiring the page resource, and wherein before the acquiring the page resource according to the path information, at least one of the following is further included:
when the control information carries a dynamic configuration file corresponding to the target page, executing dynamic loading operation according to the indication of the dynamic configuration file;
when the control information carries authentication information used for logging in the target page, executing login operation according to the authentication information;
and when the control information carries indication information used for indicating the target page to be displayed on the mobile terminal, jumping to the initial position indicated by the path information matched with the mobile terminal.
7. The method according to claim 1, further comprising, before the acquiring page resources of the target page to be detected:
sequentially acquiring browser identifications from a browser identification set to be detected;
and acquiring basic data obtained after a target browser identified by the browser identification accesses a test page, wherein a plug-in used for storing the obtained basic data to a preset database is embedded in the test page, and the basic data comprises a characteristic identification of the browser characteristic of the target browser.
8. The method of any of claims 1 to 7, wherein the browser feature is an Html5 feature.
9. A browser compatibility detection apparatus, comprising:
the first acquisition unit is used for acquiring page resources of a target page to be detected;
the judging unit is used for judging whether the service code corresponding to the page resource is matched with each detection characteristic logic, wherein the detection characteristic logic is a matching expression matched with the characteristics of a browser, and the browser is used for displaying the target page;
a second obtaining unit, configured to obtain a detection result when it is determined that the service code corresponding to the page resource is not logically matched with at least one of the detection characteristics, where the detection result is used to indicate that the service code is incompatible with the browser;
the device is also used for acquiring basic data corresponding to each browser, wherein the basic data comprises characteristic identifiers of browser characteristics; and comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic to obtain detection characteristic logic groups respectively corresponding to each browser, wherein the detection characteristic logic groups comprise detection characteristic logics respectively matched with the browser characteristics.
10. The apparatus according to claim 9, wherein the judging unit includes:
the first acquisition module is used for sequentially acquiring browser identifiers from a browser identifier set to be detected;
a processing module, configured to perform the following operations on the target browser identified by the browser identifier:
acquiring a detection characteristic logic group corresponding to the target browser, wherein the detection characteristic logic group comprises one or more detection characteristic logics respectively matched with the browser characteristics of the target browser;
judging whether the service code is matched with the detection characteristic logic in the detection characteristic logic group;
and if the service code is judged not to be matched with at least one detection characteristic logic, acquiring the detection result for indicating that the service code is not compatible with the target browser.
11. The apparatus of claim 10, wherein the processing module determines whether the service code matches the detection feature logic of the detection feature logic group by:
repeatedly executing the following steps until the detection characteristic logic in the detection characteristic logic group is traversed:
acquiring current detection characteristic logic from the detection characteristic logic group;
judging whether the service code is matched with the current detection characteristic logic or not;
if the service code is matched with the current detection characteristic logic, taking the next detection characteristic logic in the detection characteristic logic group as the current detection characteristic logic;
and if the service code is not matched with the current detection characteristic logic, positioning the position of the service code, and taking the next detection characteristic logic in the detection characteristic logic group as the current detection characteristic logic.
12. The apparatus of claim 10, wherein the processing module is configured to obtain the logical set of detection characteristics corresponding to the target browser by:
acquiring basic data corresponding to the target browser, wherein the basic data comprises a characteristic identifier of browser characteristics of the target browser;
respectively comparing the characteristic identified by the characteristic identification in the basic data with each detection characteristic logic;
storing detection characteristic logic matched with the characteristic identified by the characteristic identification in the basic data into the detection characteristic logic group corresponding to the target browser.
13. The apparatus of claim 9, wherein the first obtaining unit comprises:
a second obtaining module, configured to obtain input page information of the target page, where the page information at least includes path information of the page resource used for storing the target page;
and the third acquisition module is used for acquiring the page resource according to the path information.
14. The apparatus according to claim 13, wherein the page information further includes control information for acquiring the page resource, and further includes at least one of:
a loading module, configured to execute a dynamic loading operation according to an instruction of a dynamic configuration file when the dynamic configuration file corresponding to the target page is carried in the control information before the page resource is acquired according to the path information;
the authentication module is used for executing login operation according to the authentication information when the control information carries the authentication information used for logging in the target page before the page resource is acquired according to the path information;
and the skipping module is used for skipping to the initial position indicated by the path information matched with the mobile terminal when the control information carries indication information used for indicating the target page to be displayed on the mobile terminal before the page resource is acquired according to the path information.
15. The apparatus of claim 9, further comprising:
a third obtaining unit, configured to sequentially obtain browser identifiers from a set of browser identifiers to be detected before obtaining page resources of a target page to be detected;
and the fourth acquisition unit is used for acquiring basic data obtained after a target browser identified by the browser identifier accesses the test page, wherein a plug-in used for storing the obtained basic data to a preset database is embedded in the test page, and the basic data comprises a characteristic identifier of the browser characteristic of the target browser.
16. A computer-readable storage medium comprising a stored program, wherein the program when executed performs the method of any of claims 1 to 8.
17. An electronic device comprising a memory and a processor, characterized in that the memory has stored therein a computer program, the processor being arranged to execute the method of any of claims 1 to 8 by means of the computer program.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710174275.0A CN107133165B (en) | 2017-03-22 | 2017-03-22 | Browser compatibility detection method and device |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710174275.0A CN107133165B (en) | 2017-03-22 | 2017-03-22 | Browser compatibility detection method and device |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107133165A CN107133165A (en) | 2017-09-05 |
CN107133165B true CN107133165B (en) | 2020-12-11 |
Family
ID=59720736
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710174275.0A Active CN107133165B (en) | 2017-03-22 | 2017-03-22 | Browser compatibility detection method and device |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107133165B (en) |
Families Citing this family (10)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN110413501B (en) * | 2018-04-26 | 2022-02-18 | 腾讯科技(深圳)有限公司 | Browser compatibility testing method, device and system and readable storage medium |
CN109634844B (en) * | 2018-11-06 | 2023-12-22 | 三六零科技集团有限公司 | JS code testing method and device and electronic equipment |
CN110532181A (en) * | 2019-08-19 | 2019-12-03 | 广州华旻信息科技有限公司 | ES6 characteristic compatibility detection system and method |
CN112988561B (en) * | 2019-12-18 | 2023-09-08 | 腾讯科技(深圳)有限公司 | Method, device, server and storage medium for detecting display configuration code |
CN113268232B (en) * | 2020-02-17 | 2024-04-26 | 腾讯科技(深圳)有限公司 | Page skin generation method and device and computer readable storage medium |
CN113626738A (en) * | 2020-05-08 | 2021-11-09 | 北京奇虎科技有限公司 | Method, system, browser, storage medium and computer device for configuring browser to be compatible with webpage |
CN111797009B (en) * | 2020-06-22 | 2024-10-29 | 北京字节跳动网络技术有限公司 | Method and device for detecting code compatibility and electronic equipment |
CN112540925B (en) * | 2020-12-16 | 2024-12-10 | 贝壳技术有限公司 | New feature compatibility detection system and method, electronic device and readable storage medium |
CN112925703A (en) * | 2021-01-26 | 2021-06-08 | 北京达佳互联信息技术有限公司 | Method, device, equipment and storage medium for detecting browser supported by website |
CN114817799A (en) * | 2022-02-21 | 2022-07-29 | 平安国际智慧城市科技股份有限公司 | Webpage information processing method and device, electronic equipment and storage medium |
Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103942137A (en) * | 2013-01-23 | 2014-07-23 | 腾讯科技(深圳)有限公司 | Browser compatibility testing method and device |
CN104156307A (en) * | 2014-07-03 | 2014-11-19 | 安徽景行信息科技有限公司 | Browser compatibility detecting method and system |
-
2017
- 2017-03-22 CN CN201710174275.0A patent/CN107133165B/en active Active
Patent Citations (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN103942137A (en) * | 2013-01-23 | 2014-07-23 | 腾讯科技(深圳)有限公司 | Browser compatibility testing method and device |
CN104156307A (en) * | 2014-07-03 | 2014-11-19 | 安徽景行信息科技有限公司 | Browser compatibility detecting method and system |
Non-Patent Citations (1)
Title |
---|
HTML5兼容性检测方法性能对比;李可;《科技广场》;20170228(第2期);33—36 * |
Also Published As
Publication number | Publication date |
---|---|
CN107133165A (en) | 2017-09-05 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN107133165B (en) | Browser compatibility detection method and device | |
KR101953303B1 (en) | Identifying matching applications based on browsing activity | |
WO2018223717A1 (en) | Webpage front-end testing method, device, system, apparatus and readable storage medium | |
US20160349928A1 (en) | Generating summary of activity on computer gui | |
US20150324362A1 (en) | Method and system for measuring user engagement with content items | |
CN107528718B (en) | Method, device and system for acquiring resources | |
US10191838B2 (en) | Method and device for checking influence of deleting cache file, and mobile terminal | |
CN105183760B (en) | Webpage component loading method and device | |
CN111522738A (en) | Test method and device of micro-service system, storage medium and electronic equipment | |
RU2016139156A (en) | AUTOMATED INTELLECTUAL DATA COLLECTION AND VERIFICATION | |
US20170171334A1 (en) | Single-account multiple-preference recommendation method for video website and electronic device | |
CN102664925A (en) | A method and device for displaying search results | |
CN117370203B (en) | Automatic test method, system, electronic equipment and storage medium | |
CN110908907A (en) | Web page testing method, device, equipment and storage medium | |
CN111597557A (en) | Malicious application detection method, system, device, equipment and storage medium | |
WO2014036923A1 (en) | Method and apparatus for identifying initiation items | |
CN112346761A (en) | Front-end resource online method, equipment, system and storage medium | |
CN112363814B (en) | Task scheduling method, device, computer equipment and storage medium | |
KR102021383B1 (en) | Method and apparatus for analyzing program by associating dynamic analysis with static analysis | |
CN107766228A (en) | It is a kind of based on multilingual automated testing method and device | |
JP6110139B2 (en) | File management program, file management apparatus, and file management method | |
CN111563153B (en) | Recommendation method and terminal based on clipboard information sharing implementation | |
US8751508B1 (en) | Contextual indexing of applications | |
CN105354490A (en) | Method and device for processing hijacked browser | |
CN110955813A (en) | Data crawling method and device |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |