CN114422166A - Webpage access method, device, electronic equipment, medium and product - Google Patents

Webpage access method, device, electronic equipment, medium and product Download PDF

Info

Publication number
CN114422166A
CN114422166A CN202111455180.9A CN202111455180A CN114422166A CN 114422166 A CN114422166 A CN 114422166A CN 202111455180 A CN202111455180 A CN 202111455180A CN 114422166 A CN114422166 A CN 114422166A
Authority
CN
China
Prior art keywords
resource
webpage
accessed
target client
web page
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.)
Granted
Application number
CN202111455180.9A
Other languages
Chinese (zh)
Other versions
CN114422166B (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.)
Qax Technology Group Inc
Secworld Information Technology Beijing Co Ltd
Original Assignee
Qax Technology Group Inc
Secworld Information Technology Beijing 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 Qax Technology Group Inc, Secworld Information Technology Beijing Co Ltd filed Critical Qax Technology Group Inc
Priority to CN202111455180.9A priority Critical patent/CN114422166B/en
Publication of CN114422166A publication Critical patent/CN114422166A/en
Application granted granted Critical
Publication of CN114422166B publication Critical patent/CN114422166B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/10Network architectures or network communication protocols for network security for controlling access to devices or network resources
    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L63/00Network architectures or network communication protocols for network security
    • H04L63/08Network architectures or network communication protocols for network security for authentication of entities
    • H04L63/0807Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
    • 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]

