CN114422166A - A web page access method, device, electronic device, medium and product - Google Patents
A web page access method, device, electronic device, medium and product Download PDFInfo
- 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
Links
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/10—Network architectures or network communication protocols for network security for controlling access to devices or network resources
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F16/00—Information retrieval; Database structures therefor; File system structures therefor
- G06F16/90—Details of database functions independent of the retrieved data types
- G06F16/95—Retrieval from the web
- G06F16/957—Browsing optimisation, e.g. caching or content distillation
- G06F16/9574—Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L63/00—Network architectures or network communication protocols for network security
- H04L63/08—Network architectures or network communication protocols for network security for authentication of entities
- H04L63/0807—Network architectures or network communication protocols for network security for authentication of entities using tickets, e.g. Kerberos
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L67/00—Network arrangements or protocols for supporting network services or applications
- H04L67/01—Protocols
- H04L67/02—Protocols 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)
- Computing Systems (AREA)
- Computer Security & Cryptography (AREA)
- Computer Hardware Design (AREA)
- Databases & Information Systems (AREA)
- Theoretical Computer Science (AREA)
- Data Mining & Analysis (AREA)
- Physics & Mathematics (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及请求交互技术领域,尤其涉及一种网页访问方法、装置、电子设备、介质及产品。The present invention relates to the technical field of request interaction, and in particular, to a web page access method, apparatus, electronic device, medium and product.
背景技术Background technique
随着网络安全技术的快速发展,人们对网页开发技术的要求也越来越高。With the rapid development of network security technology, people's requirements for web development technology are getting higher and higher.
目前,在网页开发技术中经典的业务场景就是网页与电脑本地客户端之间的数据传输,主要功能是用于网页与客户端的用户会话共享、网页通过客户端获取电脑相关数据等。At present, the classic business scenario in web page development technology is the data transmission between web pages and the local client of the computer.
现有技术中,随着应用场景的改变,不同的浏览器供应商需要提供不同的技术规范,有时候即便是同一供应商提供的同一浏览器,由于版本不同,也会导致技术规范不同。这种对应不同的应用场景需要适配不同的技术规范的情况,导致开发成本较高,用户体验较差。In the prior art, as application scenarios change, different browser suppliers need to provide different technical specifications, and sometimes even the same browser provided by the same supplier may have different technical specifications due to different versions. This kind of situation that corresponds to different application scenarios needs to be adapted to different technical specifications, resulting in high development costs and poor user experience.
发明内容SUMMARY OF THE INVENTION
本发明提供一种网页访问方法、装置、电子设备、介质及产品,用以解决现有技术中技术规范不具有适配性,导致开发成本较高、用户体验较差的技术问题,以实现降低开发成本、提高用户体验的目的。The present invention provides a web page access method, device, electronic device, medium and product, which are used to solve the technical problems that the technical specifications in the prior art do not have adaptability, resulting in high development costs and poor user experience, so as to reduce the The purpose of development cost and improving user experience.
第一方面,本发明提供一种网页访问方法,应用于浏览器中,方法包括:In a first aspect, the present invention provides a web page access method, which is applied in a browser, and the method includes:
基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据;Based on the script tag preset in the webpage to be accessed, initiate a resource access request to the target client; wherein, the script tag includes the address information of the target client and the request data to be transmitted;
放行所述资源访问请求;release the resource access request;
接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。Receiving resource information returned by the target client based on the resource access request, and implementing resource loading of the webpage to be accessed according to the resource information.
进一步,根据本发明提供的网页访问方法,所述Script标签还包括待访问网页中的回调函数的名称,所述资源信息包括所述待访问网页中的回调函数的参数;Further, according to the webpage access method provided by the present invention, the Script tag further includes the name of the callback function in the webpage to be accessed, and the resource information includes the parameters of the callback function in the webpage to be accessed;
相应的,所述根据所述资源信息实现所述待访问网页的资源加载,包括:Correspondingly, implementing the resource loading of the webpage to be accessed according to the resource information includes:
调用所述待访问网页中的回调函数,并将所述资源信息中的所述参数输入所述回调函数,得到数据处理结果;Calling the callback function in the webpage to be accessed, and inputting the parameters in the resource information into the callback function to obtain a data processing result;
根据所述数据处理结果实现所述待访问网页的资源加载。The resource loading of the to-be-visited web page is implemented according to the data processing result.
进一步,根据本发明提供的网页访问方法,所述资源信息为包括所述待访问网页中的回调函数的参数的JavaScript脚本;Further, according to the webpage access method provided by the present invention, the resource information is a JavaScript script including parameters of the callback function in the webpage to be accessed;
相应的,所述调用所述待访问网页中的回调函数,并将所述资源信息中的参数输入所述回调函数,得到数据处理结果,包括:Correspondingly, calling the callback function in the webpage to be accessed, and inputting the parameters in the resource information into the callback function, to obtain a data processing result, including:
运行所述JavaScript脚本,以调用所述待访问网页中的回调函数,并将所述JavaScript脚本中的参数输入所述回调函数,得到数据处理结果。The JavaScript script is run to call the callback function in the webpage to be accessed, and the parameters in the JavaScript script are input into the callback function to obtain a data processing result.
进一步,根据本发明提供的网页访问方法,所述待访问网页中的回调函数的参数为经过编码的参数。Further, according to the web page access method provided by the present invention, the parameters of the callback function in the web page to be accessed are encoded parameters.
进一步,根据本发明提供的网页访问方法,所述目标客户端的地址信息为基于HTTPS协议的地址信息。Further, according to the webpage access method provided by the present invention, the address information of the target client is address information based on the HTTPS protocol.
进一步,根据本发明提供的网页访问方法,在所述基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求之前,方法还包括:Further, according to the web page access method provided by the present invention, before the resource access request is initiated to the target client based on the Script tag preset in the web page to be accessed, the method further includes:
确定目标客户端,生成所述目标客户端的地址信息;Determine the target client, and generate the address information of the target client;
确定待传输的请求数据,并对所述待传输的请求数据进行编码;Determine the request data to be transmitted, and encode the request data to be transmitted;
根据Script标签的格式定义、所述目标客户端的地址信息以及编码后的待传输的请求数据生成所述Script标签;Generate 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;
将所述Script标签设置在所述待访问网页中。The Script tag is set in the to-be-visited web page.
第二方面,本发明还提供一种网页访问装置,应用于浏览器中,装置包括:In a second aspect, the present invention also provides a web page access device, which is applied to a browser, and the device includes:
发起模块,用于基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据;an initiating module for initiating a resource access request to a target client based on a script tag preset in the webpage to be accessed; wherein, the script tag includes the address information of the target client and the request data to be transmitted;
放行模块,用于放行所述资源访问请求;A release module, used to release the resource access request;
加载模块,用于接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。A loading module, configured to receive resource information returned by the target client based on the resource access request, and implement 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, comprising:
处理器、存储器和总线,其中,processor, memory and bus, where,
所述处理器和所述存储器通过所述总线完成相互间的通信;The processor and the memory communicate with each other through the bus;
所述存储器存储有可被所述处理器执行的程序指令,所述处理器调用所述程序指令能够执行如上任一项中所述网页访问方法的步骤。The memory stores program instructions executable by the processor, and the processor invokes the program instructions to execute the steps of the web page access method described in any of the above.
第四方面,本发明还提供一种非暂态计算机可读存储介质,所述非暂态计算机可读存储介质存储计算机指令,所述计算机指令使计算机执行如上所述网页访问方法的步骤。In a fourth aspect, the present invention further provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, the computer instructions cause the computer to execute the steps of the web page access method as described above.
第五方面,本发明还提供一种计算机程序产品,包括计算机程序,所述计算机程序被处理器执行时实现如上任一项所述网页访问方法的步骤。In a fifth aspect, the present invention further provides a computer program product, including a computer program, which implements the steps of any one of the web page access methods described above when the computer program is executed by a processor.
本发明提供一种网页访问方法、装置、电子设备、介质及产品,应用于浏览器中,所述方法包括:基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据;放行所述资源访问请求;接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。本发明提供的网页访问方法能够适用于不同的浏览器中,降低供应商的开发成本,提高了用户体验。The present invention provides a web page access method, device, electronic device, medium and product, which are applied to browsers. The method includes: based on a script tag preset in the web page to be accessed, initiating a resource access request to a target client; Wherein, the Script tag includes the address information of the target client and the request data to be transmitted; release the resource access request; receive the resource information returned by the target client based on the resource access request, according to the The resource information implements resource loading of the webpage to be accessed. The web page access method provided by the present invention can be applied to different browsers, thereby reducing the development cost of suppliers and improving user experience.
附图说明Description of drawings
为了更清楚地说明本发明或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to explain the present invention or the technical solutions in the prior art more clearly, the following will briefly introduce the accompanying drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description are the For some embodiments of the invention, for those of ordinary skill in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1是现有技术中的网页访问处理的流程示意图之一;1 is one of the schematic flow charts of web page access processing in the prior art;
图2是现有技术中的网页访问方法的流程示意图之二;Fig. 2 is the second schematic flow chart of the webpage access method in the prior art;
图3是本发明提供的一种网页访问方法的流程示意图;3 is a schematic flowchart of a web page access method provided by the present invention;
图4是本发明提供的一种网页访问方法的整体流程示意图;4 is a schematic diagram of the overall flow of a web page access method provided by the present invention;
图5是本发明提供的一种网页访问装置的结构示意图;5 is a schematic structural diagram of a web page access device provided by the present invention;
图6是本发明提供的电子设备的结构示意图。FIG. 6 is a schematic structural diagram of an electronic device provided by the present invention.
具体实施方式Detailed ways
为使本发明的目的、技术方案和优点更加清楚,下面将结合本发明中的附图,对本发明中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the objectives, technical solutions and advantages of the present invention clearer, the technical solutions in the present invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are part of the embodiments of the present invention. , not all examples. Based on the embodiments of the present invention, all other embodiments obtained by those of ordinary skill in the art without creative efforts shall fall within the protection scope of the present invention.
现有技术中,常规的网页开发技术AJAX技术(Asynchronous JavaScript andXML,异步的JavaScript与XML技术)在不同类型浏览器的应用中具有一定的局限性,为了应对网页开发技术AJAX带来的局限性,网页的开发者需要进行大量额外的工作来保证服务的可用性。如在图1所示的IE浏览器的应用场景中,当发现网页请求的地址与当前网页不是同源地址时,该IE浏览器直接拒绝请求,不能实现网页与客户端之间的交互。在图2所示的Chrome浏览器场景下,当要实现跨域请求时,需要设定客户端能够支持跨域请求的配置,否则将不能接收到网页发出的跨域请求。这种情况下,可行的方案是升级现有的客户端程序,使客户端支持跨域请求的访问,但依然不能解决图1中所示的IE浏览器场景下的问题,因此,网页开发者可能不得不在用户使用IE浏览器访问时告诉用户“为了您的访问体验,请使用Chrome浏览器访问网站”,这就容易导致用户的体验较差。In the prior art, the conventional web page development technology AJAX technology (Asynchronous JavaScript and XML, asynchronous JavaScript and XML technology) has certain limitations in the application of different types of browsers. In order to cope with the limitations brought by the web page development technology AJAX, The developer of the web page needs to do a lot of extra work to ensure the availability of the service. As in the application scenario of the IE browser shown in FIG. 1 , when it is found that the address requested by the web page is not the same source address as the current web page, the IE browser directly rejects the request and cannot realize the interaction between the web page and the client. In the Chrome browser scenario shown in Figure 2, when a cross-domain request is to be implemented, a configuration that the client can support cross-domain request needs to be set, otherwise the cross-domain request sent by the webpage will not be received. In this case, the feasible solution is to upgrade the existing client program to enable the client to support cross-domain request access, but it still cannot solve the problem in the IE browser scenario shown in Figure 1. Therefore, web developers It may be necessary to tell the user "For your visit experience, please use the Chrome browser to visit the website" when the user uses the IE browser to access, which may easily lead to a poor user experience.
而且,现有技术中对不同的浏览器需要适配不同的技术规范,使得供应商的开发成本较高。Moreover, in the prior art, different browsers need to be adapted to different technical specifications, so that the development cost of the supplier is relatively high.
图3为本发明提供的网页访问方法的流程示意图,如图3所示,本发明提供的网页访问方法,应用于浏览器上,包括以下步骤:FIG. 3 is a schematic flowchart of a webpage access method provided by the present invention. As shown in FIG. 3 , the webpage access method provided by the present invention, applied to a browser, includes the following steps:
步骤301:基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据。Step 301: Based on a script tag preset in the webpage to be accessed, initiate a resource access request to a target client; wherein the script tag includes address information of the target client and request data to be transmitted.
在本实施例中,需要通过预先设置在待访问网页中的Script标签,向目标客户端发起资源访问的请求。其中,Script标签用于定义客户端脚本,比如JavaScript,Script标签中即可以包含脚本语句,也可以通过src属性指向外部脚本文件。如本实施例中,在Script标签的src属性中填写目标客户端提供的请求地址,Script标签中不仅包含目标客户端的地址信息,还包括待传输的请求数据。其中,Script标签的定义格式如下所示:In this embodiment, it is necessary to initiate a resource access request to the target client through the Script tag preset in the webpage to be accessed. The Script tag is used to define a client-side script, such as JavaScript. The Script tag can contain script statements or point to an external script file through the 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 the address information of the target client, but also the request data to be transmitted. Among them, the definition format of the Script tag is as follows:
<script type=“text/javascript”<script type="text/javascript"
src=“https://127.0.0.1:8888/index?src="https://127.0.0.1:8888/index?
callback=callback&body=encrypteddata”>callback=callback&body=encrypteddata”>
</script></script>
其中,上述定义格式中src=https://127.0.0.1:8888/index?表示目标客户端的请求地址信息,callback=callback&body=encrypteddata表示待传输的请求数据。Among them, in the above definition format, src=https://127.0.0.1:8888/index? Represents the request address information of the target client, and callback=callback&body=encrypteddata represents the 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 network disk software, communication software, and the like. The terminal may be an electronic device of common application, such as a mobile phone, a computer, and the like. The target client is not specifically limited here.
需要说明的是,JavaScript(通常缩写为JS)是一种高级的、解释型的编程语言,是一门基于原型、头等函数的语言,是一门多范式的语言,支持面向对象程序设计、指令式编程以及函数式编程,提供不同的语法来操控文本、数组、日期以及正则表达式,虽然不支持I/O,但可以由它的宿主环境提供支持。目前,已经由ECMA(欧洲电脑制造商协会)通过ECMAScript实现语言的标准化,被世界上的绝大多数网站所使用,也被世界主流浏览器(Chrome、IE、Firefox、Safari、Opera)支持。It should be noted that JavaScript (usually abbreviated as JS) is a high-level, interpreted programming language, a language based on prototypes and first-class functions, and a multi-paradigm language that supports object-oriented programming, instructions programming and functional programming, provide different syntaxes for manipulating text, arrays, dates, and regular expressions, and although it does not support I/O, it can be supported by its host environment. At present, ECMA (European Computer Manufacturers Association) has implemented the standardization of the language through ECMAScript, which is used by the vast majority of websites in the world, and is also supported by the world's mainstream browsers (Chrome, IE, Firefox, Safari, Opera).
步骤302:放行所述资源访问请求。Step 302: Release the resource access request.
在本实施例中,在浏览器确定资源访问请求(HTTPS请求)是Script标签发起的资源请求时,即使资源请求中的地址信息与待访问网页的网址信息不相同,浏览器也会对该资源请求进行放行。需要说明的是,本实施例提供的方法适用于任意类型的浏览器,如IE浏览器、Chrome浏览器等。In this embodiment, when the browser determines that the resource access request (HTTPS request) is a resource request initiated by a Script tag, even if the address information in the resource request is different from the URL information of the webpage to be accessed, the browser will Request for release. It should be noted that the method provided in this embodiment is applicable to any type of browser, such as an IE browser, a Chrome browser, and the like.
举例说明,如待访问网页的网址信息为https://www.b.com/index,目标浏览器发现一条资源访问请求,确定该资源访问请求是Script标签发起的,而且,资源访问请求中包含的请求目标客户端的地址信息为https:127.0.0.1:aaaa/index,该地址信息与待访问网页的网址信息虽然不同,但是由于该资源访问请求是Script标签发起的,因此浏览器会放行该资源访问请求。For example, if the URL information of the webpage 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 the Script tag, and the resource access request contains The address information of the request target client is https:127.0.0.1:aaaa/index. Although this address information is different from the URL information of the webpage to be accessed, since the resource access request is initiated by the Script tag, the browser will release the resource access request.
又如,用户使用某个浏览器要访问待访问网页(例如https://www,baidu.com),待访问网页中有一部分功能需要请求目标客户端提供地址(例如:https://127.0.0.1:8888/client/api,通过发起资源访问请求来获取PC中是否安装百度网盘客户端),待访问网页中Script标签发起的资源访问请求需要经过浏览器的安全判断,确认是否允许发起该请求。如果允许,浏览器会放行该资源请求,待访问网页就可以获取到PC中都已经安装了百度网盘客户端。For another example, if a user uses a browser to access the webpage to be accessed (for example, https://www,baidu.com), some functions of the webpage to be accessed need to request the target client to provide an address (for example: https://127.0. 0.1:8888/client/api, by initiating a resource access request to obtain whether the Baidu network disk client is installed in the PC), the resource access request initiated by the Script tag in the webpage to be accessed needs to be judged by the browser to confirm whether it is allowed to initiate the request. ask. If it is allowed, the browser will release the resource request, and the webpage to be accessed can be obtained. The Baidu network disk client has been installed in the PC.
步骤303:接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。Step 303: Receive resource information returned by the target client based on the resource access request, and implement resource loading of the webpage to be accessed according to the resource information.
在本实施例中,在接收到目标客户端基于资源访问请求返回来的资源信息,然后根据该资源信息实现待访问网页的资源加载。In this 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 implemented according to the resource information.
本实施例中预先定义一个函数名称为callbackfunction的回调函数,在接收到目标客户端返回来的资源信息时直接调用该回调函数,用于处理目标客户端返回的相应数据。前述回调函数对目标客户端所返回数据的处理结果将被加载到待访问网页中,从而实现待访问网页的资源加载。In this embodiment, a callback function whose function name is callbackfunction is pre-defined, and the callback function is directly called when the resource information returned by the target client is received to process the corresponding data returned by the target client. The processing result of the data returned by the target client by the aforementioned callback function will be loaded into the webpage to be accessed, thereby realizing the resource loading of the webpage to be accessed.
需要说明的是,回调函数是指根据JavaScript语言规范定义的一段可以被调用执行的函数,用于处理目标客户端返回的数据。It should be noted that the callback function refers to a function defined according to the JavaScript language specification that can be called and executed, and is used to process the data returned by the target client.
根据本发明实施例提供的网页访问方法,应用于浏览器中,基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求,其中,Script标签中包括目标客户端的地址信息以及待传输的请求数据,放行资源访问请求;接收目标客户端基于资源访问请求所返回的资源信息,根据资源信息实现待访问网页的资源加载。本发明提供的网页访问方法能够适用于不同类型的浏览器中,降低供应商的开发成本,提升了用户体验。The web page access method provided according to the embodiment of the present invention is applied to a browser, and based on a script tag preset in a web page to be accessed, a resource access request is initiated to a target client, wherein the script tag includes address information of the target client and The request data to be transmitted is released, and the resource access request is released; the resource information returned by the target client based on the resource access request is received, and the resource loading of the to-be-accessed webpage is realized according to the resource information. The web page access method provided by the present invention can be applied to different types of browsers, thereby reducing the development cost of suppliers and improving user experience.
在本发明的另一个实施例中,所述Script标签还包括待访问网页中的回调函数的名称,所述资源信息包括所述待访问网页中的回调函数的参数;In another embodiment of the present invention, the Script tag further includes the name of the callback function in the webpage to be accessed, and the resource information includes parameters of the callback function in the webpage to be accessed;
相应的,所述根据所述资源信息实现所述待访问网页的资源加载,包括:Correspondingly, implementing the resource loading of the webpage to be accessed according to the resource information includes:
调用所述待访问网页中的回调函数,并将所述资源信息中的所述参数输入所述回调函数,得到数据处理结果;Calling the callback function in the webpage to be accessed, and inputting the parameters in the resource information into the callback function to obtain a data processing result;
根据所述数据处理结果实现所述待访问网页的资源加载。The resource loading of the to-be-visited web page is implemented according to the data processing result.
在本实施例中,需要根据接收到的资源信息调用待访问网页中的回调函数,并将从目标客户端返回来的资源信息中的参数输入到该回调函数中,得到数据处理结果,然后根据该数据处理结果实现待访问网页的资源加载,得到该待访问网页相关资源数据的加载。如需要加载图片数据、文字数据等。In this embodiment, the callback function in the webpage to be accessed needs to be called according to the received resource information, and the parameters in the resource information returned from the target client are input into the callback function to obtain the data processing result, and then according to The data processing result realizes the resource loading of the webpage to be accessed, and obtains the loading of resource data related to the webpage to be accessed. If you need to load image data, text data, etc.
需要说明的是,在Script标签中还包括待访问网页中的回调函数的名称,资源信息包括待访问网页中的回调函数的参数,通过将资源信息中包含的回调函数的参数输入与其名称对应的回调函数中,得到数据处理结果。其中,回调函数的格式如下所示:It should be noted that the Script tag also includes the name of the callback function in the webpage to be accessed, and the resource information includes the parameters of the callback function in the webpage to be accessed. In the callback function, the data processing result is obtained. The format of the callback function is as follows:
function callback(datastring){处理客户端返回的数据}。function callback(datastring){Process the data returned by the client}.
需要说明的是,调用的回调函数待访问网页可以预先定义该回调函数,如预先定义上述格式的回调函数,预定义的回调函数可以确保目标客户端返回的数据能被正确的接收,并进行待访问网页的业务逻辑的处理。具体的定义方式采用现有技术中的方式,在此不作具体限定。It should be noted that the callback function to be called can be pre-defined for the webpage to be accessed. For example, the callback function in the above format can be pre-defined. The pre-defined callback function can ensure that the data returned by the target client can be correctly received and processed. The processing of business logic for accessing web pages. The specific definition method adopts the method in the prior art, which is not specifically limited here.
根据本发明实施例提供的网页访问方法,通过将目标客户端返回资源信息中的参数输入待访问网页中的回调函数中,得到数据处理结果,并根据数据处理结果实现待访问网页的资源加载处理。能够提高访问网页的资源加载的准确性,提高数据处理的效率。According to the webpage access method provided by the embodiment of the present invention, the data processing result is obtained by inputting the parameters in the resource information returned by the target client into the callback function of the webpage to be visited, and the resource loading processing of the webpage to be visited is realized according to the data processing result. . It can improve the accuracy of resource loading for visiting web pages and improve the efficiency of data processing.
在本发明的另一个实施例中,所述资源信息为包括所述待访问网页中的回调函数的参数的JavaScript脚本;In another embodiment of the present invention, the resource information is a JavaScript script including parameters of the callback function in the webpage to be accessed;
相应的,所述调用所述待访问网页中的回调函数,并将所述资源信息中的参数输入所述回调函数,得到数据处理结果,包括:Correspondingly, calling the callback function in the webpage to be accessed, and inputting the parameters in the resource information into the callback function, to obtain a data processing result, including:
运行所述JavaScript脚本,以调用所述待访问网页中的回调函数,并将所述JavaScript脚本中的参数输入所述回调函数,得到数据处理结果。The JavaScript script is run to call the callback function in the webpage to be accessed, and the parameters in the JavaScript script are input into the callback function to obtain a data processing result.
在本实施例中,目标客户端返回的资源信息为包含待访问网页中的回调函数的参数的JavaScript脚本,浏览器在发现接收到目标客户端返回的资源信息为JavaScript脚本时,会直接运行该JavaScript脚本,从而调用待访问网页中的回调函数,并将对应的参数输入到该回调函数中,得到数据处理结果。In this embodiment, the resource information returned by the target client is a JavaScript script including the parameters of the callback function in the webpage to be accessed. When the browser finds that the resource information returned by the target client is a JavaScript script, it will directly run the JavaScript script. The JavaScript script calls the callback function in the webpage to be accessed, and inputs the corresponding parameters into the callback function to obtain the data processing result.
需要说明的是,目标客户端在收到浏览器发起的资源访问请求后,对该资源访问请求进行处理,在处理完成后得到一个JavaScript格式的数据作为资源信息返回给浏览器,其中,该资源信息为包含待访问网页中的回调函数的参数的JavaScript脚本。It should be noted that, after receiving the resource access request initiated by the browser, the target client processes the resource access request, and after the processing is completed, a JavaScript format data is returned to the browser as resource information, wherein the resource The information is a JavaScript script containing parameters of the callback function in the webpage to be accessed.
根据本发明实施例提供的网页访问方法,在资源信息中包括待访问网页中的回调函数的参数的JavaScript脚本时,运行该JavaScript脚本,以调用待访问网页中的回调函数,并将该JavaScript脚本中的参数输入回调函数,得到数据处理结果,能够保证数据处理的速度,保证数据处理的准确性。According to the webpage access method provided by the embodiment of the present invention, when the resource information includes a JavaScript script with parameters of the callback function in the webpage to be accessed, the JavaScript script is run to call the callback function in the webpage to be accessed, and the JavaScript script is Input the parameters in the callback function to obtain the data processing result, which can ensure the speed of data processing and the accuracy of data processing.
在本发明的另一个实施例中,所述待访问网页中的回调函数的参数为经过编码的参数。In another embodiment of the present invention, the parameters of the callback function in the webpage to be accessed are encoded parameters.
在本实施例中,待访问网页中的回调函数的参数为经过编码处理之后的参数,本实施例中编码所有需要传输的请求数据,需要说明的是,将所有的请求数据进行编码处理,目的是为了让请求的数据易于管理和扩展,具体的编码方式可以采用现有技术中较成熟的编码方式,不作具体限定。In this embodiment, the parameters of the callback function in the webpage to be accessed are the parameters after encoding processing. In this embodiment, all the request data to be transmitted are encoded. It should be noted that all the request data are encoded and processed for the purpose of The purpose is to make the requested data easy to manage and expand, and the specific encoding method may adopt a relatively mature encoding method in the prior art, which is not specifically limited.
根据本发明提供的网页访问方法,通过对待访问网页中的回调函数的参数进行编码处理,方便对请求数据的管理与扩展处理,提升用户的体验。According to the web page access method provided by the present invention, by encoding the parameters of the callback function in the web page to be accessed, the management and expansion processing of the request data are facilitated, and the user experience is improved.
在本发明的另一个实施例中,所述目标客户端的地址信息为基于HTTPS协议的地址信息。In another embodiment of the present invention, the address information of the target client is address information based on the HTTPS protocol.
在本实施例中,目标客户端的地址信息为基于HTTPS协议传输的地址信息。需要说明的是,HTTPS超文本传输安全协议(HyperText Transfer Protocol Secure),常常被称为HTTP over TLS、HTTP over SSL或HTTP Secure,是一种通过计算机网络进行安全通信的传输协议,HTTPS虽然经由HTTP进行通信,却利用SSL/TLS来加密数据包。HTTPS开发的主要目的,是提供对网站服务器的身份认证,保护交换资料的隐私与完整性。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), often referred to as HTTP over TLS, HTTP over SSL or HTTP Secure, is a transmission protocol for secure communication through computer networks. communicate, but use SSL/TLS to encrypt the packets. The main purpose of HTTPS development is to provide identity authentication for website servers and protect the privacy and integrity of exchanged data.
在2010年前浏览器的安全规范中规定当网页的地址信息在使用HTTPS协议传输时,不能获取任何使用HTTP协议的资源,因为使用HTTP协议获取的资源可能会降低使用HTTPS协议网页的安全性。Before 2010, the browser security specification stipulated that when the address information of a web page is transmitted using the HTTPS protocol, no resources using the HTTP protocol can be obtained, because the resources obtained using the HTTP protocol may reduce the security of the web page using the HTTPS protocol.
根据本发明提供的网页访问方法,采用HTTPS协议设定目标客户端的地址信息,能够确保不因为降低当前网页的访问安全等级被浏览器拦截,保证访问网页与目标客户端之间传输的地址信息的准确性,保护交换资料的隐私和完整性,确保在任何类型的浏览器浏览任何网页时都能被浏览器正确执行。According to the web page access method provided by the present invention, the HTTPS protocol is used to set the address information of the target client, which can ensure that the access security level of the current web page is not intercepted by the browser, and the address information transmitted between the access web page and the target client can be ensured. Accuracy, protects the privacy and integrity of the exchanged data, and ensures that it is executed correctly by the browser when viewing any web page in any type of browser.
在本发明的另一个实施例中,在所述基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求之前,方法还包括:In another embodiment of the present invention, before the resource access request is initiated to the target client based on the script tag preset in the webpage to be accessed, the method further includes:
确定目标客户端,生成所述目标客户端的地址信息;Determine the target client, and generate the address information of the target client;
确定待传输的请求数据,并对所述待传输的请求数据进行编码;Determine the request data to be transmitted, and encode the request data to be transmitted;
根据Script标签的格式定义、所述目标客户端的地址信息以及编码后的待传输的请求数据生成所述Script标签;Generate 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;
将所述Script标签设置在所述待访问网页中。The Script tag is set in the to-be-visited web page.
在本实施例中,需要确定目标客户端,根据确定的目标客户端生成相应的地址信息,还需要确定出待传输的请求数据,对待传输的请求数据进行编码处理,然后根据Script标签的格式定义、目标客户端的地址信息以及编码处理后的待传输的请求数据生成Script标签,将得到的Script标签设置在待访问网页中,用于后续与目标客户端之间的交互。In this embodiment, the target client needs to be determined, the corresponding address information is generated according to the determined target client, the request data to be transmitted also needs to be determined, the request data to be transmitted is encoded, and then defined according to the format of the Script tag , the address information of the target client and the encoded request data to be transmitted to generate a Script tag, and the obtained Script tag is set in the webpage to be accessed for subsequent interaction with the target client.
需要说明的是,本实施例中采用HTML中的Script标签,超文本标记语言(HyperText Markup Language,简称HTML),是一种用于创建网页的标准标记语言。HTML是一种基础技术,常与CSS、JavaScript一起被众多网站用于设计网页、网页应用程序以及移动应用程序的用户界面。HTML描述了一个网站的结构语义,成为一种标记语言而非编程语言,网页浏览器可以读取HTML文件,并将其渲染成可视化网页。It should be noted that, in this embodiment, a Script tag in HTML is used, and HyperText Markup Language (HyperText Markup Language, HTML for short) is a standard markup language for creating web pages. HTML is an underlying 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 website and becomes a markup language rather than a programming language. Web browsers can read HTML files and render them into visual web pages.
根据本发明提供的网页访问方法,通过在向目标客户端发起资源访问请求之前,根据Script标签的格式定义、目标客户端的地址信息以及编码后的待传输的请求数据生成Script标签,并将生成的Script标签设置在待访问网页中,用于后续向目标客户端发起资源访问请求,提高网页与客户端之间的交互性能,提升了用户体验。According to the webpage access method provided by the present invention, before initiating a resource access request to a target client, a Script tag is generated 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 generated Script tag is generated. The Script tag is set in the webpage to be accessed, and is used to subsequently initiate a resource access request to the target client, so as to improve the interaction performance between the webpage and the client, and improve the user experience.
在本发明的另一个实施例中,如图4所示,待访问网页和目标客户端之间的请求交互采用HTML中Script标签的方式,利用Script标签加载资源且进行通信。在Script标签的src属性填写目标客户端提供的请求地址,请求地址使用HTTPS协议,请求传输两个参数,分别为待访问网页中的回调函数的名称和经过编码处理后的所有需要传输的请求数据。目标客户端在收到资源访问请求后,对其进行处理完成后返回数据格式为JavaScript脚本数据,其中,将该JavaScript脚本中需要返回的数据编码处理后作为回调函数的参数传入。In another embodiment of the present invention, as shown in FIG. 4 , the request interaction between the webpage to be accessed and the target client adopts the way of Script tag in HTML, and the script tag is used to load resources and communicate. Fill in the request address provided by the target client in the src attribute of the Script tag. The request address uses the HTTPS protocol. The request transmits two parameters, which are the name of the callback function in the webpage to be accessed and all the encoded request data to be transmitted. . After receiving the resource access request, the target client returns the data format as JavaScript script data after processing it, wherein the data to be returned in the JavaScript script is encoded and processed and passed in as a parameter of the callback function.
具体的实现为:假如用户在浏览器上打开的待访问网页的网址为:https://www.a.com/index,并且在该待访问网页中引入一个Script标签,用于请求目标客户端提供的接口。浏览器在发现资源访问请求是Script标签发起的,即便资源访问请求的地址信息与待访问网页的网址信息不是同源地址,也会对该资源访问请求放行,目标客户端对接收到的资源访问请求进行处理,并将处理完成后的数据以JavaScript脚本的格式返回给浏览器,浏览器发现返回的数据是一个JavaScript脚本,则会直接运行该脚本,并且调用定义好的回调函数,将返回的数据作为该回调函数的参数输入回调函数中,得到处理之后的数据,根据处理之后的数据进行待访问网页的资源加载,得到待访问网页对应的用户界面。其中,资源访问请求中包含的请求目标客户端的地址信息为https:127.0.0.1:aaaa/index,且回调函数的格式为function callback(datastring){处理客户端返回的数据}。The specific implementation is: if the URL of the webpage to be visited opened by the user on the browser is: https://www.a.com/index, and a Script tag is introduced into the webpage to be visited to request the target client provided interface. When the browser finds that the resource access request is initiated by the Script tag, even if the address information of the resource access request and the URL information of the webpage to be accessed are not the same source address, the resource access request will be released, and the target client will access the received resource. The request is processed, and the processed data is returned to the browser in the form of a JavaScript script. When the browser finds that the returned data is a JavaScript script, it will run the script directly, and call the defined callback function, which will return the The data is input into the callback function as a parameter of the callback function, the processed data is obtained, the resources of the webpage to be accessed are loaded according to the processed data, and the user interface corresponding to the to-be-visited webpage is obtained. Among them, 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(datastring){processing the data returned by the client}.
在本实施例中,提供的网页访问方法可以应用于多样化的用户场景中,如用户A在windows10操作系统中使用chrome浏览器进行网页的访问,用户B在windows xp操作系统中使用IE浏览器进行网页的访问,用户C在mac os操作系统中使用Safari浏览器进行访问。通过本发明提供的网页访问方法,可以实现不同操作系统中不同浏览器对网页和目标客户端请求交互的安全规范一致,做到一次开发多处使用,极大了降低了供应商在不同应用场景下的开发适配成本。In this embodiment, the provided web page access method can be applied to diverse user scenarios, for example, user A uses the chrome browser in the windows10 operating system to access the web page, and user B uses the IE browser in the windows xp operating system To access the web page, user C uses the Safari browser to access in the mac os operating system. Through the web page access method provided by the present invention, it is possible to achieve the same security specifications for the interaction between different browsers in different operating systems for the web page and the target client to request interaction, so that one development can be used in multiple places, which greatly reduces the need for suppliers in different application scenarios. development adaptation cost.
图5为本发明实施例提供的一种网页访问装置,如图5所示,本发明实施例提供的网页访问装置,应用于浏览器中,包括:FIG. 5 is a web page access device provided by an embodiment of the present invention. As shown in FIG. 5 , the web page access device provided by the embodiment of the present invention, applied to a browser, includes:
发起模块501,用于基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据;Initiating
放行模块502,用于放行所述资源访问请求;A
加载模块503,用于接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。The
根据本发明提供的网页访问装置,应用于浏览器中,基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,Script标签中包括目标客户端的地址信息以及待传输的请求数据;放行资源访问请求;接收目标客户端基于资源访问请求所返回的资源信息,根据资源信息实现待访问网页的资源加载。本发明提供的网页访问装置能够适用于不同类型的浏览器中,降低供应商的开发成本,提高了用户体验。The web page access device provided by the present invention is applied to a browser, and based on a script tag preset in the web page to be accessed, initiates a resource access request to a target client; wherein, the script tag includes address information of the target client and information to be transmitted. The request data; release the resource access request; receive the resource information returned by the target client based on the resource access request, and realize the resource loading of the webpage to be accessed according to the resource information. The webpage access device provided by the present invention can be applied to different types of browsers, thereby reducing the development cost of suppliers and improving user experience.
进一步,所述Script标签还包括待访问网页中的回调函数的名称,所述资源信息包括所述待访问网页中的回调函数的参数;Further, the Script tag also includes the name of the callback function in the webpage to be accessed, and the resource information includes the parameters of the callback function in the webpage to be accessed;
相应的,加载模块503还用于:Correspondingly, the
调用所述待访问网页中的回调函数,并将所述资源信息中的所述参数输入所述回调函数,得到数据处理结果;Calling the callback function in the webpage to be accessed, and inputting the parameters in the resource information into the callback function to obtain a data processing result;
根据所述数据处理结果实现所述待访问网页的资源加载。Resource loading of the webpage to be accessed is implemented according to the data processing result.
根据本发明实施例提供的网页访问装置,通过将目标客户端返回资源信息中的参数输入待访问网页中的回调函数中,得到数据处理结果,并根据数据处理结果实现待访问网页的资源加载处理。能够提高访问网页的资源加载的准确性,提高数据处理的效率。According to the webpage access device provided by the embodiment of the present invention, the data processing result is obtained by inputting the parameters in the resource information returned by the target client into the callback function of the webpage to be visited, and the resource loading processing of the webpage to be visited is realized according to the data processing result. . It can improve the accuracy of resource loading for visiting web pages and improve the efficiency of data processing.
进一步,所述资源信息为包括所述待访问网页中的回调函数的参数的JavaScript脚本;Further, the resource information is a JavaScript script including parameters of the callback function in the webpage to be accessed;
相应的,加载模块503还用于:Correspondingly, the
运行所述JavaScript脚本,以调用所述待访问网页中的回调函数,并将所述回调函数的参数输入所述回调函数,得到数据处理结果。The JavaScript script is run to call the callback function in the webpage to be accessed, and the parameters of the callback function are input into the callback function to obtain a data processing result.
根据本发明实施例提供的网页访问装置,在资源信息中包括待访问网页中的回调函数的参数的JavaScript脚本时,运行该JavaScript脚本,以调用待访问网页中的回调函数,并将该JavaScript脚本中的参数输入回调函数,得到数据处理结果,能够保证数据处理的速度,保证数据处理的准确性。According to the webpage access device provided by the embodiment of the present invention, when the resource information includes the JavaScript script of the parameters of the callback function in the webpage to be accessed, the JavaScript script is run to call the callback function in the webpage to be accessed, and the JavaScript script is The parameters in the input callback function to obtain the data processing results, which can ensure the speed of data processing and the accuracy of data processing.
进一步,根据本发明提供的网页访问装置,所述待访问网页中的回调函数的参数为经过编码的参数。Further, according to the webpage access device provided by the present invention, the parameter of the callback function in the webpage to be accessed is an encoded parameter.
根据本发明提供的网页访问装置,通过对待访问网页中的回调函数的参数进行编码处理,方便对请求数据的管理与扩展处理,提升用户的体验。According to the webpage access device provided by the present invention, by encoding the parameters of the callback function in the webpage to be accessed, the management and expansion processing of the request data is facilitated, and the user experience is improved.
进一步,根据本发明提供的网页访问装置,所述目标客户端的地址信息为基于HTTPS协议的地址信息。Further, according to the webpage access device provided by the present invention, the address information of the target client is address information based on the HTTPS protocol.
根据本发明提供的网页访问装置,采用HTTPS协议设定目标客户端的地址信息,能够保证访问网页与目标客户端之间传输的地址信息的准确性,保护交换资料的隐私和完整性,确保在任何类型的浏览器浏览任何网页时都能被浏览器正确执行。According to the webpage access device provided by the present invention, the HTTPS protocol is used to set the address information of the target client, which can ensure the accuracy of the address information transmitted between the visiting webpage and the target client, protect the privacy and integrity of the exchanged data, and ensure that any The type of browser that can be executed correctly by the browser when viewing any web page.
进一步,在所述基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求之前,装置还包括:Further, before the resource access request is initiated to the target client based on the Script tag preset in the webpage to be accessed, the device further includes:
第一生成单元,用于确定目标客户端,生成所述目标客户端的地址信息;a first generating unit, configured to determine a target client and generate address information of the target client;
编码单元,用于确定待传输的请求数据,并对所述待传输的请求数据进行编码;an encoding unit, configured to determine the request data to be transmitted, and encode the request data to be transmitted;
第二生成单元,用于根据Script标签的格式定义、所述目标客户端的地址信息以及编码后的待传输的请求数据生成所述Script标签;The second generating unit is used to generate the Script label according to the format definition of the Script label, the address information of the target client and the encoded request data to be transmitted;
设置单元,用于将所述Script标签设置在所述待访问网页中。A setting unit, configured to set the Script tag in the to-be-visited webpage.
根据本发明提供的网页访问装置,通过在向目标客户端发起资源访问请求之前,根据Script标签的格式定义、目标客户端的地址信息以及编码后的待传输的请求数据生成Script标签,并将生成的Script标签设置在待访问网页中,用于后续向目标客户端发起资源访问请求,提高网页与客户端之间的交互性能,提升了用户体验。According to the webpage access device provided by the present invention, before initiating a resource access request to a target client, a Script tag is generated 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 generated Script tag is generated. The Script tag is set in the webpage to be accessed, and is used to subsequently initiate a resource access request to the target client, so as to improve the interaction performance between the webpage and the client, and improve the user experience.
由于本发明实施例所述装置与上述实施例所述方法的原理相同,对于更加详细的解释内容在此不再赘述。Since the principle of the apparatus described in the embodiment of the present invention is the same as that of the method described in the foregoing embodiment, more detailed explanations are not repeated here.
图6为本发明实施例中提供的电子设备实体结构示意图,如图6所示,本发明提供一种电子设备,包括:处理器(processor)601、存储器(memory)602和总线603;FIG. 6 is a schematic diagram of the physical structure of an electronic device provided in an embodiment of the present invention. As shown in FIG. 6 , the present invention provides an electronic device, including: a processor (processor) 601, a memory (memory) 602, and a
其中,处理器601、存储器602通过总线603完成相互间的通信;The
处理器601用于调用存储器602中的程序指令,以执行上述各方法实施例中所提供的方法,例如包括:基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据;放行所述资源访问请求,接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。The
本发明实施例中提供一种非暂态计算机可读存储介质,非暂态计算机可读存储介质存储计算机指令,计算机指令使所述计算机执行上述各方法实施例中所提供的方法,例如包括:基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据;放行所述资源访问请求,接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。An embodiment of the present invention provides a non-transitory computer-readable storage medium, where the non-transitory computer-readable storage medium stores computer instructions, and the computer instructions cause the computer to execute the methods provided in the foregoing method embodiments, for example, including: Based on the script tag preset in the webpage to be accessed, initiate a resource access request to the target client; wherein, the script tag includes the address information of the target client and the request data to be transmitted; release the resource access request, Receiving resource information returned by the target client based on the resource access request, and implementing resource loading of the webpage to be accessed according to the resource information.
本发明还提供一种计算机程序产品,所述计算机程序产品包括存储在非暂态计算机可读存储介质上的计算机程序,所述计算机程序包括程序指令,当所述程序指令被计算机执行时,计算机能够执行上述各实施例所提供的方法,该方法包括:基于在待访问网页中预先设置的Script标签,向目标客户端发起资源访问请求;其中,所述Script标签中包括所述目标客户端的地址信息以及待传输的请求数据;放行所述资源访问请求,接收所述目标客户端基于所述资源访问请求所返回的资源信息,根据所述资源信息实现所述待访问网页的资源加载。The present invention also provides a computer program product, the computer program product comprising a computer program stored on a non-transitory computer-readable storage medium, the computer program comprising program instructions, when the program instructions are executed by a computer, the computer program The methods provided by the above embodiments can be executed, and the method includes: initiating a resource access request to a target client based on a script tag preset in the webpage to be accessed; wherein, the script tag includes the address of the target client information and the request data to be transmitted; release the resource access request, receive the resource information returned by the target client based on the resource access request, and implement the resource loading of the to-be-visited webpage according to the resource information.
本领域普通技术人员可以理解:实现上述方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成,前述的程序可以存储于一计算机可读取存储介质中,该程序在执行时,执行包括上述方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by program instructions related to hardware, the aforementioned program may be stored in a computer-readable storage medium, and when the program is executed, execute It includes the steps of the above method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other media that can store program codes.
最后应说明的是:以上实施例仅用以说明本发明的技术方案,而非对其限制;尽管参照前述实施例对本发明进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例中所记载的技术方案进行修改,或者对其中部分技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明各实施例技术方案的精神和范围。Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, but not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art should understand that it can still be Modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements to some of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the spirit and scope of the technical solutions of the embodiments of the present invention .
Claims (10)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111455180.9A CN114422166B (en) | 2021-12-01 | 2021-12-01 | A web page access method, device, electronic device, medium and product |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202111455180.9A CN114422166B (en) | 2021-12-01 | 2021-12-01 | A web page access method, device, electronic device, 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 | A web page access method, device, electronic device, medium and product |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN114422166B (en) |
Citations (8)
| 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 | (주)지란지교소프트 | How to Implement Internet Application 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 |
-
2021
- 2021-12-01 CN CN202111455180.9A patent/CN114422166B/en active Active
Patent Citations (8)
| 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 | (주)지란지교소프트 | How to Implement Internet Application 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 |
|---|---|---|
| US11368447B2 (en) | Oauth2 SAML token service | |
| US10120847B2 (en) | Methods for transforming requests for web content and devices thereof | |
| CN110120917A (en) | Method for routing and device based on content | |
| WO2019015272A1 (en) | Information processing method and device | |
| CN115428403B (en) | Logically implementing client-side policies on client-side | |
| WO2014116563A1 (en) | Resource calling for hybrid applications | |
| US20110231482A1 (en) | Automated Optimization Based On Determination Of Website Usage Scenario | |
| CN110704200B (en) | Method and device for converting calling interface | |
| CN102447726A (en) | Page access method and system | |
| CN108416021B (en) | Browser webpage content processing method and device, electronic equipment and readable medium | |
| CN107315646A (en) | Data flow control method and device between page assembly | |
| US20130036197A1 (en) | Method and system for a mobile local server | |
| CN110059278A (en) | Web page configuration method, server and computer readable storage medium | |
| CN108694215A (en) | Method, apparatus, electronic equipment and the computer-readable medium of web cache preheating | |
| WO2015164146A1 (en) | Proxy for modifying http messages to comply with browser | |
| US9942267B1 (en) | Endpoint segregation to prevent scripting attacks | |
| CN104932910A (en) | Method and system for application program interface extension | |
| JP5039946B2 (en) | Technology for relaying communication between client devices and server devices | |
| CN105871976A (en) | Data cross-domain request method and system, and devices | |
| CN112015383B (en) | A login method and device | |
| CN108334322B (en) | A data request method and system of MVC framework | |
| WO2019119974A1 (en) | Object uploading method and device | |
| AU2018390863B2 (en) | Computer system and method for extracting dynamic content from websites | |
| CN116561013B (en) | Test methods, devices, electronic equipment and media based on the target service framework | |
| CN108376090A (en) | Method, device, terminal and storage medium for operating web page pictures |
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 | ||
| 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. |
|
| GR01 | Patent grant | ||
| GR01 | Patent grant |