CN111800461A - Script downloading method, device, equipment and storage medium of browser - Google Patents

Script downloading method, device, equipment and storage medium of browser Download PDF

Info

Publication number
CN111800461A
CN111800461A CN202010464414.5A CN202010464414A CN111800461A CN 111800461 A CN111800461 A CN 111800461A CN 202010464414 A CN202010464414 A CN 202010464414A CN 111800461 A CN111800461 A CN 111800461A
Authority
CN
China
Prior art keywords
script
target
browser
standard
format
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.)
Pending
Application number
CN202010464414.5A
Other languages
Chinese (zh)
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.)
OneConnect Smart Technology Co Ltd
OneConnect Financial Technology Co Ltd Shanghai
Original Assignee
OneConnect Financial Technology Co Ltd Shanghai
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 OneConnect Financial Technology Co Ltd Shanghai filed Critical OneConnect Financial Technology Co Ltd Shanghai
Priority to CN202010464414.5A priority Critical patent/CN111800461A/en
Publication of CN111800461A publication Critical patent/CN111800461A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/06Protocols specially adapted for file transfer, e.g. file transfer protocol [FTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/02Protocols based on web technology, e.g. hypertext transfer protocol [HTTP]

Abstract

The application discloses a script downloading method of a browser, which relates to the technical field of research and development management, and comprises the following steps: receiving a network connection request sent by a target browser, and establishing network connection with the target browser according to the connection request; receiving a script downloading request sent by the target browser; acquiring a header field contained in the script downloading request; generating a corresponding target script according to the head field; and sending the target script to the target browser. The application also provides a script downloading device of the browser, computer equipment and a storage medium. Backward compatibility of script downloading is realized, and convenience of script downloading is improved. In addition, the invention also relates to a block chain technology, and the target script can be stored in the block chain node.

Description

Script downloading method, device, equipment and storage medium of browser
Technical Field
The present application relates to the field of research and development management technologies, and in particular, to a method and an apparatus for downloading a browser script, a computer device, and a storage medium.
Background
The Webassignment technology provides a standard bytecode protocol, becomes a standard, is supported by browser manufacturers, and gradually realizes Webassignment virtual machines on respective latest versions, so that Webassignment bytecodes obtained from different languages can run consistently on different browsers.
However, one problem that we cannot ignore is the backward compatibility problem of Webassembly technology for low-version browsers, and although the effect of backward compatibility can be eliminated by browser version upgrading, the waiting time is long. Meanwhile, technologies, such as software shimming technology, are currently available to determine whether to execute JavaScript on an old browser or execute Webassembly on a latest browser by determining whether the browser supports the JavaScript or Webassembly.
Although the method solves the problems, in the implementation process, the browser must download copies of two languages with the same logic to determine which script to select, which not only wastes bandwidth, but also makes script downloading not convenient enough.
Disclosure of Invention
The application provides a script downloading method and device of a browser, computer equipment and a storage medium, so that backward compatibility of script downloading is realized, and convenience of script downloading is improved.
In a first aspect, the present application provides a script downloading method for a browser, where the method includes:
receiving a network connection request sent by a target browser, and establishing network connection with the target browser according to the connection request;
receiving a script downloading request sent by the target browser;
acquiring a header field contained in the script downloading request;
generating a corresponding target script according to the head field;
and sending the target script to the target browser.
In a second aspect, the present application further provides a script downloading apparatus for a browser, where the apparatus includes:
the network connection module is used for receiving a network connection request sent by a target browser and establishing network connection with the target browser according to the connection request;
the request receiving module is used for receiving a script downloading request of the target browser;
the information identification module is used for acquiring a head field contained in the script downloading request;
the script generating module is used for generating and obtaining a corresponding target script according to the head field;
and the script downloading module is used for sending the target script to the target browser.
In a third aspect, the present application further provides a computer device comprising a memory and a processor; the memory is used for storing a computer program; the processor is used for executing the computer program and realizing the script downloading method of the browser when the computer program is executed.
In a fourth aspect, the present application further provides a computer-readable storage medium, which stores a computer program, and when the computer program is executed by a processor, the processor is caused to implement the script downloading method of the browser.
When a target browser needs to acquire and download script information, a request for access and script downloading is sent to a corresponding server, then after the server receives the request information, a network link is firstly established between the server and the browser, further relevant information recorded by a head field contained in the request is acquired, a compiling form corresponding to the script at the moment is determined according to the relevant information recorded by the head field, further a corresponding target script is obtained, and finally the obtained target script is sent to the target browser, so that the target browser responds to the script information contained in the target script. Backward compatibility of script downloading is achieved, the requirement of downloading script copies of two same languages is avoided, script information stored in a server can be directly used, meanwhile, a browser is not required to actively judge and select which version of script information is downloaded, and convenience of script downloading is improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
FIG. 1 is a flowchart illustrating a script downloading method of a browser according to an embodiment of the present application;
FIG. 2 is a flowchart illustrating steps of obtaining a target script in one embodiment of the present application;
FIG. 3 is a flowchart illustrating steps for determining whether a standard script format is supported, in one embodiment of the present application;
FIG. 4 is a flowchart illustrating steps of generating a target script in one embodiment of the present application;
FIG. 5 is a flowchart illustrating steps of generating a target script in another embodiment of the present application;
FIG. 6 is a schematic block diagram of a script downloading device of a browser in one embodiment of the present application;
FIG. 7 is a block diagram schematically illustrating a computer device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are some, but not all, embodiments of the present application. 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 application.
The flow diagrams depicted in the figures are merely illustrative and do not necessarily include all of the elements and operations/steps, nor do they necessarily have to be performed in the order depicted. For example, some operations/steps may be decomposed, combined or partially combined, so that the actual execution sequence may be changed according to the actual situation.
It is to be understood that the terminology used in the description of the present application herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of the present application and the appended claims, the singular forms "a," "an," and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise.
It should also be understood that the term "and/or" as used in this specification and the appended claims refers to and includes any and all possible combinations of one or more of the associated listed items.
Some embodiments of the present application will be described in detail below with reference to the accompanying drawings. The embodiments described below and the features of the embodiments can be combined with each other without conflict.
Referring to fig. 1, fig. 1 is a flowchart illustrating a script downloading method of a browser according to an embodiment of the present application.
Specifically, the script downloading method of the browser comprises the following steps:
step S101, receiving a network connection request sent by a target browser, and establishing network connection with the target browser according to the network connection request.
Before the browser sends a request instruction of script downloading to the server, a communication connection between the browser and the server needs to be established, so that when the server receives a connection request sent by a target browser, the server establishes a communication connection with the target browser through corresponding processing.
When a user browses a webpage by using a browser, the browser has a certain step of acquiring resources required by browsing the webpage from an http server through an http protocol, wherein the resources mainly comprise html text, styles css, scripts JavaScript, picture images and the like. If the browser wants to obtain these resources, the browser must first establish a connection via a network connection and a corresponding http server.
Therefore, after the http server is started, the first work is to establish network connection with the browser client, perform corresponding processing on the http request of the browser, and send corresponding response resources back to the browser according to the content of the request, so that the browser can render a webpage for a user to browse and view.
And step S102, receiving a script downloading request sent by the target browser.
When the browser needs to download the corresponding script required currently from the server, a script downloading request instruction is sent to the corresponding associated server, so that when the server receives a script downloading request of the browser, the server obtains the corresponding script according to the script downloading request to be used by the browser. Therefore, after the network connection between the server and the target browser is established, the script downloading request sent by the target browser is received, and the received script downloading request is responded.
And step S103, acquiring a header field contained in the script downloading request.
The header field is information contained in the request link, and the header field is generally optionally placed in a request header of an http protocol message, and is used for marking some information of a system where a browser client is located and the browser itself to determine whether to support response to the current request.
After the server establishes a network connection with the target browser, various requests sent by the target browser can be received, and further responses and feedbacks to the received various requests can be performed.
Specifically, when the target browser needs to download the script, the corresponding request is sent to the server, and when the server receives the script downloading request sent by the target browser, the script downloading request is firstly identified and acquired to obtain a header field included in the script downloading request, so as to determine whether the corresponding script can be downloaded and sent to the target browser according to the header field.
In practical application, when a server receives a script downloading request of a target browser, because actual access requests are http requests, information of a header User-Agent field of the received http requests is extracted. The User-Agent is a User Agent, and according to a standard document RFC2616 of an http protocol, the field of the User-Agent is generally placed in a request header of an http protocol message in an optional mode and is used for marking a system where a browser client is located and some information of the browser.
The common format of the user-agent is relatively fixed for 4 mainstream browsers, and version information of the browsers can be extracted from the common format. Such as: user-agent of chrome browser at a certain stage of google corporation: mozilla/5.0(Windows NT 6.1; Win 64; x64) AppleWebKit/537.36(KHTML, like Gecko) Chrome/78.0.3904.97 Safari/537.36. For another example: user-agent of firefox browser at a certain period of time by mozilla: mozilla/5.0(Windows NT 6.1; Win 64; x 64; rv:70.0) Gecko/20100101 Firefox/70.0.
And step S104, obtaining a corresponding target script according to the head field.
After the server obtains the script downloading request sent by the target browser, the header field contained in the script downloading request is obtained, so that the server can obtain the corresponding target script according to the header field, and further the server sends the obtained target script to the target browser, so that the target browser can respond to the information contained in the target script.
In practical application, a one-to-one correspondence relationship exists between the script and the browser, that is, the script belonging to the browser a cannot be sent to the browser B, and is firstly incompatible with the script and the browser, and secondly, because the script belonging to the browser a cannot be acquired when the browser B requests for downloading of the script, the script belonging to the browser a cannot be sent to the browser B.
For the header field, the recorded information is user-agent, that is, user agent, so when the corresponding target script is obtained according to the header field, that is, it is determined to which user, that is, which browser, the script to be obtained belongs at this time. For different browsers, the corresponding user-agent, for example, the user-agent of the Chrome browser may correspond to Chrome/78.0.3904.97, and the user-agent of the Firefox browser may correspond to Firefox/70.0.
And step S105, sending the target script to the target browser.
And after the target script corresponding to the script downloading request is obtained, sending the obtained target script to a target browser establishing a network link with the server, so that the target script of the target browser responds to script information contained in the target script.
In the above-described method for downloading a browser script, when a target browser needs to acquire and download script information, a request for access and script downloading is sent to a corresponding server, then after the server receives the request information, a network link is first established between the server and the browser, and then relevant information recorded in a header field included in the request is acquired, so as to determine a compiling form corresponding to the script at the time according to the relevant information recorded in the header field, and then obtain a corresponding target script, and finally the obtained target script is sent to the target browser, so that the target browser responds to the script information included in the target script. Backward compatibility of script downloading is achieved, the requirement of downloading script copies of two same languages is avoided, script information stored in a server can be directly used, meanwhile, a browser is not required to actively judge and select which version of script information is downloaded, and convenience of script downloading is improved.
Further, referring to fig. 2, fig. 2 is a flowchart illustrating steps of obtaining a target script in an embodiment of the present application.
Specifically, step S104, obtaining a corresponding target script according to the header field includes:
step S201, obtaining target version information corresponding to the target browser in the header field;
step S202, determining whether the target browser supports a specimen script format or not according to the target version information;
step S203, if the target browser is determined not to support the standard script format, calling a script generating function to generate a target script, wherein the target script is stored in a block chain;
and step S204, if the target browser is determined to support the standard script format, generating a target script according to the header field.
It is emphasized that the target script may also be stored in a node of a blockchain in order to further ensure the privacy and security of the target script.
The standard script format is the script format currently used by the server, and is determined according to the relevant information of the browser configured by the server.
When the browser needs to download corresponding script information on the server, there is no limitation on the browser, that is, not all browsers can obtain the script on the corresponding associated browser. For example, if the version of a browser is too low and the version of the script of the browser stored in the server is too high, the browser cannot run or respond on the browser even if the browser obtains the corresponding script.
However, such a situation is not completely unsolved, and only a script corresponding to the executable response needs to be obtained according to the actual information of the browser. Specifically, after a script download request sent by a target browser is obtained and a header field included in the script download request is obtained, target version information currently corresponding to the target browser is determined according to the header field, whether the target browser supports a standard script format is determined according to the obtained target version information, and finally, a corresponding target script is obtained according to an obtained determination result and is used by the target browser.
If the target browser is determined not to support the standard script format, calling a corresponding script generating function to generate and obtain a target script supported by the target browser; and if the target browser is determined to support the standard script format, generating and obtaining a corresponding target script directly according to the head field.
For a script, the corresponding composition forms include a boot script (bootcode) and a work script (workcode), wherein the boot script is used for guiding a corresponding script loading mode in a browser to load the corresponding work script and execute the loaded work script. Therefore, for browsers in the same type but in different version states, the boot scripts in the scripts meeting the requirements of the browsers are different, because the corresponding working scripts need to be loaded and executed by selecting an appropriate script loading mode according to the actual states of the browsers.
In addition, the script loading methods mentioned herein include, but are not limited to: webassociation format and JavaScript format. Normally, loading scripts and running are performed by loading script codes and instructing the scripts in a JavaScript form, but since the code cannot be loaded in all cases in the JavaScript form, the loading and execution of the scripts need to be realized in the Webassembly form.
Therefore, in practical application, if it is determined that the target browser does not currently support the standard script format, the target browser will be guided by the guide script to load the working script and execute the working script according to the webelementary form when the target script is obtained by the target browser; if it is determined that the target browser currently supports the standard script format, the bootstrap script will guide the target browser to load the job script according to the JavaScript form and execute the job script when the target browser obtains the target script.
That is, after the script download request is sent by the target browser, the target script meeting the use requirement of the target browser is generated and obtained according to the related information contained in the script download request, and then the target script is sent to the target browser for use.
Further, referring to fig. 3, fig. 3 is a flowchart illustrating steps of determining whether a standard script format is supported according to an embodiment of the present application.
Specifically, the step S202 of determining whether the target browser supports a standard script format according to the target version information includes:
step S301, acquiring a preset version configuration list, and inquiring in the version configuration list to determine the lowest version information corresponding to the target browser;
step S302, comparing the target version information with the minimum version information to determine whether the target browser supports a standard script format.
If the target version information is lower than the lowest version information, determining that the target browser does not support a standard script format; and if the target version information is not lower than the lowest version information, determining that the target browser supports a standard script format.
When judging and determining whether the target browser supports the standard script format, firstly, acquiring a preset version configuration list stored in a server, then inquiring in the acquired version configuration list to obtain the lowest version information supported by the target browser, further comparing the obtained target version information currently corresponding to the target browser with the lowest version information, when the target version information is lower than the obtained lowest version information, determining that the target browser does not support the standard script format, otherwise, when the mousse version information is not lower than the obtained lowest version information, determining that the target browser supports the standard script format.
In practical application, the server stores the lowest version information corresponding to each browser in advance, and the specific record storage form includes, but is not limited to, a table and a document, and for convenience of record storage, the record storage form is usually stored as a list or table information, which may be specifically shown in table 1 below.
TABLE 1
Safari Edge Firefox Chrome
11 16 57 52
The table stores several types of common browsers and configuration information corresponding to each browser, and in the recorded table, the recorded configuration information is the lowest version of the currently supported browser, for example, when the version information of the Firefox is determined to be 60 according to the header field of the browser accessing the server, the browser is determined to be able to access the server because the supported lowest version information is 57, and then the corresponding script file is directly downloaded. For another example, when the version of the header field of the browser accessing the server is Edge 15, because the supported minimum version information is 16, it is determined that the browser will not directly obtain the corresponding script file from the server at this time, and corresponding processing is required to obtain the corresponding required script file.
Further, referring to fig. 4, fig. 4 is a flowchart illustrating steps of generating a target script according to an embodiment of the present application.
Specifically, in step S203, if it is determined that the target browser does not support the standard script format, invoking a script generating function to generate a target script, including:
step S401, if it is determined that the target browser does not support the standard script format, obtaining a corresponding first working script according to the header field;
step S402, calling a script generating function to generate a first guide script meeting the standard script format;
and S403, splicing the first guide script and the first working script to obtain a corresponding target script.
The first job script is a job code obtained in a JavaScript code form. The first boot script is used to direct the loading and execution of the first working script, which is also a kind of code.
And when the target browser is determined not to support the standard script format, corresponding processing is carried out, and a target script which can be used by the target browser is generated. Specifically, if it is determined that the target browser does not support the standard script format, a corresponding first working script is obtained according to the obtained header field, then a preset script generating function is called to generate a first guide script meeting the standard script format, and finally the obtained first working script and the obtained first guide script are spliced to obtain the target script.
In practical application, when it is determined that a standard script format is not supported according to an obtained header field, for a browser, in order to implement that a target script can be executed after the target script is obtained, logic of a work script (work code) in the obtained target script is obtained in a form of a common JavaScript programming language, at this time, a boot script (boot code) is required to load and execute a JavaScript code in the work script (work code) by using the JavaScript code, that is, a section of the JavaScript code is loaded and executed with another JavaScript code, and at this time, it is a common practice to implement setting of the boot script by using an eval () function in a JavaScript script engine of the browser, so that the boot script can load and execute a code in the work script in the JavaScript form.
Therefore, when it is determined that the target browser does not support the standard script format, the stored working script obtained based on the JavaScript programming language, that is, the first working script, is obtained, and then the eval () function in the JavaScript script engine is used to generate the first guide script, so that the obtained first guide script can load the obtained first working script, and the target script required by the target browser is obtained according to the first working script and the first guide script. When the target script is executed by the browser, the loading and running of the working script are realized by identifying the boot script.
It should be noted that, in a popular way, a boot script (boot code) is a JavaScript code obtained based on a JavaScript programming language, and according to the current web standard of a browser, the JavaScript code can be executed on browsers that support Webassembly and do not support Webassembly. The main function of the code is to judge whether to start a work script (work code) of webassebmly code or a work script (work code) of JavaScript code according to a preset condition, wherein the preset condition is judged on an http server according to the judgment of a user-agent in a script downloading request of a browser, namely, the preset condition is determined according to a header field.
That is, if the Webassembly code is not supported, the job script following the boot script needs to be provided in JavaScript; on the contrary, if the condition supports the Webassembly code, the job script following the boot script is provided in the form of the Webassembly code.
Further, referring to fig. 5, fig. 5 is a flowchart illustrating steps of generating a target script in another embodiment of the present application.
Specifically, in step S204, if it is determined that the target browser supports the standard script format, generating a target script according to the header field includes:
step S501, if the target browser is determined to support the standard script format, acquiring a second guide script corresponding to the standard script format;
step S502, obtaining a corresponding second working script in a standard script generation mode according to the head field;
and S503, splicing the second guide script and the second working script to obtain a corresponding target script.
Wherein the second job script is a job code supported by the WebAssebmly object. The second job script is different from the first job script in the way of writing but contains the same content, i.e. the browser will have the same effect when loading and executing the first job script and the second job script. The second boot script is used to guide the loading and execution of the second job script, and the second boot script is different from the first boot script in the type of the job script to be loaded and executed.
And when the target browser is determined to support the standard script format, a second guide script corresponding to the standard script format is obtained, then a corresponding second working script is obtained in a standard script generation mode according to the obtained head field, and then the obtained second working script and the second guide script are spliced to obtain the target script.
In practical application, the difference between the working scripts loaded and executed by the boot script mainly lies in the code form supported by the browser, when it is determined that the target script supports the standard script format, a second boot script corresponding to the standard script format is obtained, and meanwhile, the second working script is obtained in a standard script generation mode according to the obtained header field, and the second working script is provided in a webelementary code form, so that when the second boot script is executed, the second boot script can accurately load and execute the second working script.
Further, in some embodiments, the script downloading method of the browser further includes: when receiving a script information updating instruction, receiving input updating information, and reading a browser identifier, version information and a script to be stored, wherein the browser identifier, the version information and the script to be stored are contained in the updating information; deleting the stored script corresponding to the browser identifier, and storing the script to be stored; updating the version configuration list according to the browser identification and the version information; and when the completion of the updating is detected, sending out the prompt information of the completion of the updating.
For the version configuration list recorded and stored in the server, the scenario needs to be updated according to the continuous upgrade of the associated scenario or the continuous upgrade of the browser, therefore, when receiving the scenario information update instruction, that is, the version configuration list or the stored scenario needs to be updated, first receiving the input update information, wherein the update information includes but is not limited to the browser identifier, the version information and the scenario to be stored, when the scenario to be stored exists, determining that there may exist a certain scenario or a certain number of scenarios that need to be deleted and stored in the server, at this time, deleting the corresponding stored scenario according to the browser identifier, simultaneously recording and storing the scenario to be stored, and additionally updating the version configuration list according to the browser identifier and the version information, and finally, when the completion of the updating is detected, sending out corresponding prompt information to inform the user who operates currently.
When the version configuration list is updated, for example, the above table 1 is updated, if the browser identifier and the version information in the update information input at this time are Safari and 13, respectively, the version configuration list obtained after the list update is as shown in the following table 2.
TABLE 2
Safari Edge Firefox Chrome
13 16 57 52
That is, after the update of the version configuration list is completed, the lowest version information corresponding to the Safari browser is changed from the original version information 11 to the current version information 13, and the version configuration list is stored after the update is completed, so that the new version configuration list can be used in the subsequent use process.
Referring to fig. 6, fig. 6 is a schematic block diagram of a script downloading device of a browser according to an embodiment of the present application, which is used for executing the script downloading method of the browser.
As shown in fig. 6, the script downloading device 600 of the browser includes:
the network connection module 601 is configured to receive a network connection request sent by a target browser, and establish a network connection with the target browser according to the connection request;
a request receiving module 602, configured to receive a script downloading request of the target browser;
an information identification module 603, configured to obtain a header field included in the script download request;
a script generating module 604, configured to generate a corresponding target script according to the header field;
a script downloading module 605, configured to send the target script to the target browser.
Further, in an embodiment, the script generating module 604 is further specifically configured to: obtaining target version information corresponding to the target browser in the header field; determining whether the target browser supports a standard script format or not according to the target version information; if the target browser is determined not to support the standard script format, calling a script generating function to generate a target script, wherein the target script is stored in a block chain; and if the target browser is determined to support the standard script format, generating a target script according to the header field.
Further, in an embodiment, the script generating module 604 is further specifically configured to: acquiring a preset version configuration list, and inquiring in the version configuration list to determine the lowest version information corresponding to the target browser; comparing the target version information with the minimum version information to determine whether the target browser supports a standard script format.
Further, in an embodiment, the script generating module 604 is further specifically configured to: if the target version information is lower than the lowest version information, determining that the target browser does not support a standard script format; and if the target version information is not lower than the lowest version information, determining that the target browser supports a standard script format.
Further, in an embodiment, the script generating module 604 is further specifically configured to: if the target browser is determined not to support the standard script format, obtaining a corresponding first working script according to the head field; calling a script generating function to generate a first guide script meeting the standard script format; and splicing the first guide script and the first working script to obtain a corresponding target script.
Further, in an embodiment, the script generating module 604 is further specifically configured to: if the target browser is determined to support the standard script format, acquiring a second guide script corresponding to the standard script format; obtaining a corresponding second working script in a standard script generation mode according to the head field; and splicing the second guide script and the second working script to obtain a corresponding target script.
Further, in an embodiment, the script downloading apparatus 600 of the browser is further specifically configured to: when receiving a script information updating instruction, receiving input updating information, and reading a browser identifier, version information and a script to be stored, wherein the browser identifier, the version information and the script to be stored are contained in the updating information; deleting the stored script corresponding to the browser identifier, and storing the script to be stored; updating the version configuration list according to the browser identification and the version information; and when the completion of the updating is detected, sending out the prompt information of the completion of the updating.
It should be noted that, as will be clear to those skilled in the art, for convenience and brevity of description, the specific working processes of the apparatus and the modules described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
The apparatus described above may be implemented in the form of a computer program which is executable on a computer device as shown in fig. 6.
Referring to fig. 7, fig. 7 is a schematic block diagram of a computer device according to an embodiment of the present application. The computer device may be a server.
Referring to fig. 7, the computer device includes a processor, a memory, and a network interface connected through a system bus, wherein the memory may include a nonvolatile storage medium and an internal memory.
The non-volatile storage medium may store an operating system and a computer program. The computer program includes program instructions that, when executed, cause a processor to perform any of the browser's script downloading methods.
The processor is used for providing calculation and control capability and supporting the operation of the whole computer equipment.
The internal memory provides an environment for running a computer program in the non-volatile storage medium, and the computer program, when executed by the processor, causes the processor to execute any one of the browser script downloading methods.
The network interface is used for network communication, such as sending assigned tasks and the like. Those skilled in the art will appreciate that the architecture shown in fig. 7 is merely a block diagram of some of the structures associated with the disclosed aspects and is not intended to limit the computing devices to which the disclosed aspects apply, as particular computing devices may include more or less components than those shown, or may combine certain components, or have a different arrangement of components.
It should be understood that the Processor may be a Central Processing Unit (CPU), and the Processor may be other general purpose processors, Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components, etc. Wherein a general purpose processor may be a microprocessor or the processor may be any conventional processor or the like.
Wherein, in one embodiment, the processor is configured to execute a computer program stored in the memory to implement the steps of:
receiving a network connection request sent by a target browser, and establishing network connection with the target browser according to the connection request;
receiving a script downloading request sent by the target browser;
acquiring a header field contained in the script downloading request;
generating a corresponding target script according to the head field;
and sending the target script to the target browser.
In one embodiment, the processor is implementing the method and is further configured to implement:
obtaining target version information corresponding to the target browser in the header field;
determining whether the target browser supports a standard script format or not according to the target version information;
if the target browser is determined not to support the standard script format, calling a script generating function to generate a target script, wherein the target script is stored in a block chain;
and if the target browser is determined to support the standard script format, generating a target script according to the header field.
In one embodiment, the processor is implementing the method and is further configured to implement:
acquiring a preset version configuration list, and inquiring in the version configuration list to determine the lowest version information corresponding to the target browser;
comparing the target version information with the minimum version information to determine whether the target browser supports a standard script format.
In one embodiment, the processor is implementing the method and is further configured to implement:
if the target version information is lower than the lowest version information, determining that the target browser does not support a standard script format;
and if the target version information is not lower than the lowest version information, determining that the target browser supports a standard script format.
In one embodiment, the processor is implementing the method and is further configured to implement:
if the target browser is determined not to support the standard script format, obtaining a corresponding first working script according to the head field;
calling a script generating function to generate a first guide script meeting the standard script format;
and splicing the first guide script and the first working script to obtain a corresponding target script.
In one embodiment, the processor is implementing the method and is further configured to implement:
if the target browser is determined to support the standard script format, acquiring a second guide script corresponding to the standard script format;
obtaining a corresponding second working script in a standard script generation mode according to the head field;
and splicing the second guide script and the second working script to obtain a corresponding target script.
In one embodiment, the processor is implementing the method and is further configured to implement:
when receiving a script information updating instruction, receiving input updating information, and reading a browser identifier, version information and a script to be stored, wherein the browser identifier, the version information and the script to be stored are contained in the updating information;
deleting the stored script corresponding to the browser identifier, and storing the script to be stored;
updating the version configuration list according to the browser identification and the version information;
and when the completion of the updating is detected, sending out the prompt information of the completion of the updating.
The embodiment of the application further provides a computer-readable storage medium, wherein a computer program is stored in the computer-readable storage medium, the computer program comprises program instructions, and the processor executes the program instructions to realize the script downloading method of any browser provided by the embodiment of the application.
The computer-readable storage medium may be an internal storage unit of the computer device described in the foregoing embodiment, for example, a hard disk or a memory of the computer device. The computer readable storage medium may also be an external storage device of the computer device, such as a plug-in hard disk, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like provided on the computer device.
The block chain is a novel application mode of computer technologies such as distributed data storage, point-to-point transmission, a consensus mechanism, an encryption algorithm and the like. A block chain (Blockchain), which is essentially a decentralized database, is a series of data blocks associated by using a cryptographic method, and each data block contains information of a batch of network transactions, so as to verify the validity (anti-counterfeiting) of the information and generate a next block. The blockchain may include a blockchain underlying platform, a platform product service layer, an application service layer, and the like.
While the invention has been described with reference to specific embodiments, the scope of the invention is not limited thereto, and those skilled in the art can easily conceive various equivalent modifications or substitutions within the technical scope of the invention. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. A script downloading method for a browser, the method comprising:
receiving a network connection request sent by a target browser, and establishing network connection with the target browser according to the connection request;
receiving a script downloading request sent by the target browser;
acquiring a header field contained in the script downloading request;
generating a corresponding target script according to the head field;
and sending the target script to the target browser.
2. The method of claim 1, wherein generating the corresponding target script according to the header field comprises:
obtaining target version information corresponding to the target browser in the header field;
determining whether the target browser supports a standard script format or not according to the target version information;
if the target browser is determined not to support the standard script format, calling a script generating function to generate a target script, wherein the target script is stored in a block chain;
and if the target browser is determined to support the standard script format, generating a target script according to the header field.
3. The method of claim 2, wherein said determining whether the target browser supports a standard script format based on the target version information comprises:
acquiring a preset version configuration list, and inquiring in the version configuration list to determine the lowest version information corresponding to the target browser;
comparing the target version information with the minimum version information to determine whether the target browser supports a standard script format.
4. The method of claim 3, wherein comparing the target version information with the minimum version information to determine whether the target browser supports a standard script format comprises:
if the target version information is lower than the lowest version information, determining that the target browser does not support a standard script format;
and if the target version information is not lower than the lowest version information, determining that the target browser supports a standard script format.
5. The method of claim 2, wherein if it is determined that the target browser does not support the standard script format, invoking a script generating function to generate a target script comprises:
if the target browser is determined not to support the standard script format, obtaining a corresponding first working script according to the head field;
calling a script generating function to generate a first guide script meeting the standard script format;
and splicing the first guide script and the first working script to obtain a corresponding target script.
6. The method according to claim 2, wherein if it is determined that the target browser supports the standard script format, obtaining a target script according to the header field comprises:
if the target browser is determined to support the standard script format, acquiring a second guide script corresponding to the standard script format;
obtaining a corresponding second working script in a standard script generation mode according to the head field;
and splicing the second guide script and the second working script to obtain a corresponding target script.
7. The method of claim 3, further comprising:
when receiving a script information updating instruction, receiving input updating information, and reading a browser identifier, version information and a script to be stored, wherein the browser identifier, the version information and the script to be stored are contained in the updating information;
deleting the stored script corresponding to the browser identifier, and storing the script to be stored;
updating the version configuration list according to the browser identification and the version information;
and when the completion of the updating is detected, sending out the prompt information of the completion of the updating.
8. A script downloading apparatus for a browser, the apparatus comprising:
the network connection module is used for receiving a network connection request sent by a target browser and establishing network connection with the target browser according to the connection request;
the request receiving module is used for receiving a script downloading request of the target browser;
the information identification module is used for acquiring a head field contained in the script downloading request;
the script generating module is used for generating and obtaining a corresponding target script according to the head field;
and the script downloading module is used for sending the target script to the target browser.
9. A computer device comprising a memory and a processor, the memory having stored therein computer-readable instructions which, when executed by the processor, cause the processor to perform the steps of the script download method for a browser according to any one of claims 1 to 7.
10. A computer-readable storage medium storing a computer program, the computer-readable instructions, when executed by the processors, causing one or more processors to perform the steps of the script download method for a browser according to any one of claims 1 to 7.
CN202010464414.5A 2020-05-27 2020-05-27 Script downloading method, device, equipment and storage medium of browser Pending CN111800461A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202010464414.5A CN111800461A (en) 2020-05-27 2020-05-27 Script downloading method, device, equipment and storage medium of browser

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202010464414.5A CN111800461A (en) 2020-05-27 2020-05-27 Script downloading method, device, equipment and storage medium of browser

Publications (1)

Publication Number Publication Date
CN111800461A true CN111800461A (en) 2020-10-20

Family

ID=72806590

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202010464414.5A Pending CN111800461A (en) 2020-05-27 2020-05-27 Script downloading method, device, equipment and storage medium of browser

Country Status (1)

Country Link
CN (1) CN111800461A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022135410A1 (en) * 2020-12-25 2022-06-30 维沃移动通信有限公司 Method and apparatus for loading source file

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010013043A1 (en) * 1998-03-12 2001-08-09 Richard J. Wagner System and method for determining browser package and version compatibility of a web document
CN101859246A (en) * 2009-04-08 2010-10-13 英业达股份有限公司 System and method for converting corresponding scripts according to different browsers
US20140095583A1 (en) * 2012-09-28 2014-04-03 Disney Enterprises, Inc. Client-side web site selection according to device capabilities
CN106354484A (en) * 2015-07-16 2017-01-25 中兴通讯股份有限公司 Browser compatibility method and browser
US20170046449A1 (en) * 2014-05-27 2017-02-16 Hewlett Packard Enterprise Development Lp Response based on browser engine
CN108388454A (en) * 2018-01-24 2018-08-10 广州市动景计算机科技有限公司 Dynamic provides the method, apparatus and terminal device of compatible JS content for script
CN108595202A (en) * 2018-04-25 2018-09-28 北京知道创宇信息技术有限公司 Http request processing method and processing device
CN108717449A (en) * 2018-05-18 2018-10-30 国家计算机网络与信息安全管理中心 A kind of information processing method and system

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20010013043A1 (en) * 1998-03-12 2001-08-09 Richard J. Wagner System and method for determining browser package and version compatibility of a web document
CN101859246A (en) * 2009-04-08 2010-10-13 英业达股份有限公司 System and method for converting corresponding scripts according to different browsers
US20140095583A1 (en) * 2012-09-28 2014-04-03 Disney Enterprises, Inc. Client-side web site selection according to device capabilities
US20170046449A1 (en) * 2014-05-27 2017-02-16 Hewlett Packard Enterprise Development Lp Response based on browser engine
CN106354484A (en) * 2015-07-16 2017-01-25 中兴通讯股份有限公司 Browser compatibility method and browser
CN108388454A (en) * 2018-01-24 2018-08-10 广州市动景计算机科技有限公司 Dynamic provides the method, apparatus and terminal device of compatible JS content for script
CN108595202A (en) * 2018-04-25 2018-09-28 北京知道创宇信息技术有限公司 Http request processing method and processing device
CN108717449A (en) * 2018-05-18 2018-10-30 国家计算机网络与信息安全管理中心 A kind of information processing method and system

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2022135410A1 (en) * 2020-12-25 2022-06-30 维沃移动通信有限公司 Method and apparatus for loading source file

Similar Documents

Publication Publication Date Title
CN111176983B (en) Code conflict resolution system, method, device, equipment and medium
CN110096424B (en) Test processing method and device, electronic equipment and storage medium
US10789111B2 (en) Message oriented middleware with integrated rules engine
CN108920691B (en) Front-end static resource management method and device, computer equipment and storage medium
CN113448862B (en) Software version testing method and device and computer equipment
CN110941779A (en) Page loading method and device, storage medium and electronic equipment
CN108923997A (en) A kind of cloud service node automatic test approach and device based on python
US20190149571A1 (en) Method and device for repairing page vulnerability
CN109032612B (en) Interface calling method and device of hybrid application and computer readable storage medium
CN111984520A (en) Buried point testing method, computer device and computer-readable storage medium
CN106293790B (en) application program upgrading method and device based on Firefox operating system
CN111800461A (en) Script downloading method, device, equipment and storage medium of browser
CN110727575A (en) Information processing method, system, device and storage medium
CN113778393A (en) Component generation method, device, computer system and computer-readable storage medium
CN110806891B (en) Method and device for generating software version of embedded device
CN109101429B (en) Method and device for debugging browser page of set top box
CN111367725A (en) Asynchronous task online monitoring method, front-end control system and service response platform
CN113535206B (en) Multi-version code upgrading method and system
CN111736930B (en) Program front-back end interface calling method and device, computer equipment and storage medium
CN110327626B (en) Virtual server creation method and device
CN113741913A (en) Picture configuration method, device and system and storage medium
CN115185513A (en) Interface updating method and device, storage medium and computer equipment
CN113722538B (en) Interface dynamic rendering method and device
US20220035613A1 (en) Information processing apparatus, method of activating an application and storage medium
CN108664259B (en) Method and terminal for installing application

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