Landscapes

  • Engineering & Computer Science (AREA)
  • General Engineering & Computer Science (AREA)
  • Signal Processing (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Computer Hardware Design (AREA)
  • Theoretical Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • General Physics & Mathematics (AREA)
  • Physics & Mathematics (AREA)
  • Data Mining & Analysis (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The invention provides a webpage access method, a webpage access device, electronic equipment, a webpage access medium and a webpage access product, which are applied to a browser, wherein the method comprises the following steps: initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted; passing the resource access request; and receiving resource information returned by the target client based on the resource access request, and realizing resource loading of the webpage to be accessed according to the resource information. The webpage access method provided by the invention can be suitable for different types of browsers, reduces the development cost of suppliers, and improves the user experience.

Description

Webpage access method, device, electronic equipment, medium and product
Technical Field
The present invention relates to the field of request interaction technologies, and in particular, to a method, an apparatus, an electronic device, a medium, and a product for accessing a web page.
Background
With the rapid development of network security technology, people have higher and higher requirements on webpage development technology.
At present, a classic business scene in a web page development technology is data transmission between a web page and a local client of a computer, and the typical business scene mainly has the functions of sharing user sessions between the web page and the client, acquiring computer related data by the web page through the client and the like.
In the prior art, different browser providers need to provide different technical specifications as application scenarios change, and sometimes even if the same browser provided by the same provider is provided by the same provider, the technical specifications may be different due to different versions. The situation that different technical specifications need to be adapted to corresponding different application scenarios results in higher development cost and poorer user experience.
Disclosure of Invention
The invention provides a webpage access method, a webpage access device, electronic equipment, a webpage access medium and a webpage access product, which are used for solving the technical problems of high development cost and poor user experience caused by the fact that the technical specification does not have adaptability in the prior art, and the purposes of reducing the development cost and improving the user experience are achieved.
In a first aspect, the present invention provides a method for accessing a web page, which is applied to a browser, and includes:
initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted;
passing the resource access request;
and receiving resource information returned by the target client based on the resource access request, and realizing resource loading of the webpage to be accessed according to the resource information.
Further, according to the web page access method provided by the present invention, the Script tag further includes a name of a callback function in a web page to be accessed, and the resource information includes a parameter of the callback function in the web page to be accessed;
correspondingly, the implementing resource loading of the web page to be accessed according to the resource information includes:
calling a callback function in the webpage to be accessed, and inputting the parameter in the resource information into the callback function to obtain a data processing result;
and realizing the resource loading of the webpage to be accessed according to the data processing result.
Further, according to the webpage access method provided by the invention, the resource information is a JavaScript script comprising parameters of a callback function in the webpage to be accessed;
correspondingly, the calling a callback function in the webpage to be accessed and inputting parameters in the resource information into the callback function to obtain a data processing result includes:
and running the JavaScript to call a callback function in the webpage to be accessed, and inputting parameters in the JavaScript to the callback function to obtain a data processing result.
Further, according to the web page access method provided by the invention, the parameter of the callback function in the web page to be accessed is a coded parameter.
Further, according to the web page access method provided by the present invention, the address information of the target client is address information based on an HTTPS protocol.
Further, according to the web page access method provided by the present invention, before initiating a resource access request to a target client based on a Script tag preset in a web page to be accessed, the method further includes:
determining a target client and generating address information of the target client;
determining request data to be transmitted, and encoding the request data to be transmitted;
generating a Script tag according to a format definition of the Script tag, address information of the target client and the encoded request data to be transmitted;
and setting the Script tag in the webpage to be accessed.
In a second aspect, the present invention further provides a web page accessing apparatus, which is applied in a browser, and includes:
the system comprises an initiating module, a resource accessing module and a resource accessing module, wherein the initiating module is used for initiating a resource accessing request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted;
the releasing module is used for releasing the resource access request;
and the loading module is used for receiving the resource information returned by the target client based on the resource access request and realizing the resource loading of the webpage to be accessed according to the resource information.
In a third aspect, the present invention also provides an electronic device, including:
a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the steps of the web page access method as described in any one of the above.
In a fourth aspect, the present invention also provides a non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the steps of the web page access method as described above.
In a fifth aspect, the present invention also provides a computer program product comprising a computer program which, when executed by a processor, performs the steps of the web page access method as described in any one of the above.
The invention provides a webpage access method, a webpage access device, electronic equipment, a webpage access medium and a webpage access product, which are applied to a browser, wherein the method comprises the following steps: initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted; passing the resource access request; and receiving resource information returned by the target client based on the resource access request, and realizing resource loading of the webpage to be accessed according to the resource information. The webpage access method provided by the invention can be suitable for different browsers, reduces the development cost of suppliers, and improves the user experience.
Drawings
In order to more clearly illustrate the technical solutions of the present invention or the prior art, the drawings needed for the description of the embodiments or the prior art will be briefly described below, and it is obvious that the drawings in the following description are some embodiments of the present invention, and those skilled in the art can also obtain other drawings according to the drawings without creative efforts.
FIG. 1 is one of the flow diagrams of a web page access process in the prior art;
FIG. 2 is a second flowchart of a web page accessing method in the prior art;
FIG. 3 is a flowchart illustrating a method for accessing a web page according to the present invention;
FIG. 4 is a schematic overall flowchart of a web page access method provided by the present invention;
FIG. 5 is a schematic structural diagram of a web page access device provided in the present invention;
fig. 6 is a schematic structural diagram of an electronic device provided in the present invention.
Detailed Description
In order to make the objects, technical solutions and advantages of the present invention clearer, the technical solutions of the present invention will be clearly and completely described below with reference to the accompanying drawings, and it is obvious that the described embodiments are some, but not all embodiments of the present invention. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present invention.
In the prior art, a conventional web page development technology AJAX (Asynchronous JavaScript and XML) has certain limitations in applications of different types of browsers, and in order to deal with the limitations brought by the web page development technology AJAX, a web page developer needs to perform a lot of extra work to ensure the availability of services. As in the application scenario of the IE browser shown in fig. 1, when the address of the web page request is found not to be the same source address as the current web page, the IE browser directly rejects the request, and interaction between the web page and the client cannot be achieved. In the Chrome browser scenario shown in fig. 2, when a cross-domain request is to be implemented, it is necessary to set a configuration that a client can support the cross-domain request, otherwise, the cross-domain request sent by a web page cannot be received. In this case, a feasible solution is to upgrade the existing client program to enable the client to support cross-domain access, but still cannot solve the problem in the IE browser scenario shown in fig. 1, so the web page developer may have to tell the user "please access the website for your access experience by using Chrome browser" when the user accesses using the IE browser, which easily results in poor user experience.
Moreover, in the prior art, different technical specifications need to be adapted to different browsers, so that the development cost of a provider is high.
Fig. 3 is a schematic flowchart of a web page access method provided by the present invention, and as shown in fig. 3, the web page access method provided by the present invention is applied to a browser, and includes the following steps:
step 301: initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted.
In this embodiment, a request for resource access needs to be initiated to a target client through a Script tag preset in a to-be-accessed webpage. The Script tag is used for defining a client Script, such as JavaScript, and the Script tag may contain a Script statement and may also point to an external Script file through an src attribute. As in this embodiment, the request address provided by the target client is filled in the src attribute of the Script tag, and the Script tag includes not only address information of the target client but also request data to be transmitted. The definition format of the Script tag is as follows:
<script type=“text/javascript”
src=“https://127.0.0.1:8888/index?
callback=callback&body=encrypteddata”>
</script>
wherein, in the above defined format, src ═ https://127.0.0.1: 8888/index? Request address information indicating a target client, and callback and body indicating request data to be transmitted.
It should be noted that the target client refers to other application programs corresponding to different web pages in the terminal, such as a network disk software, a communication software, and the like. And the terminal can be electronic equipment of common application, such as a mobile phone, a computer and the like. The target client is not specifically limited herein.
It should be noted that JavaScript (usually abbreviated as JS) is a high-level, interpreted programming language, a language based on prototypes and header functions, a multi-modal language, and supports object-oriented programming, instruction-based programming, and functional programming, and provides different syntax to manipulate texts, arrays, dates, and regular expressions, and although not supporting I/O, it can be supported by its host environment. Currently, the standardization of the language implemented by ECMA (european computer manufacturers association) through ECMAScript is used by most web sites in the world and is also supported by world mainstream browsers (Chrome, IE, Firefox, Safari, Opera).
Step 302: and releasing the resource access request.
In this embodiment, when the browser determines that the resource access request (HTTPS request) is a resource request initiated by a Script tag, the browser may pass the resource request even if the address information in the resource request is different from the website information of the web page to be accessed. It should be noted that the method provided by this embodiment is applicable to any type of browser, such as an IE browser, a Chrome browser, and the like.
For example, if the website address information of the web page to be accessed is https:// www.b.com/index, the target browser finds a resource access request, determines that the resource access request is initiated by a Script tag, and the address information of the request target client included in the resource access request is https:127.0.0.1: aaaa/index, which is different from the website address information of the web page to be accessed, but since the resource access request is initiated by the Script tag, the browser will release the resource access request.
For another example, a user uses a certain browser to access a to-be-accessed webpage (e.g., https:// www, baidu.com), a part of functions in the to-be-accessed webpage need to request a target client to provide an address (e.g., https://127.0.0.1:8888/client/api, whether a hundredth-degree-network-disk client is installed in a PC is obtained by initiating a resource access request), and the resource access request initiated by a Script tag in the to-be-accessed webpage needs to be subjected to security judgment of the browser to confirm whether the request is allowed to be initiated. If the resource request is allowed to be released by the browser, the webpage to be accessed can acquire that the hundred-degree network disk client is installed in the PC.
Step 303: and receiving resource information returned by the target client based on the resource access request, and realizing resource loading of the webpage to be accessed according to the resource information.
In the embodiment, after receiving the resource information returned by the target client based on the resource access request, the resource loading of the webpage to be accessed is realized according to the resource information.
In this embodiment, a callback function with a function name of callback function is predefined, and the callback function is directly called when receiving resource information returned by the target client, and is used for processing corresponding data returned by the target client. And the processing result of the callback function on the data returned by the target client is loaded into the webpage to be accessed, so that the resource loading of the webpage to be accessed is realized.
It should be noted that the callback function refers to a function defined according to the JavaScript language specification, which can be called to be executed, and is used for processing data returned by the target client.
The webpage access method provided by the embodiment of the invention is applied to a browser, and a resource access request is sent to a target client based on a Script tag preset in a webpage to be accessed, wherein the Script tag comprises address information of the target client and request data to be transmitted, and the resource access request is released; and receiving resource information returned by the target client based on the resource access request, and realizing resource loading of the webpage to be accessed according to the resource information. The webpage access method provided by the invention can be suitable for different types of browsers, reduces the development cost of suppliers, and improves the user experience.
In another embodiment of the present invention, the Script tag further includes a name of a callback function in the web page to be accessed, and the resource information includes a parameter of the callback function in the web page to be accessed;
correspondingly, the implementing resource loading of the web page to be accessed according to the resource information includes:
calling a callback function in the webpage to be accessed, and inputting the parameter in the resource information into the callback function to obtain a data processing result;
and realizing the resource loading of the webpage to be accessed according to the data processing result.
In this embodiment, a callback function in the to-be-accessed webpage needs to be called according to the received resource information, and a parameter in the resource information returned from the target client is input into the callback function to obtain a data processing result, and then the resource loading of the to-be-accessed webpage is realized according to the data processing result to obtain the loading of the resource data related to the to-be-accessed webpage. If picture data, character data and the like need to be loaded.
It should be noted that the Script tag further includes a name of a callback function in the to-be-accessed webpage, the resource information includes a parameter of the callback function in the to-be-accessed webpage, and the data processing result is obtained by inputting the parameter of the callback function included in the resource information into the callback function corresponding to the name of the parameter. The format of the callback function is as follows:
function callback { processing data returned by client }.
It should be noted that, the callback function to be accessed by the called callback function may be predefined, for example, the callback function with the above format is predefined, and the predefined callback function may ensure that the data returned by the target client can be correctly received, and perform processing on the service logic of the web page to be accessed. The specific definition is the one in the prior art, and is not limited herein.
According to the webpage access method provided by the embodiment of the invention, the parameters in the resource information returned by the target client are input into the callback function in the webpage to be accessed to obtain the data processing result, and the resource loading processing of the webpage to be accessed is realized according to the data processing result. The method and the device can improve the accuracy of resource loading of the accessed webpage and improve the efficiency of data processing.
In another embodiment of the present invention, the resource information is a JavaScript script including a parameter of a callback function in the to-be-accessed webpage;
correspondingly, the calling a callback function in the webpage to be accessed and inputting parameters in the resource information into the callback function to obtain a data processing result includes:
and running the JavaScript to call a callback function in the webpage to be accessed, and inputting parameters in the JavaScript to the callback function to obtain a data processing result.
In this embodiment, the resource information returned by the target client is a JavaScript script including a parameter of a callback function in a webpage to be accessed, and when finding that the received resource information returned by the target client is the JavaScript script, the browser directly runs the JavaScript script, so as to call the callback function in the webpage to be accessed, and input the corresponding parameter into the callback function, thereby obtaining a data processing result.
It should be noted that, after receiving a resource access request initiated by a browser, a target client processes the resource access request, and after the processing is completed, obtains data in a JavaScript format as resource information and returns the resource information to the browser, where the resource information is a JavaScript script including a parameter of a callback function in a web page to be accessed.
According to the webpage access method provided by the embodiment of the invention, when the resource information comprises the JavaScript of the parameters of the callback function in the webpage to be accessed, the JavaScript is operated to call the callback function in the webpage to be accessed, and the parameters in the JavaScript are input into the callback function to obtain the data processing result, so that the data processing speed can be ensured, and the data processing accuracy can be ensured.
In another embodiment of the present invention, the parameter of the callback function in the webpage to be accessed is an encoded parameter.
In this embodiment, the parameters of the callback function in the web page to be accessed are parameters after encoding processing, and in this embodiment, all request data to be transmitted are encoded, it should be noted that all the request data are encoded, so as to make the requested data easy to manage and expand, and a specific encoding manner may be a mature encoding manner in the prior art, which is not particularly limited.
According to the webpage access method provided by the invention, the parameters of the callback function in the webpage to be accessed are coded, so that the request data can be managed and expanded conveniently, and the user experience is improved.
In another embodiment of the present invention, the address information of the target client is address information based on an HTTPS protocol.
In this embodiment, the address information of the target client is address information transmitted based on the HTTPS protocol. It should be noted that HTTPS HyperText Transfer Protocol Secure (HTTP over TLS), which is often called HTTP over SSL or HTTP Secure, is a transport Protocol for Secure communication over a computer network, and HTTPS encrypts a packet using SSL/TLS although communicating via HTTP. The main purpose of HTTPS development is to provide authentication to web servers and protect the privacy and integrity of the exchanged data.
In the security specification of the browser before 2010, it is stated that when address information of a web page is transmitted by using an HTTPS protocol, any resource using the HTTP protocol cannot be acquired, because the resource acquired by using the HTTP protocol may reduce the security of the web page using the HTTPS protocol.
According to the webpage access method provided by the invention, the address information of the target client is set by adopting an HTTPS protocol, so that the condition that the access security level of the current webpage is intercepted by a browser is avoided, the accuracy of the address information transmitted between the accessed webpage and the target client is ensured, the privacy and the integrity of exchanged data are protected, and the condition that the browser can correctly execute any webpage when any type of browser browses any webpage is ensured.
In another embodiment of the present invention, before initiating a resource access request to a target client based on a Script tag preset in a to-be-accessed webpage, the method further includes:
determining a target client and generating address information of the target client;
determining request data to be transmitted, and encoding the request data to be transmitted;
generating a Script tag according to a format definition of the Script tag, address information of the target client and the encoded request data to be transmitted;
and setting the Script tag in the webpage to be accessed.
In this embodiment, a target client needs to be determined, corresponding address information is generated according to the determined target client, request data to be transmitted needs to be determined, encoding processing is performed on the request data to be transmitted, then a Script tag is generated according to a format definition of the Script tag, the address information of the target client and the encoded request data to be transmitted, and the obtained Script tag is arranged in a webpage to be accessed for subsequent interaction with the target client.
It should be noted that, in this embodiment, a Script tag in HTML is adopted, and HyperText Markup Language (HTML for short) is a standard Markup Language for creating a web page. HTML is a basic technology that is often used by many websites, along with CSS and JavaScript, to design user interfaces for web pages, web applications, and mobile applications. HTML describes the structural semantics of a web site, and is a markup language rather than a programming language, and a web browser can read an HTML file and render it into a visual web page.
According to the webpage access method provided by the invention, before the resource access request is initiated to the target client, the Script tag is generated according to the format definition of the Script tag, the address information of the target client and the coded request data to be transmitted, and the generated Script tag is arranged in the webpage to be accessed for subsequently initiating the resource access request to the target client, so that the interaction performance between the webpage and the client is improved, and the user experience is improved.
In another embodiment of the present invention, as shown in fig. 4, the request interaction between the to-be-accessed webpage and the target client uses a Script tag in HTML to load resources and perform communication by using the Script tag. Filling a request address provided by a target client in the src attribute of the Script tag, wherein the request address requests to transmit two parameters, namely the name of a callback function in a webpage to be accessed and all request data to be transmitted after encoding, by using an HTTPS protocol. And after receiving the resource access request, the target client returns the resource access request in a data format of JavaScript data after processing the resource access request, wherein the data needing to be returned in the JavaScript is coded and processed and then is transmitted as the parameter of the callback function.
The specific implementation is as follows: if the web address of the web page to be accessed, which is opened by the user on the browser, is: https:// www.a.com/index, and a Script tag is introduced in the web page to be accessed for requesting the interface provided by the target client. The method comprises the steps that a browser launches a resource access request when finding that the resource access request is initiated by a Script tag, the resource access request can be released even if address information of the resource access request and website information of a webpage to be accessed are not homologous addresses, a target client processes the received resource access request and returns processed data to the browser in a JavaScript format, the browser finds that the returned data is one JavaScript, the Script can be directly operated, a defined callback function is called, the returned data is input into the callback function as a parameter of the callback function to obtain the processed data, resource loading of the webpage to be accessed is carried out according to the processed data, and a user interface corresponding to the webpage to be accessed is obtained. The address information of the request target client included in the resource access request is https:127.0.0.1: aaaa/index, and the format of the callback function is function callback (data processing) { processing data returned by the client }.
In this embodiment, the provided web page access method may be applied to diversified user scenarios, for example, a user a uses a chrome browser to access a web page in a windows10 operating system, a user B uses an IE browser to access a web page in a windows xp operating system, and a user C uses a Safari browser to access a mac os operating system. The webpage access method provided by the invention can realize the consistency of safety specifications of different browsers in different operating systems on the request interaction of the webpage and the target client, realizes one-time development and multiple-place use, and greatly reduces the development adaptation cost of suppliers under different application scenes.
Fig. 5 is a web page access apparatus provided in an embodiment of the present invention, and as shown in fig. 5, the web page access apparatus provided in an embodiment of the present invention is applied to a browser, and includes:
an initiating module 501, configured to initiate a resource access request to a target client based on a Script tag preset in a to-be-accessed webpage; the Script tag comprises address information of the target client and request data to be transmitted;
a releasing module 502, configured to release the resource access request;
a loading module 503, configured to receive resource information returned by the target client based on the resource access request, and implement resource loading of the to-be-accessed webpage according to the resource information.
The webpage access device provided by the invention is applied to a browser, and initiates a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of a target client and request data to be transmitted; releasing the resource access request; and receiving resource information returned by the target client based on the resource access request, and realizing resource loading of the webpage to be accessed according to the resource information. The webpage access device provided by the invention can be suitable for different types of browsers, reduces the development cost of suppliers, and improves the user experience.
Further, the Script tag further includes a name of a callback function in a webpage to be accessed, and the resource information includes a parameter of the callback function in the webpage to be accessed;
accordingly, the loading module 503 is further configured to:
calling a callback function in the webpage to be accessed, and inputting the parameter in the resource information into the callback function to obtain a data processing result;
and realizing the resource loading of the webpage to be accessed according to the data processing result.
According to the webpage access device provided by the embodiment of the invention, the parameters in the resource information returned by the target client are input into the callback function in the webpage to be accessed to obtain the data processing result, and the resource loading processing of the webpage to be accessed is realized according to the data processing result. The method and the device can improve the accuracy of resource loading of the accessed webpage and improve the efficiency of data processing.
Further, the resource information is a JavaScript script comprising parameters of a callback function in the webpage to be accessed;
accordingly, the loading module 503 is further configured to:
and running the JavaScript to call the callback function in the webpage to be accessed, and inputting the parameter of the callback function into the callback function to obtain a data processing result.
According to the webpage access device provided by the embodiment of the invention, when the resource information comprises the JavaScript of the parameters of the callback function in the webpage to be accessed, the JavaScript is operated to call the callback function in the webpage to be accessed, and the parameters in the JavaScript are input into the callback function to obtain the data processing result, so that the data processing speed can be ensured, and the data processing accuracy can be ensured.
Further, according to the web page access device provided by the present invention, the parameter of the callback function in the web page to be accessed is a coded parameter.
According to the webpage access device provided by the invention, the parameters of the callback function in the webpage to be accessed are coded, so that the request data can be managed and expanded conveniently, and the user experience is improved.
Further, according to the web page access apparatus provided by the present invention, the address information of the target client is address information based on an HTTPS protocol.
According to the webpage access device provided by the invention, the address information of the target client is set by adopting an HTTPS protocol, so that the accuracy of the address information transmitted between the accessed webpage and the target client can be ensured, the privacy and the integrity of the exchanged data are protected, and the browser can be ensured to be correctly executed when any webpage is browsed by any type of browser.
Further, before initiating a resource access request to a target client based on a Script tag preset in a to-be-accessed webpage, the apparatus further includes:
the first generation unit is used for determining a target client and generating address information of the target client;
the encoding unit is used for determining the request data to be transmitted and encoding the request data to be transmitted;
the second generating unit is used for generating the Script tag according to the format definition of the Script tag, the address information of the target client and the encoded request data to be transmitted;
and the setting unit is used for setting the Script tag in the webpage to be accessed.
According to the webpage access device provided by the invention, before a resource access request is initiated to a target client, the Script tag is generated according to the format definition of the Script tag, the address information of the target client and the coded request data to be transmitted, and the generated Script tag is arranged in the webpage to be accessed for subsequently initiating the resource access request to the target client, so that the interaction performance between the webpage and the client is improved, and the user experience is improved.
Since the principle of the apparatus according to the embodiment of the present invention is the same as that of the method according to the above embodiment, further details are not described herein for further explanation.
Fig. 6 is a schematic structural diagram of an electronic device provided in an embodiment of the present invention, and as shown in fig. 6, the present invention provides an electronic device, including: a processor (processor)601, a memory (memory)602, and a bus 603;
the processor 601 and the memory 602 complete communication with each other through the bus 603;
the processor 601 is used for calling the program instructions in the memory 602 to execute the methods provided in the above-mentioned embodiments of the methods, for example, including: initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted; and releasing the resource access request, receiving resource information returned by the target client based on the resource access request, and loading the resources of the webpage to be accessed according to the resource information.
Embodiments of the present invention provide a non-transitory computer-readable storage medium storing computer instructions that cause the computer to perform the methods provided in the above-described method embodiments, for example, including: initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted; and releasing the resource access request, receiving resource information returned by the target client based on the resource access request, and loading the resources of the webpage to be accessed according to the resource information.
The present invention also provides a computer program product comprising a computer program stored on a non-transitory computer readable storage medium, the computer program comprising program instructions which, when executed by a computer, enable the computer to perform the method provided by the embodiments described above, the method comprising: initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted; and releasing the resource access request, receiving resource information returned by the target client based on the resource access request, and loading the resources of the webpage to be accessed according to the resource information.
Those of ordinary skill in the art will understand that: all or part of the steps for implementing the method embodiments may be implemented by hardware related to program instructions, and the program may be stored in a computer readable storage medium, and when executed, the program performs the steps including the method embodiments; and the aforementioned storage medium includes: various media that can store program codes, such as ROM, RAM, magnetic or optical disks.
Finally, it should be noted that: the above examples are only intended to illustrate the technical solution of the present invention, but not to limit it; although the present 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 solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; and such modifications or substitutions do not depart from the spirit and scope of the corresponding technical solutions of the embodiments of the present invention.

Claims (10)

1. A webpage access method is applied to a browser and comprises the following steps:
initiating a resource access request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted;
passing the resource access request;
and receiving resource information returned by the target client based on the resource access request, and realizing resource loading of the webpage to be accessed according to the resource information.
2. The web page access method according to claim 1, wherein the Script tag further includes a name of a callback function in the web page to be accessed, and the resource information includes a parameter of the callback function in the web page to be accessed;
correspondingly, the implementing resource loading of the web page to be accessed according to the resource information includes:
calling a callback function in the webpage to be accessed, and inputting the parameter in the resource information into the callback function to obtain a data processing result;
and realizing the resource loading of the webpage to be accessed according to the data processing result.
3. The method according to claim 2, wherein the resource information is a JavaScript script including a parameter of a callback function in the web page to be accessed;
correspondingly, the calling a callback function in the webpage to be accessed and inputting parameters in the resource information into the callback function to obtain a data processing result includes:
and running the JavaScript to call a callback function in the webpage to be accessed, and inputting parameters in the JavaScript to the callback function to obtain a data processing result.
4. The method for accessing web pages according to claim 2, wherein the parameters of the callback function in the web page to be accessed are encoded parameters.
5. The method according to claim 1, wherein the address information of the target client is address information based on HTTPS protocol.
6. The method for accessing the web page according to any one of claims 1 to 5, wherein before initiating the resource access request to the target client based on the Script tag preset in the web page to be accessed, the method further comprises:
determining a target client and generating address information of the target client;
determining request data to be transmitted, and encoding the request data to be transmitted;
generating a Script tag according to a format definition of the Script tag, address information of the target client and the encoded request data to be transmitted;
and setting the Script tag in the webpage to be accessed.
7. A web page access apparatus, applied in a browser, the apparatus comprising:
the system comprises an initiating module, a resource accessing module and a resource accessing module, wherein the initiating module is used for initiating a resource accessing request to a target client based on a Script tag preset in a webpage to be accessed; the Script tag comprises address information of the target client and request data to be transmitted;
the releasing module is used for releasing the resource access request;
and the loading module is used for receiving the resource information returned by the target client based on the resource access request and realizing the resource loading of the webpage to be accessed according to the resource information.
8. An electronic device, comprising:
a processor, a memory, and a bus, wherein,
the processor and the memory are communicated with each other through the bus;
the memory stores program instructions executable by the processor, the processor invoking the program instructions to perform the steps of the web page access method of any of claims 1 to 6.
9. A computer program product comprising computer executable instructions for performing the steps of the web page access method according to any one of claims 1 to 6 when executed.
10. A non-transitory computer readable storage medium storing computer instructions for causing a computer to perform the steps of the web page access method according to any one of claims 1 to 6.
CN202111455180.9A 2021-12-01 2021-12-01 Webpage access method and device, electronic equipment, medium and product Active CN114422166B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111455180.9A CN114422166B (en) 2021-12-01 2021-12-01 Webpage access method and device, electronic equipment, medium and product

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111455180.9A CN114422166B (en) 2021-12-01 2021-12-01 Webpage access method and device, electronic equipment, medium and product

Publications (2)

Publication Number Publication Date
CN114422166A true CN114422166A (en) 2022-04-29
CN114422166B CN114422166B (en) 2024-08-16

Family

ID=81264687

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111455180.9A Active CN114422166B (en) 2021-12-01 2021-12-01 Webpage access method and device, electronic equipment, medium and product

Country Status (1)

Country Link
CN (1) CN114422166B (en)

Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002044919A1 (en) * 2000-12-01 2002-06-06 Armeen Mazda Method of ∫script⊃ based remote javascript function call of web page
KR20090003934A (en) * 2007-07-05 2009-01-12 (주)지란지교소프트 Internet application embodiment method independent of web browser and operating system
US8335982B1 (en) * 2007-12-05 2012-12-18 Appcelerator, Inc. System and method for binding a document object model through JavaScript callbacks
US20150019628A1 (en) * 2013-07-12 2015-01-15 Wensheng Li System and methods for accessing multi-origin content from web browser and application to web application testing
US9122650B1 (en) * 2007-11-14 2015-09-01 Appcelerator, Inc. Web server based on the same paradigms as web clients
CN107291771A (en) * 2016-04-11 2017-10-24 平安科技(深圳)有限公司 The Access Optimization method and webpage rich client system of webpage rich client system
CN109819033A (en) * 2019-01-25 2019-05-28 杭州迪普科技股份有限公司 A kind of resource file loading method and system
WO2021218018A1 (en) * 2020-04-28 2021-11-04 平安科技(深圳)有限公司 Data processing method and apparatus for implementing cross-domain request at webpage end, and related device

Patent Citations (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2002044919A1 (en) * 2000-12-01 2002-06-06 Armeen Mazda Method of ∫script⊃ based remote javascript function call of web page
KR20090003934A (en) * 2007-07-05 2009-01-12 (주)지란지교소프트 Internet application embodiment method independent of web browser and operating system
US9122650B1 (en) * 2007-11-14 2015-09-01 Appcelerator, Inc. Web server based on the same paradigms as web clients
US8335982B1 (en) * 2007-12-05 2012-12-18 Appcelerator, Inc. System and method for binding a document object model through JavaScript callbacks
US20150019628A1 (en) * 2013-07-12 2015-01-15 Wensheng Li System and methods for accessing multi-origin content from web browser and application to web application testing
CN107291771A (en) * 2016-04-11 2017-10-24 平安科技(深圳)有限公司 The Access Optimization method and webpage rich client system of webpage rich client system
CN109819033A (en) * 2019-01-25 2019-05-28 杭州迪普科技股份有限公司 A kind of resource file loading method and system
WO2021218018A1 (en) * 2020-04-28 2021-11-04 平安科技(深圳)有限公司 Data processing method and apparatus for implementing cross-domain request at webpage end, and related device

Also Published As

Publication number Publication date
CN114422166B (en) 2024-08-16

Similar Documents

Publication Publication Date Title
JP6740373B2 (en) Page component dynamic layout
EP2948846B1 (en) Resource calling for hybrid applications
US8935798B1 (en) Automatically enabling private browsing of a web page, and applications thereof
CN109218368B (en) Method, device, electronic equipment and readable medium for realizing Http reverse proxy
CN108416021B (en) Browser webpage content processing method and device, electronic equipment and readable medium
JP2020505681A (en) Data acquisition method and device
US11368447B2 (en) Oauth2 SAML token service
US9426202B2 (en) Transforming application cached template using personalized content
CN113382083B (en) Webpage screenshot method and device
CN113076164B (en) Webpage language management method and device
CN110704200A (en) Method and device for converting call interface
CN113076294A (en) Information sharing method and device
US9942267B1 (en) Endpoint segregation to prevent scripting attacks
CN117041234A (en) Interaction method of web end and original end and terminal equipment
CN104932910A (en) Method and system for application program interface extension
CN110807162A (en) Method and device for loading occupation bitmap
CN112015383A (en) Login method and device
WO2019119974A1 (en) Object uploading method and device
US20070124667A1 (en) Verifying content of resources in markup language documents
AU2018390863B2 (en) Computer system and method for extracting dynamic content from websites
CN116781586A (en) gRPC flow analysis method, device, equipment and medium
CN109698832B (en) Method for rapidly providing Portal authentication and rapidly popping Portal authentication page and related equipment
CN114422166B (en) Webpage access method and device, electronic equipment, medium and product
CN105808727A (en) Website cross-screen adaptation technology architecture and adaptation method based on HTML5 (Hypertext Markup Language 5)
CN111338928A (en) Chrome-based browser testing method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
CB02 Change of applicant information

Country or region after: China

Address after: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant after: QAX Technology Group Inc.

Applicant after: Qianxin Wangshen information technology (Beijing) Co.,Ltd.

Address before: Room 332, 3 / F, Building 102, 28 xinjiekouwei street, Xicheng District, Beijing 100088

Applicant before: QAX Technology Group Inc.

Country or region before: China

Applicant before: LEGENDSEC INFORMATION TECHNOLOGY (BEIJING) Inc.

CB02 Change of applicant information
GR01 Patent grant
GR01 Patent grant