CN112379917B - Browser compatibility improving method, device, equipment and storage medium - Google Patents

Browser compatibility improving method, device, equipment and storage medium Download PDF

Info

Publication number
CN112379917B
CN112379917B CN202011302811.9A CN202011302811A CN112379917B CN 112379917 B CN112379917 B CN 112379917B CN 202011302811 A CN202011302811 A CN 202011302811A CN 112379917 B CN112379917 B CN 112379917B
Authority
CN
China
Prior art keywords
syntax tree
abstract syntax
end file
compatibility
nodes
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
Application number
CN202011302811.9A
Other languages
Chinese (zh)
Other versions
CN112379917A (en
Inventor
周利杰
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Kangjian Information Technology Shenzhen Co Ltd
Original Assignee
Kangjian Information Technology Shenzhen Co Ltd
Priority date (The priority date 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 date listed.)
Filing date
Publication date
Application filed by Kangjian Information Technology Shenzhen Co Ltd filed Critical Kangjian Information Technology Shenzhen Co Ltd
Priority to CN202011302811.9A priority Critical patent/CN112379917B/en
Publication of CN112379917A publication Critical patent/CN112379917A/en
Application granted granted Critical
Publication of CN112379917B publication Critical patent/CN112379917B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/71Version control; Configuration management
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F8/00Arrangements for software engineering
    • G06F8/70Software maintenance or management
    • G06F8/76Adapting program code to run in a different environment; Porting

Abstract

The invention relates to the field of research and development management, and discloses a method, a device, equipment and a storage medium for improving browser compatibility, wherein the method comprises the following steps: acquiring a front-end file of a browser; inputting the front-end file into a grammar analyzer, and analyzing the front-end file into a first abstract grammar tree; traversing a first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree; replacing codes of nodes with code implementation versions higher than the preset version in each node with the codes of the preset version to obtain a second abstract syntax tree; traversing the second abstract syntax tree, and replacing codes of incompatible nodes of the second abstract syntax tree with corresponding compatibility codes; and inputting the second abstract syntax tree after the code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser. In addition, the invention also relates to a blockchain technology, and the front-end file can be stored in the blockchain.

Description

Browser compatibility improving method, device, equipment and storage medium
Technical Field
The present invention relates to the field of research and development management, and in particular, to a method, an apparatus, a device, and a storage medium for improving browser compatibility.
Background
With the development of society, more and more users browse web pages through a browser, and meanwhile, more and more workflows are transferred from a desktop application to a browser end for use. With the continued iteration of the novel technique, it appears to be hearty and weak, leaving behind numerous incompatible, nonstandard APIs, low-version browsers use advanced methods and properties, extending the Polyfill concept in order to reconcile the user experience. Polyfill is a piece of code (typically JavaScript on the Web) that is used to provide newer functionality for low-version browsers without native support. Such as an object. Assignment method, which is used to copy the values of all the enumerable properties from one or more source objects to a target object. In the service development process, the method greatly improves the development efficiency of merging and copying objects, but due to incompatibility of the low-version IE browser, the user experience is reduced, even no user experience is needed, and at the moment, the Polyfill solves the problem of downward compatibility, so that the user experience is consistent. Polyfill is not without drawbacks, however, and it only patches low version browser incompatible methods and properties. For the grammar level, it is still not enough, and a large number of Polyfill detection will affect the application performance to some extent.
Disclosure of Invention
The invention mainly aims to solve the technical problem of low grammar compatibility of the existing low-version browser.
The first aspect of the present invention provides a method for improving browser compatibility, including:
acquiring a front-end file of a browser;
inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree;
replacing codes of nodes with the implementation version higher than the preset version in all the nodes of the first abstract syntax tree with the codes of the preset version to lower the version of the nodes with the implementation version higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser.
Optionally, in a first implementation manner of the first aspect of the present invention, inputting the front-end file into a preset parser, and parsing, by the parser, the front-end file into a first abstract syntax tree includes:
inputting the front-end file into the grammar analyzer, performing lexical analysis on the front-end file through the grammar analyzer, and converting the front-end file into an array consisting of lexical units;
and generating a first abstract syntax tree of the front-end file according to the array.
Optionally, in a second implementation manner of the first aspect of the present invention, the inputting the front-end file into the parser, performing lexical analysis on the front-end file by the parser, and converting the front-end file into an array composed of lexical units includes:
inputting the front-end file into the grammar analyzer, scanning source codes of the front-end file line by line through the grammar analyzer, and decomposing the source codes into lexical units, wherein the lexical units are basic word symbols in the form of character strings in a programming language;
and combining the lexical unit sequences into an array.
Optionally, in a third implementation manner of the first aspect of the present invention, the generating, according to the array, the first abstract syntax tree of the front-end file includes:
analyzing the grammar of the source code according to the array, and judging whether the grammar of the source code is correct or not;
if yes, generating a grammar analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creation method corresponding to each node in the grammar analysis tree, creating a node object, and generating a first abstract grammar tree according to the node object.
Optionally, in a fourth implementation manner of the first aspect of the present invention, before the inputting the front-end file into a preset parser, parsing, by the parser, the front-end file into a first abstract syntax tree, the method further includes:
judging whether the statement of each source code in the front-end file is missing or not;
if the statement of the source code is missing, discarding the source code.
Optionally, in a fifth implementation manner of the first aspect of the present invention, traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes includes:
Reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition or not;
if the conversion condition is met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and jumping to a step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the conversion condition is not met, directly jumping to the step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the current node is at the node bottom of the second abstract syntax tree, finishing traversing;
if the current node is not at the node bottom of the second abstract syntax tree, reading the next node as the current node, and jumping to the step of judging whether the type value of the current node meets the conversion condition.
The second aspect of the present invention provides a browser compatibility improving apparatus, including:
the acquisition module is used for acquiring the front-end file of the browser;
the input module is used for inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
The first traversing module is used for traversing all nodes of the first abstract syntax tree and acquiring code realization versions of all nodes in the first abstract syntax tree;
the replacing module is used for replacing codes of nodes with the implementation version higher than the preset version in all the nodes of the first abstract syntax tree with the codes of the preset version to reduce the version of the nodes with the implementation mode higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
the second traversing module is used for traversing all nodes of the second abstract syntax tree and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
the output module is used for inputting the second abstract syntax tree after the code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into the engineering catalog of the browser.
Optionally, in a first implementation manner of the second aspect of the present invention, the input module includes:
the lexical analysis unit is used for inputting the front-end file into the grammar analyzer, performing lexical analysis on the front-end file through the grammar analyzer, and converting the front-end file into an array consisting of lexical units;
And the grammar tree generating unit is used for generating a first abstract grammar tree of the front-end file according to the array.
Optionally, in a second implementation manner of the second aspect of the present invention, the lexical analysis unit is specifically configured to:
inputting the front-end file into the grammar analyzer, and scanning the source code of the front-end file line by line through the grammar analyzer and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in the form of character strings in a programming language;
and combining the lexical unit sequences into an array.
Optionally, in a third implementation manner of the second aspect of the present invention, the syntax tree generating unit is specifically configured to:
analyzing the grammar of the source code according to the array, and judging whether the grammar of the source code is correct or not;
if yes, generating a grammar analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creation method corresponding to each node in the grammar analysis tree, creating a node object, and generating a first abstract grammar tree according to the node object.
Optionally, in a fourth implementation manner of the second aspect of the present invention, the browser compatibility improving device further includes a judging module, where the judging module is specifically configured to:
Judging whether the statement of each source code in the front-end file is missing or not;
if the statement of the source code is missing, discarding the source code.
Optionally, in a fifth implementation manner of the second aspect of the present invention, the second traversal module is specifically configured to:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition or not;
if the conversion condition is met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and jumping to a step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the conversion condition is not met, directly jumping to the step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the current node is at the node bottom of the second abstract syntax tree, finishing traversing;
if the current node is not at the node bottom of the second abstract syntax tree, reading the next node as the current node, and jumping to the step of judging whether the type value of the current node meets the conversion condition.
A third aspect of the present invention provides a browser compatibility improving apparatus, including: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line; the at least one processor invokes the instructions in the memory to cause the browser compatibility improving device to perform the browser compatibility improving method described above.
A fourth aspect of the present invention provides a computer-readable storage medium having instructions stored therein that, when executed on a computer, cause the computer to perform the above-described browser compatibility improving method.
In the technical scheme of the invention, a front-end file of a browser is acquired; inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer; traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree; replacing codes of nodes with code implementation versions higher than a preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser. According to the method, the front-end file of the browser is subjected to lexical analysis and grammar analysis to generate the abstract syntax tree, the nodes in the abstract syntax tree are replaced according to the compatibility rule, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into the engineering catalog of the browser, so that the compatibility of the browser is improved. Furthermore, the present invention also relates to blockchain techniques, the front-end files may be stored in the blockchain.
Drawings
FIG. 1 is a diagram illustrating a first embodiment of a method for improving browser compatibility according to an embodiment of the present invention;
FIG. 2 is a diagram illustrating a second embodiment of a method for improving browser compatibility according to an embodiment of the present invention;
FIG. 3 is a diagram illustrating a third embodiment of a method for improving browser compatibility according to an embodiment of the present invention;
FIG. 4 is a diagram illustrating a fourth embodiment of a method for improving browser compatibility according to an embodiment of the present invention;
FIG. 5 is a schematic diagram of a fifth embodiment of a method for improving browser compatibility according to an embodiment of the present invention;
FIG. 6 is a schematic diagram of an embodiment of a browser compatibility improving apparatus according to an embodiment of the present invention;
FIG. 7 is a schematic diagram of another embodiment of a browser compatibility improving apparatus according to an embodiment of the present invention;
fig. 8 is a schematic diagram of an embodiment of a browser compatibility improving device according to an embodiment of the present invention.
Detailed Description
In the technical scheme of the invention, a front-end file of a browser is acquired; inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer; traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree; replacing codes of nodes with code implementation versions higher than a preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser. According to the method, the front-end file of the browser is subjected to lexical analysis and grammar analysis to generate the abstract syntax tree, the nodes in the abstract syntax tree are replaced according to the compatibility rule, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into the engineering catalog of the browser, so that the compatibility of the browser is improved. Furthermore, the present invention also relates to blockchain techniques, the front-end files may be stored in the blockchain.
The terms "first," "second," "third," "fourth" and the like in the description and in the claims and in the above drawings, if any, are used for distinguishing between similar objects and not necessarily for describing a particular sequential or chronological order. It is to be understood that the data so used may be interchanged where appropriate such that the embodiments described herein may be implemented in other sequences than those illustrated or otherwise described herein. Furthermore, the terms "comprises," "comprising," or any other variation 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 or inherent to such process, method, article, or apparatus.
For easy understanding, the following describes a specific flow of an embodiment of the present invention, referring to fig. 1, and a first embodiment of a method for improving browser compatibility in an embodiment of the present invention includes:
101. inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
It can be understood that the execution body of the present invention may be a browser compatibility improving device, and may also be a terminal or a server, which is not limited herein. The embodiment of the invention is described by taking a server as an execution main body as an example.
It should be emphasized that, to ensure the privacy and security of the browser, the front-end file may be stored in a blockchain node.
In this embodiment, the front-end file is a js (JavaScript) file, js is a lightweight, interpreted or just-in-time compiled high-level programming language with function priority, and may be used as a scripting language for a Web page of a browser, where JavaScript is based on a prototype programming, multiple-format dynamic scripting language, and supports object-oriented, command-oriented and declarative (e.g. functional programming) styles, which are commonly used to add various dynamic functions to a Web page of a browser, and provide a smoother and more attractive browsing effect for a user.
102. Inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
in this embodiment, the Parser is mainly a Babel compiler, and the Parser (Parser) usually appears as a component of a compiler or an interpreter, and functions to perform a grammar check and construct a data structure (typically, a hierarchical data structure such as a parse tree, an abstract syntax tree, etc.) composed of input words. The parser typically uses a separate lexical analyzer to separate individual "words" from the input character stream and takes the word stream as its input. In practical development, the parser may be written manually or may be (semi-) automatically generated using tools. The babel is a JavaScript compiler. Macroscopically, it runs code in 3 phases: parsing (parsing) -converting the code string into an AST abstract syntax tree, translating (transforming) -transforming the abstract syntax tree to generate (generation) -generating a new code string from the transformed abstract syntax tree.
In this embodiment, the parsing of the front-end file into the first abstract syntax tree by the parser includes lexical parsing, which mainly reads a character stream of a source code of the input front-end file and then identifies a token (also called a word symbol or a symbol) according to a word-forming rule, and syntax parsing, which mainly combines word sequences into various grammar phrases, such as "programs", "sentences", "expressions", and the like, on the basis of the lexical parsing, to form an AST (Abstract Syntax Tree ).
103. Traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree;
104. replacing codes of nodes with code implementation versions higher than the preset version in all the nodes of the first abstract syntax tree with the codes of the preset version to obtain a second abstract syntax tree;
in this embodiment, the implementation manner of the preset version is an ES5 version, where ES represents ECMAScript, and the front-end language JavaScript is mainly divided into 3 parts, which are respectively a core grammar, DOM and BOM, where the core grammar is ECMAScript, and specifies the constituent parts of the language: grammar, type, sentence, keyword, reserved word, operator, object, front-end language JavaScript update, mainly ECMAScript version update, and DOM and BOM update are fewer, so ECMAScript can be considered as a reference of JavaScript, and JavaScript is an implementation of ECMAScript. In this embodiment, the implementation version higher than the preset version ES5 includes the version of ES6, ES7, etc. published behind ES5, and in practical application, there is no JavaScript agent (whether a browser environment or a server environment) that fully supports ES6, so a developer enthusiastically using the latest feature of language needs to translate ES6 code into ES5 code.
105. Traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
in this embodiment, the second abstract syntax tree transferred to ES5 is used as an input condition, the root node Type of the second abstract syntax tree is read, whether the Type value of the node matches the conversion condition is checked, and if so, the current node is replaced by a compatible implementation.
In this embodiment, the abstract syntax tree generated by the syntax analyzer has a plurality of levels, and by traversing all nodes in all the abstract syntax trees from the top layer, it is determined whether the type value of each node needs to be replaced by compatibility, so as to realize the function of providing compatibility for the whole second abstract syntax tree. The method mainly comprises the steps of reading js files through command lines and converting the js files into ast for processing, wherein the blast tool library comprises run: through the assert () and check (), the type of the AST object can be verified, and the visual is that an AST tree is traversed, an effective AST object is obtained and changed, wherein the visual is used for AST node traversal, and attention is paid to operation function declaration, and the visual function description traversal is used, and the operation assignment expression is used. The object defined in the AST object document can be traversed by adding a visit to the front.
106. And inputting the second abstract syntax tree after the code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser.
In this embodiment, the second abstract syntax tree after code replacement is input to detect the API to perform compatibility processing when comparing with Polyfill in the running of the browser environment, and the scheme completes the repair of the API of the low-version browser in the construction stage, and meanwhile, determines the syntax support degree of the corresponding version browser according to the parameter entering in the parsing stage, and converts the syntax such as Getter, setter incompatible under IE8 into the implementation mode compatible with the corresponding version.
In this embodiment, the front-end file of the browser is obtained; inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer; reducing the version of the node with the implementation mode higher than the preset version in the first abstract syntax tree to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing incompatible nodes in all nodes with compatible codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser. According to the method, the front-end file of the browser is subjected to lexical analysis and grammar analysis to generate the abstract syntax tree, the nodes in the abstract syntax tree are replaced according to the compatibility rule, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into the engineering catalog of the browser, so that the compatibility of the browser is improved. Furthermore, the present invention also relates to blockchain techniques, the front-end files may be stored in the blockchain.
Referring to fig. 2, a second embodiment of a method for improving browser compatibility according to an embodiment of the present invention includes:
201. acquiring a front-end file of a browser;
step 201 in this embodiment is similar to step 101 in the first embodiment, and will not be described here again.
202. Inputting the front-end file into a grammar analyzer, and scanning the source code of the front-end file line by line through the grammar analyzer and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in the form of character strings in a programming language;
in this embodiment, an abstract syntax tree is constructed mainly through two processes of lexical analysis and syntax analysis, wherein the lexical analysis mainly reads a character stream of a source code of an input front-end file and then identifies a token (also called a word symbol or a symbol) according to a word forming rule, and the syntax analysis mainly combines word sequences into various syntax phrases such as a "program", "sentence", "expression" and the like on the basis of the lexical analysis to form an AST (Abstract Syntax Tree ).
203. Combining the lexical unit sequences into an array;
in this embodiment, each sentence of the source code is scanned in the lexical analysis process, and word segmentation is performed while scanning, so as to obtain a lexical unit of each sentence of the source code. The lexical unit is a basic constituent unit of the sentence, and the lexical unit may be a keyword, a variable name, an operator, a constant, or the like, for example, a source code of "consta=1, constb=a+1 is obtained; the first statement "consta=1" is scanned, and first "const" is scanned, so that a lexical unit is generated to represent "const" as a keyword; scanning to 'a', and generating a lexical unit to represent 'a' as a variable name; then scanning to "=", and generating a lexical unit representation "=" as an operator; scanning to constant '1', and generating a lexical unit to represent '1' as constant; and finally scanning punctuation marks, and generating a lexical unit representation which is the punctuation marks. In the lexical analysis process, each lexical unit of the sentence "consta=1" is formed into an array { consta=1 }. Similarly, the lexical subsystem will statement "constb=a+1; "convert to an array of lexical units { constb=a+1; }.
204. Generating a first abstract syntax tree of the front-end file according to the array;
205. traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree;
206. replacing codes of nodes with code implementation versions higher than the preset version in all the nodes of the first abstract syntax tree with the codes of the preset version to obtain a second abstract syntax tree;
207. traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
208. and inputting the second abstract syntax tree after the code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser.
Steps 205-208 in this embodiment are similar to steps 103-106 in the first embodiment, and will not be described again here.
The present embodiment describes in detail the process of generating an abstract syntax tree on the basis of the above embodiment, by inputting a front-end file into a syntax analyzer, performing lexical analysis on the front-end file by the syntax analyzer, and converting the front-end file into an array composed of lexical units; generating a first abstract syntax tree of the front-end file according to the array, wherein the front-end file is subjected to lexical analysis by a syntax analyzer, and the front-end file is converted into the array consisting of lexical units mainly by inputting the front-end file into the syntax analyzer, and scanning source codes of the front-end file line by the syntax analyzer; decomposing the source code into lexical units, wherein the lexical units are basic word symbols in the form of character strings in the programming language; the method realizes the effect of replacing incompatible codes in the front-end file by generating an abstract syntax tree.
Referring to fig. 3, a third embodiment of a method for improving browser compatibility according to an embodiment of the present invention includes:
301. acquiring a front-end file of a browser;
302. inputting the front-end file into a grammar analyzer, performing lexical analysis on the front-end file through the grammar analyzer, and converting the front-end file into an array consisting of lexical units;
303. analyzing the grammar of the source code according to the array, and judging whether the grammar of the source code is correct;
304. if yes, generating a grammar analysis tree corresponding to the source code according to a preset source code language specification;
305. calling a node object creation method corresponding to each node in the syntax analysis tree, creating a node object, and generating a first abstract syntax tree according to the node object;
in this embodiment, if the grammar of the source code is wrong, the error information may be fed back to the user, the modified source code returned by the user is received, the modified source code is subjected to lexical analysis, the modified source code is converted into an array composed of lexical units, and the abstract grammar tree is generated according to the array composed of lexical units of the modified source code. For example, the parser is for source code "consta=1, constb=a+1; "analyze, determine the syntax error of the first sentence" consta=1 "of the source code, the end of which should be a semicolon instead of a comma. The grammar analyzer feeds back error information to the user and receives the modified source code returned by the user. For example, receiving a modified source code "consta=1 returned by the user; constb=a+1; ". The lexical analyzer performs lexical analysis on the modified source code to obtain an array of lexical units of the modified source code, for example { consta=1; { constb=a+1; the parser generates the abstract syntax tree from an array of lexical elements of the modified source code.
In this embodiment, the abstract syntax tree is built on the basis of a syntax analysis tree. The working process is to analyze character strings in a grammar tree and extract Token information according to the grammar of the self-defined abstract grammar tree, and respectively call corresponding methods according to different levels of nodes such as root nodes, class node classes and method node classes to create node objects, and then generate a program abstract grammar tree.
306. Traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree;
307. replacing codes of nodes with code implementation versions higher than the preset version in all the nodes of the first abstract syntax tree with the codes of the preset version to obtain a second abstract syntax tree;
308. traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
309. and inputting the second abstract syntax tree after the code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser.
The present embodiment describes in detail, based on the previous embodiment, a process of generating a first abstract syntax tree of the front-end file according to the array, and determines whether the syntax of the source code is correct by performing syntax analysis on the source code according to the array; if yes, generating a grammar analysis tree corresponding to the source code according to a preset source code language specification; and calling a node object creation method corresponding to each node in the grammar analysis tree, creating a node object, and generating a first abstract grammar tree according to the node object.
Referring to fig. 4, a fourth embodiment of a method for improving browser compatibility according to an embodiment of the present invention includes:
401. acquiring a front-end file of a browser;
402. judging whether the statement of each source code in the front-end file is missing or not;
403. if the statement of the source code is missing, discarding the source code;
in this embodiment, before the front-end file is input into the parser, the source code of the front-end file may be checked, whether each source code in the front-end file has a miss may be determined, if the source code has a miss, the location of the source code is determined and an alarm is sent, and whether the source code has only a start sentence and an end sentence may be determined according to a preset keyword. For example, it may be determined whether the source code includes only the keywords of the start sentence and the keywords of the end sentence, and if the source code includes only the keywords of the start sentence and the keywords of the end sentence, it is determined that the source code includes only the start sentence and the end sentence, and that the source code has a sentence missing.
404. Inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
405. traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree;
406. replacing codes of nodes with code implementation versions higher than a preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
407. traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
408. and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser.
The embodiment adds a process of checking the source codes in the front-end file based on the previous embodiment, and judges whether the statement of each source code in the plurality of source codes is missing or not; if the statement of the source code is missing, the source code is abandoned, and the problem of code missing during compatibility code conversion is avoided by the method.
Referring to fig. 5, a fifth embodiment of a method for improving browser compatibility according to an embodiment of the present invention includes:
501. acquiring a front-end file of a browser;
502. inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
503. traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree;
504. replacing codes of nodes with code implementation versions higher than the preset version in all the nodes of the first abstract syntax tree with the codes of the preset version to obtain a second abstract syntax tree;
505. reading a root node of the second abstract syntax tree, and taking the root node as a current node;
506. judging whether the type value of the current node meets the conversion condition or not;
507. if the conversion condition is met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
508. replacing the source code of the current node with the compatibility code, and jumping to the step 508 of detecting whether the current node is at the node bottom of the second abstract syntax tree;
509. if the conversion condition is not met, detecting whether the current node is at the node bottom of the second abstract syntax tree;
510. If the current node is at the node bottom of the second abstract syntax tree, finishing traversing;
511. if the current node is not at the node bottom of the second abstract syntax tree, reading the next node as the current node, and jumping to the step of judging whether the type value of the current node meets the conversion condition;
512. and inputting the second abstract syntax tree after the code replacement into a syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser.
In this embodiment, the Type value in the abstract syntax tree is a set of fixed values colloquially defined in industry, including Variable Declaration, while state, with state, etc., for example, var=1 in the nodes of the abstract syntax tree needs to be replaced With consta=1, where the Type value of var is Variable Declaration, which is determined to be consistent With the conversion condition, represents that the var Statement is hit, where var is replaced With const through a fixed syntax, all the nodes in the second abstract syntax tree are traversed, determining whether the Type of each node in the abstract syntax tree meets the conversion condition, converting the codes of the nodes meeting the conversion condition, and all the nodes in the new abstract syntax tree obtained meet compatibility.
The embodiment describes in detail the process of traversing all nodes of the second abstract syntax tree and replacing incompatible nodes in all nodes with compatible codes based on the previous embodiment, and judges whether the type value of the root node meets the conversion condition by reading the root node of the second abstract syntax tree; if the conversion condition is met, replacing the code of the current node with the compatibility code, detecting whether the current node is at the node bottom of the second abstract syntax tree, and if the current node is at the node bottom of the second abstract syntax tree, ending the traversal; if the current node is not at the node bottom of the second abstract syntax tree, reading the next node to judge whether the type value accords with the conversion condition; if the conversion condition is not met, the next node is read to judge whether the type value meets the conversion condition, and the method enables codes in all nodes in the abstract syntax tree to have compatibility, so that the converted front-end file has compatibility.
The method for improving the compatibility of the browser in the embodiment of the present invention is described above, and the device for improving the compatibility of the browser in the embodiment of the present invention is described below, referring to fig. 6, where an embodiment of the device for improving the compatibility of the browser in the embodiment of the present invention includes:
The acquiring module 601 is configured to acquire a front-end file of a browser;
the input module 602 is configured to input the front-end file into a preset parser, and parse the front-end file into a first abstract syntax tree through the parser;
a first traversing module 603, configured to traverse all nodes of the first abstract syntax tree, and obtain a code implementation version of each node in the first abstract syntax tree;
a replacing module 604, configured to replace, with a code of a preset version, codes of nodes with code implementation versions higher than the preset version in all nodes of the first abstract syntax tree, and reduce the version of the nodes with implementation modes higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
a second traversing module 605, configured to traverse all nodes of the second abstract syntax tree, and replace codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
and an output module 606, configured to input the second abstract syntax tree after the code replacement into the syntax analyzer, convert the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and input the compatibility front-end file into an engineering catalog of the browser.
It should be emphasized that, to ensure the privacy and security of the browser, the front-end file may be stored in a blockchain node.
In the embodiment of the invention, the browser compatibility improving device operates the browser compatibility improving method, and the browser compatibility improving method comprises the following steps: acquiring a front-end file of a browser; inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer; traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree; replacing codes of nodes with code implementation versions higher than a preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree; traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes; and inputting the second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser. According to the method, the front-end file of the browser is subjected to lexical analysis and grammar analysis to generate the abstract syntax tree, the nodes in the abstract syntax tree are replaced according to the compatibility rule, all the nodes in the abstract syntax tree have compatibility, the replaced abstract syntax tree is converted into the compatible front-end file, and the compatible front-end file is input into the engineering catalog of the browser, so that the compatibility of the browser is improved. Furthermore, the present invention also relates to blockchain techniques, the front-end files may be stored in the blockchain.
Referring to fig. 7, a second embodiment of a browser compatibility improving apparatus according to an embodiment of the present invention includes:
the acquiring module 601 is configured to acquire a front-end file of a browser;
the input module 602 is configured to input the front-end file into a preset parser, and parse the front-end file into a first abstract syntax tree through the parser;
a first traversing module 603, configured to traverse all nodes of the first abstract syntax tree, and obtain a code implementation version of each node in the first abstract syntax tree;
a replacing module 604, configured to replace, with a code of a preset version, codes of nodes with code implementation versions higher than the preset version in all nodes of the first abstract syntax tree, and reduce the version of the nodes with implementation modes higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
a second traversing module 605, configured to traverse all nodes of the second abstract syntax tree, and replace codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
and an output module 606, configured to input the second abstract syntax tree after the code replacement into the syntax analyzer, convert the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and input the compatibility front-end file into an engineering catalog of the browser.
Wherein the input module 602 includes:
a lexical analysis unit 6021 for inputting the front-end file into the parser, performing lexical analysis on the front-end file by the parser, and converting the front-end file into an array composed of lexical units;
a syntax tree generating unit 6022 for generating a first abstract syntax tree of the front-end file according to the array.
Optionally, the lexical analysis unit 6021 is specifically configured to:
inputting the front-end file into the grammar analyzer, scanning source codes of the front-end file line by line through the grammar analyzer, and decomposing the source codes into lexical units, wherein the lexical units are basic word symbols in the form of character strings in a programming language;
and combining the lexical unit sequences into an array.
Optionally, the syntax tree generating unit 6022 is specifically configured to:
analyzing the grammar of the source code according to the array, and judging whether the grammar of the source code is correct or not;
if yes, generating a grammar analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creation method corresponding to each node in the grammar analysis tree, creating a node object, and generating a first abstract grammar tree according to the node object.
Optionally, the browser compatibility improving apparatus further includes a judging module 607, where the judging module 607 is specifically configured to:
judging whether the statement of each source code in the front-end file is missing or not;
if the statement of the source code is missing, discarding the source code.
Optionally, the second traversing module 605 is specifically configured to:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition or not;
if the conversion condition is met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and jumping to a step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the conversion condition is not met, directly jumping to the step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the current node is at the node bottom of the second abstract syntax tree, finishing traversing;
if the current node is not at the node bottom of the second abstract syntax tree, reading the next node as the current node, and jumping to the step of judging whether the type value of the current node meets the conversion condition.
The embodiment describes the specific functions of each module and the unit constitution of part of the modules in detail on the basis of the previous embodiment, wherein the input module comprises a lexical analysis unit and a grammar tree generation unit, the lexical analysis and the grammar analysis are performed through the modules and the units to generate an abstract grammar tree, the nodes in the abstract grammar tree are replaced according to the compatibility rule, all the nodes in the abstract grammar tree have compatibility, the replaced abstract grammar tree is converted into a compatibility front-end file, and the compatibility front-end file is input into an engineering catalog of the browser, so that the compatibility of the browser is improved. Furthermore, the present invention also relates to blockchain techniques, the front-end files may be stored in the blockchain.
The above-mentioned embodiments of the present invention are described in detail with reference to fig. 6 and fig. 7 from the point of view of modularized functional entities, and the following details of the browser compatibility improving device in the embodiments of the present invention from the point of view of hardware processing.
Fig. 8 is a schematic structural diagram of a browser compatibility promoting device according to an embodiment of the present invention, where the browser compatibility promoting device 800 may have a relatively large difference due to different configurations or performances, and may include one or more processors (central processing units, CPU) 810 (e.g., one or more processors) and a memory 820, and one or more storage media 830 (e.g., one or more mass storage devices) storing application programs 833 or data 832. Wherein memory 820 and storage medium 830 can be transitory or persistent. The program stored in the storage medium 830 may include one or more modules (not shown), each of which may include a series of instruction operations in the browser compatibility improving device 800. Still further, the processor 810 may be configured to communicate with the storage medium 830 and execute a series of instruction operations in the storage medium 830 on the browser compatibility improving device 800 to implement the steps of the browser compatibility improving method described above.
The browser compatibility enhancing device 800 may also include one or more power supplies 840, one or more wired or wireless network interfaces 850, one or more input/output interfaces 860, and/or one or more operating systems 831, such as Windows Server, mac OS X, unix, linux, freeBSD, etc. It will be appreciated by those skilled in the art that the browser compatibility promoting device structure shown in fig. 8 is not limiting of the browser compatibility promoting device provided by the present application, and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
The blockchain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, consensus mechanism, encryption algorithm and the like. The Blockchain (Blockchain), which is essentially a decentralised database, is a string of data blocks that are generated by cryptographic means in association, each data block containing a batch of information of network transactions for verifying the validity of the information (anti-counterfeiting) and generating the next block. The blockchain may include a blockchain underlying platform, a platform product services layer, an application services layer, and the like.
The present invention also provides a computer readable storage medium, which may be a non-volatile computer readable storage medium, and may also be a volatile computer readable storage medium, where instructions are stored in the computer readable storage medium, when the instructions are executed on a computer, cause the computer to perform the steps of the method for improving browser compatibility.
It will be clearly understood by those skilled in the art that, for convenience and brevity of description, the specific working process of the system or apparatus and unit described above may refer to the corresponding process in the foregoing method embodiment, which is not repeated herein.
The integrated units, if implemented in the form of software functional units and sold or used as stand-alone products, may be stored in a computer readable storage medium. Based on such understanding, the technical solution of the present invention may be embodied essentially or in part or all of the technical solution or in part in the form of a software product stored in a storage medium, including instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method according to the embodiments of the present invention. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a read-only memory (ROM), a random access memory (random access memory, RAM), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
The above embodiments are only for illustrating the technical solution of the present invention, and not for limiting the same; although the invention has been described in detail with reference to the foregoing embodiments, it will be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims (10)

1. The browser compatibility improving method is characterized by comprising the following steps of:
acquiring a front-end file of a browser;
inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
traversing all nodes of the first abstract syntax tree to obtain code realization versions of all nodes in the first abstract syntax tree;
replacing codes of nodes with code implementation versions higher than a preset version in all the nodes of the first abstract syntax tree with codes of the preset version to obtain a second abstract syntax tree;
traversing all nodes of the second abstract syntax tree, and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
Inputting a second abstract syntax tree after code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into an engineering catalog of the browser;
the traversing all nodes of the second abstract syntax tree and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes comprises:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition or not;
if the conversion condition is met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and jumping to a step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the conversion condition is not met, directly jumping to the step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
detecting whether the current node is at the node bottom of the second abstract syntax tree;
If the current node is at the node bottom of the second abstract syntax tree, finishing traversing;
if the current node is not at the node bottom of the second abstract syntax tree, reading the next node as the current node, and jumping to the step of judging whether the type value of the current node meets the conversion condition.
2. The method for improving compatibility of a browser according to claim 1, wherein inputting the front-end file into a preset parser, and parsing the front-end file into a first abstract syntax tree by the parser comprises:
inputting the front-end file into the grammar analyzer, performing lexical analysis on the front-end file through the grammar analyzer, and converting the front-end file into an array consisting of lexical units;
and generating a first abstract syntax tree of the front-end file according to the array.
3. The method for improving compatibility of a browser according to claim 2, wherein inputting the front-end file into the parser, performing lexical analysis on the front-end file by the parser, and converting the front-end file into an array consisting of lexical units comprises:
Inputting the front-end file into the grammar analyzer, and scanning the source code of the front-end file line by line through the grammar analyzer and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in the form of character strings in a programming language;
and combining the lexical unit sequences into an array.
4. The method of claim 3, wherein generating the first abstract syntax tree of the front-end file from the array comprises:
analyzing the grammar of the source code according to the array, and judging whether the grammar of the source code is correct or not;
if yes, generating a grammar analysis tree corresponding to the source code according to a preset source code language specification;
and calling a node object creation method corresponding to each node in the grammar analysis tree, creating a node object, and generating a first abstract grammar tree according to the node object.
5. The browser compatibility improving method according to claim 3, wherein before said inputting the front-end file into a preset parser, parsing the front-end file into a first abstract syntax tree by the parser, further comprising:
Judging whether the statement of each source code in the front-end file is missing or not;
if the statement of the source code is missing, discarding the source code.
6. A browser compatibility improving apparatus, characterized in that the browser compatibility improving apparatus comprises:
the acquisition module is used for acquiring the front-end file of the browser;
the input module is used for inputting the front-end file into a preset grammar analyzer, and analyzing the front-end file into a first abstract grammar tree through the grammar analyzer;
the first traversing module is used for traversing all nodes of the first abstract syntax tree and acquiring code realization versions of all nodes in the first abstract syntax tree;
the replacing module is used for replacing codes of nodes with the implementation version higher than the preset version in all the nodes of the first abstract syntax tree with the codes of the preset version to reduce the version of the nodes with the implementation mode higher than the preset version in the first abstract syntax tree, so as to obtain a second abstract syntax tree;
the second traversing module is used for traversing all nodes of the second abstract syntax tree and replacing codes of incompatible nodes in all nodes of the second abstract syntax tree with corresponding compatibility codes;
The output module is used for inputting the second abstract syntax tree after the code replacement into the syntax analyzer, converting the second abstract syntax tree into a compatibility front-end file through the syntax analyzer, and inputting the compatibility front-end file into the engineering catalog of the browser;
the second traversing module is specifically configured to:
reading a root node of the second abstract syntax tree, and taking the root node as a current node;
judging whether the type value of the current node meets the conversion condition or not;
if the conversion condition is met, acquiring a compatibility code corresponding to the source code of the current node according to a preset corresponding relation;
replacing the source code of the current node with the compatibility code, and jumping to a step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the conversion condition is not met, directly jumping to the step of detecting whether the current node is at the node bottom of the second abstract syntax tree;
detecting whether the current node is at the node bottom of the second abstract syntax tree;
if the current node is at the node bottom of the second abstract syntax tree, finishing traversing;
if the current node is not at the node bottom of the second abstract syntax tree, reading the next node as the current node, and jumping to the step of judging whether the type value of the current node meets the conversion condition.
7. The browser compatibility improving apparatus of claim 6, wherein the input module comprises:
the lexical analysis unit is used for inputting the front-end file into the grammar analyzer, performing lexical analysis on the front-end file through the grammar analyzer, and converting the front-end file into an array consisting of lexical units;
and the grammar tree generating unit is used for generating a first abstract grammar tree of the front-end file according to the array.
8. The browser compatibility improving apparatus according to claim 7, wherein the lexical analysis unit is specifically configured to:
inputting the front-end file into the grammar analyzer, and scanning the source code of the front-end file line by line through the grammar analyzer and decomposing the source code into lexical units, wherein the lexical units are basic word symbols in the form of character strings in a programming language;
and combining the lexical unit sequences into an array.
9. A browser compatibility improving apparatus, characterized in that the browser compatibility improving apparatus comprises: a memory and at least one processor, the memory having instructions stored therein, the memory and the at least one processor being interconnected by a line;
The at least one processor invoking the instructions in the memory to cause the browser compatibility improving device to perform the browser compatibility improving method of any of claims 1-5.
10. A computer readable storage medium having a computer program stored thereon, wherein the computer program when executed by a processor implements the browser compatibility improving method of any of claims 1-5.
CN202011302811.9A 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium Active CN112379917B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011302811.9A CN112379917B (en) 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011302811.9A CN112379917B (en) 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium

Publications (2)

Publication Number Publication Date
CN112379917A CN112379917A (en) 2021-02-19
CN112379917B true CN112379917B (en) 2023-10-20

Family

ID=74584544

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011302811.9A Active CN112379917B (en) 2020-11-19 2020-11-19 Browser compatibility improving method, device, equipment and storage medium

Country Status (1)

Country Link
CN (1) CN112379917B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112965695A (en) * 2021-03-12 2021-06-15 中国平安财产保险股份有限公司 Front-end code access detection method, device, equipment and storage medium
CN113254023B (en) * 2021-05-14 2023-08-11 网易(杭州)网络有限公司 Object reading method and device and electronic equipment
CN113326048B (en) * 2021-06-24 2023-01-17 上海万向区块链股份公司 Floating point number calculation precision processing method, system, medium and device
CN117270961B (en) * 2023-11-21 2024-04-12 武汉蜂鸟龙腾软件有限公司 Method for analyzing and loading MFC character resources in Linux environment

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150301811A1 (en) * 2013-01-23 2015-10-22 Tencent Technology (Shenzhen) Company Limited Method and apparatus for testing browser compatibility
CN109684584A (en) * 2018-11-15 2019-04-26 北京海泰方圆科技股份有限公司 A kind of intelligent switch method of browser kernel, device, terminal and storage medium
CN110457065A (en) * 2019-08-14 2019-11-15 中国工商银行股份有限公司 For obtaining the method and device of compatible multi version systematic difference
CN110471666A (en) * 2019-07-18 2019-11-19 五八有限公司 Code automatic switching method and device, code converter and medium
CN110688300A (en) * 2019-08-13 2020-01-14 平安科技(深圳)有限公司 Compatibility testing method, device, equipment and storage medium
CN111708542A (en) * 2020-06-24 2020-09-25 中国平安财产保险股份有限公司 Test case generation method, system, device and storage medium

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20150301811A1 (en) * 2013-01-23 2015-10-22 Tencent Technology (Shenzhen) Company Limited Method and apparatus for testing browser compatibility
CN109684584A (en) * 2018-11-15 2019-04-26 北京海泰方圆科技股份有限公司 A kind of intelligent switch method of browser kernel, device, terminal and storage medium
CN110471666A (en) * 2019-07-18 2019-11-19 五八有限公司 Code automatic switching method and device, code converter and medium
CN110688300A (en) * 2019-08-13 2020-01-14 平安科技(深圳)有限公司 Compatibility testing method, device, equipment and storage medium
CN110457065A (en) * 2019-08-14 2019-11-15 中国工商银行股份有限公司 For obtaining the method and device of compatible multi version systematic difference
CN111708542A (en) * 2020-06-24 2020-09-25 中国平安财产保险股份有限公司 Test case generation method, system, device and storage medium

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
王国庆.浅谈浏览器兼容统一性问题与解决方案.《电脑知识与技术》.2015,全文. *
高培.基于Web 应用的浏览器兼容性测试方法研究.《软件导刊》.2020,全文. *

Also Published As

Publication number Publication date
CN112379917A (en) 2021-02-19

Similar Documents

Publication Publication Date Title
CN112379917B (en) Browser compatibility improving method, device, equipment and storage medium
Schordan et al. A source-to-source architecture for user-defined optimizations
US6675354B1 (en) Case-insensitive custom tag recognition and handling
US8407667B2 (en) Inferring missing type information for reflection
CN108139891B (en) Method and system for generating suggestions to correct undefined token errors
US8239823B2 (en) Generating libraries for reflection without project compilation
US20040158820A1 (en) System for generating an application framework and components
Miecznikowski et al. Decompiling Java using staged encapsulation
US5940615A (en) Programming aid for enabling a computer program in source code form to be viewed using a general purpose document browser
JPH1083293A (en) Error correction compiler
JP2012063868A (en) Method to generate combined parser by combining language processing parsers, and its computer and computer program
US20170147539A1 (en) Generation apparatus, program, and generation method
KR100853933B1 (en) Migration apparatus which convert application program of mainframe system into application program of open system and method for thereof
JP2013516701A (en) Efficient invariant syntactic representation with gradual change
US20070271550A1 (en) System and method for extensible java server page resource management
US7165244B2 (en) Web application code conversion system
Juričić Detecting source code similarity using low-level languages
CN112965695A (en) Front-end code access detection method, device, equipment and storage medium
US7657869B2 (en) Integration of external tools into an existing design environment
Iwama et al. Constructing parser for industrial software specifications containing formal and natural language description
CN114816435A (en) Software development method based on reverse technology
Visser Understanding software through linguistic abstraction
CN112948734A (en) Project style integration and adaptation method, device, equipment and storage medium
CN113568678A (en) Method and device for dynamically loading resources and electronic equipment
CN112445468A (en) Typescript type file generation method, device, equipment and computer readable storage medium

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