WO2015058716A1 - 一种加载插件的方法、浏览器和服务器 - Google Patents
一种加载插件的方法、浏览器和服务器 Download PDFInfo
- Publication number
- WO2015058716A1 WO2015058716A1 PCT/CN2014/089473 CN2014089473W WO2015058716A1 WO 2015058716 A1 WO2015058716 A1 WO 2015058716A1 CN 2014089473 W CN2014089473 W CN 2014089473W WO 2015058716 A1 WO2015058716 A1 WO 2015058716A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- plug
- file
- parameter information
- url
- function
- 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.)
- Ceased
Links
Images
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F9/00—Arrangements for program control, e.g. control units
- G06F9/06—Arrangements for program control, e.g. control units using stored programs, i.e. using an internal store of processing equipment to receive or retain programs
- G06F9/44—Arrangements for executing specific programs
- G06F9/445—Program loading or initiating
- G06F9/44521—Dynamic linking or loading; Link editing at or after load time, e.g. Java class loading
- G06F9/44526—Plug-ins; Add-ons
-
- 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/953—Querying, e.g. by the use of web search engines
- G06F16/9535—Search customisation based on user profiles and personalisation
Definitions
- the present invention relates to the field of plug-in loading, and more particularly to a method of loading a plug-in, a browser, a server, a computer program, and a computer readable medium.
- ActiveX is an open, integrated platform that provides developers, users and Web producers with a quick and easy way to create program integration and content on the Internet and intranet. With ActiveX, you can easily and easily insert multimedia effects, interactive objects, and complex programs into your web pages to create high-quality multimedia CD-ROMs with comparable user experiences. ActiveX-based ActiveX plugins are also becoming more widely used. ActiveX plug-in technology is an internationally popular Windows-based software technology. Many softwares are developed in this way, such as Flash animation playback plug-ins, Microsoft Media Player plug-ins, Adobe PDF reading plug-ins, and so on.
- the ActiveX plugin is called an OLE plugin or an OCX plugin. It is a software component or object that can be inserted into a web page or other application. For example, when a user browses to a particular web page, the browser prompts the user to download and install the ActiveX plugin.
- the browser side generally has some basic functions of the ActiveX plug-in
- many web pages also have an ActiveX plug-in, which requires the user to download and install the ActiveX plug-in that comes with the webpage to implement a certain function of the webpage.
- the browser has a built-in plug-in Qvod plug-in that can support the playback of some webpage elements, but the webpage stipulates that the Baidu audio-visual plug-in is used to play some webpage resources. Therefore, even if the built-in Qvod plugin of the browser supports the playback of the video files in the webpage, Users can only download and install Baidu audio and video plug-ins for video playback, resulting in waste of resources. And the process of downloading and installing the ActiveX plug-in of the webpage may cause the webpage to block, so that the loading speed of the page embedded with the ActiveX script program is reduced, and even the browser instantaneously loses the response.
- the present invention has been made in order to provide a method and a corresponding browsing method for loading a plug-in that overcomes the above problems or at least partially solves or alleviates the above problems.
- a server, a computer program, and a computer readable medium are provided.
- a method of loading a plug-in comprising:
- a method of loading a plug-in comprising:
- extracting parameter information of the second plug-in object is returned to the browser side, and the browser side is configured according to the second plug-in object.
- the parameter information creates a second plug-in object; establishes an association between the proxy object and the second plug-in object; configures a script for running the second plug-in object by using the proxy object; and uses the second plug-in object to perform according to the script.
- a browser comprising:
- a proxy object creation module configured to: when the browser side intercepts the creation requirement of the first plug-in object in the process of loading the webpage, create a proxy object, and obtain parameter information of the first plug-in object;
- a parameter information sending module of the first plug-in object configured to send parameter information of the first plug-in object to a server side
- a parameter information receiving module of the second plug-in object configured to receive parameter information of the second plug-in object returned by the server side, where the parameter information of the second plug-in object is in accordance with parameter information of the first plug-in object by the server side
- a second plug-in object creating module configured to create a second plug-in object according to the parameter information of the second plug-in object
- An association establishing module configured to establish an association between the proxy object and the second plug-in object
- a script configuration module configured to configure, by using the proxy object, a script that is executed by the second plug-in object
- the first page loading module is adapted to perform loading of the webpage according to the script by using the second plugin object.
- a server comprising:
- the parameter information receiving module of the first plug-in object is adapted to receive parameter information of the first plug-in object sent by the browser side;
- the parameter information returning module of the second plug-in object is adapted to determine, according to the parameter information of the first plug-in object, that the parameter information of the second plug-in object is returned to the browser side when the second plug-in object is replaced.
- the browser side creates a second plug-in object according to the parameter information of the second plug-in object; establishes an association between the proxy object and the second plug-in object; and configures a script for running the second plug-in object by using the proxy object;
- the second plug-in object performs loading of the webpage according to the script, wherein the proxy object is created when the browser side intercepts the creation requirement of the first plug-in object in the process of loading the webpage.
- a computer program comprising computer readable code causing the server to execute the method of loading a plug-in described above when the computer readable code is run on a server.
- a computer readable medium wherein the computer program described above is stored.
- the page process on the browser side when the page process on the browser side is loaded into the ActiveX plugin in the webpage, it can be replaced with the built-in ActiveX plugin of the browser, so that the ActiveX plugin provided by the browser can support the files supported by the current page.
- the takeover and opening of the formatted network element prevents the user from downloading and installing the ActiveX plugin in the webpage, which improves the efficiency of page loading.
- FIG. 1 is a flow chart showing the steps of a method for loading a plug-in according to an embodiment of the present invention
- FIG. 2 is a flow chart showing the steps of a method for loading a plug-in according to an embodiment of the present invention
- FIG. 3 is a block diagram showing the structure of a browser embodiment according to an embodiment of the present invention.
- FIG. 4 is a block diagram showing the structure of a server embodiment according to an embodiment of the present invention.
- Figure 5 schematically shows a block diagram of a server for performing the method according to the invention
- Fig. 6 schematically shows a storage unit for holding or carrying program code implementing the method according to the invention.
- FIG. 1 a flow chart of a first embodiment of a method for loading a plug-in according to an embodiment of the present invention is shown.
- the embodiment may be configured from the browser side, and may specifically include the following steps:
- Step 101 When the browser side intercepts the creation requirement of the first plug-in object in the process of loading the webpage, creating a proxy object, and acquiring parameter information of the first plug-in object;
- the first plug-in object may be an ActiveX plug-in specified in a webpage, such as Baidu video and audio, QVOD (fast broadcast), and the like.
- the browser side intercepts the creation requirement of the first plug-in object in the process of loading the webpage, and specifically, when the hook is hooked to the CoGetClassObject function in the process of loading the webpage on the browser side, the first plug-in object is intercepted. Create a requirement.
- the ActiveX plugin is a COM (Component Object Model, group) Component object model), in the COM library, there are three API (Application Programming Interface) functions for object creation, which are CoGetClassObject, CoCreateInstance and CoCreateInstanceEx respectively. Usually, the client calls one of them.
- object creation, and return the object's initialization interface pointer, COM library and class factory class factory is also an interface or COM object, its responsibility is to create a component object and return a pointer to the client interface, each component must There is a related class factory that also interacts through these three functions.
- the CoGetClassObject declaration can be expressed as follows:
- rclsid is used to uniquely identify the CLSID (128 bits) of an object. Through rclsid, you can know the object you need to create (you need to use it to create the specified object); dwClsContext is the component category, you can use the predefined value in the CLSCTX enumerator. ; pServerInfo is a pointer to the machine where the instantiated class object is located (if the local machine, the parameter is NULL); riid is the reference interface identifier, used to communicate with the object; ppv is stored as the output parameter to return the class factory Interface pointer.
- CoCreateInstance When the client program calls the COM library function CoCreateInstance to get the class factory interface pointer, CoCreateInstance calls the function CoGetClassObject, uses the parameter CLSID to find the registry in the function CoGetClassObject, finds the path of the COM component DLL and loads it, and calls the function implemented in the DLL.
- DllGetClassObject, DllGetClassObject function creates a class factory, and returns the class factory interface pointer to CoGetClassObject in reverse order, and creates an object according to the class factory interface pointer.
- the CoGetClassObject function when the page process on the browser side needs to create an object, the CoGetClassObject function performs a hook (hook is a system mechanism provided in Windows to replace the "interrupt” under DOS, and the Chinese translation is " Hook "or” or "hook”) to prevent the creation of objects.
- hook is a system mechanism provided in Windows to replace the "interrupt” under DOS, and the Chinese translation is " Hook "or” or "hook" to prevent the creation of objects.
- the object needs to be created for hooking to the CoGetClassObject function in the browser side, thereby starting the creation of the proxy object (Prox object), and replacing the object actually created by the CoGetClassObject function with the Prox object.
- the Prox object includes a series of interfaces, including many standard interfaces that the IUnknown pointer will call, such as IOleObject, IViewObject, etc., and then call IClassFactory (class factory)
- IClassFactory class factory
- the parameter information of the first plug-in object can be obtained from the page process of the browser side while the plug-in object is created, so as to know the plug-in that needs to be created.
- the parameter information of the first plug-in object may include an identifier of the first plug-in object and a URL of the first file, where the URL of the first file is according to the first plug-in object.
- the URL generated by the protocol which can include the file name, file size, and file hash value.
- the parameter information can be:
- object is the unified use of COM components in the HTML language; classid is the call statement to the WEB plugin in the HTML language; clsid is the value of the BaiduPlayer plugin type ID; width/height is the width and height of the plugin displayed in the webpage; Id/name/ is the identifier of the BaiduPlayer plugin; the URL is the play file address (that is, the URL of the first file), and the URL value format is bdhd://file size
- Step 102 Send parameter information of the first plug-in object to a server side.
- Step 103 Receive parameter information of the second plug-in object returned by the server, where the parameter information of the second plug-in object is determined by the server side to determine that there is a replaceable second plug-in object according to the parameter information of the first plug-in object.
- the page process on the browser side when the page process on the browser side is loaded into the ActiveX plugin in the webpage, it can be replaced with the ActiveX plugin (the second plugin object) built in the browser side, so that the ActiveX plugin built in the browser side is enabled.
- the ActiveX plugin the second plugin object
- the browser side uploads information such as the identifier of the first plug-in object and the URL of the first file to the server side, and the server side determines whether the plug-in can be performed. Replace the operation.
- various data resource files (including file name, file size, and file hash value) are stored in the data resource library on the server side, and the server side can respectively press each data resource file in the data resource library according to the browser.
- the protocol of the second plug-in object built in the side generates the URL of each data resource file (ie, the URL of the second file), and generates a mapping relationship between each data resource file and the corresponding URL and stores it in the mapping table.
- the server side When the server side receives the identifier of the first plug-in object uploaded by the browser side and the URL of the first file, obtaining a file name, a file size, and a file hash value file in the URL of the first file of the first plug-in object.
- Information in the mapping table, find a file name, a file size, and a file hash value that are the same as the file name, the file size, and the file hash value in the URL of the first file, and if the search succeeds, it is determined that the second file can be performed.
- the replacement of the plug-in object and obtaining the URL of the corresponding second file (for example, the URL of the second file corresponding to the play address of Baidu video and audio can be:
- the server side will correspond
- the URL of the second file and the identifier of the second plugin object (the URL of the second file and the parameter information of the second plugin object composing the second plugin object) are returned to the browser side.
- the server side does not find a file name, a file size, and a file hash value in the URL of the first file in the mapping table, it is determined that the file name, the file size, and the file hash value are not present.
- the second plug-in object is replaceable, and the prompt information returned by the server side is sent to the browser side, and the browser side releases the intercepted CoGetClassObject function according to the prompt information, thereby creating a first plug-in object, and adopting the first plug-in object and the proxy
- the object communicates to implement loading of the web page.
- Step 104 Create a second plug-in object according to parameter information of the second plug-in object.
- the browser side After the browser side receives the parameter information of the second plug-in object returned by the server side, the parameter information of the second plug-in object is replaced with the parameter information of the first plug-in object in the page process, and the browser side After loading the page process, after obtaining the class factory interface pointer in the CoGetClassObject function, the creation function in the class factory is called to create a second plug-in object, wherein the second plug-in object is an object that actually implements the plug-in function.
- Step 105 Establish an association between the proxy object and the second plug-in object.
- a communication window associated with the object may be separately created in the proxy object and the second plug-in object to establish an association between the proxy object and the second plug-in object, so that the proxy object and the second plug-in object
- the communication can be performed through the communication window, and the proxy object invokes the second plug-in object and/or the first through the communication window of the proxy object and the second plug-in object.
- the second plugin object invokes the proxy object to implement the functionality that the plugin implements.
- Step 106 Configure a script for running the second plug-in object by using the proxy object
- the communication between the proxy object and the second plug-in object includes a script execution process between processes, and the script running by the second plug-in object is configured by the proxy object.
- the parameter information of the first plug-in object may further include a first function function
- the script run by the second plug-in object may include a second function function of the second plug-in object.
- Sub-step S21 when the first function is called, the proxy function is used to replace the first function function with a corresponding second function function;
- Sub-step S22 using the proxy object to configure a script for running the second plug-in object according to the second function function and the URL of the second file.
- the proxy object may replace the first function function with a corresponding second function function in the second plug-in object by using a scheduling interface IDispatch interface.
- IDispatch interface when the page process on the browser side loads the webpage, when parsing the script in the first plug-in object, the name of the method to be executed in the script is transferred to the IDispatch interface of the proxy object, and the IDispatch interface is scheduled.
- the interface is used to call a function in a language program that does not support the virtual function table.
- the IDispatch interface has a GetIDsOfNames function and an Invoke function, wherein the GetIDsOfNames function provides a method for returning its dispatch ID by using the name of the method, and the Invoke function provides a method of utilization.
- the instruction of the dispatch ID execution method Since the first plugin object is not actually created, and the second plugin object is the object of the real plugin, the proxy object calls the IDispatch interface of the second plugin object through the communication window, and calls the method provided by the GetIDsOfNames function of the second plugin object, so that The second plug-in object acquires a scheduling ID of the method to be executed, and acquires a corresponding function function (second function function) according to the scheduling ID, and then the second plug-in object returns the scheduling ID and the second function function to the second function function through the communication window a proxy object, the proxy object replacing the second function function with the first function function (for example, the Play function in the first plug-in object, when the Prox object is called, is actually mapped to the corresponding Play function of the second plug-in object, The name may not be play, but the function is completely consistent. Then, the script running by the second plug-in object is configured according to the second function function and the URL of the second file.
- Step 107 Perform loading of the webpage according to the script by using the second plug-in object.
- the script is fed back to the page process, and the page process uses the second plug-in object to execute the Invoke (ID) index. Order, thus executing the method to be executed in the script to complete the loading of the page.
- ID Invoke
- the replacement operation of any ActiveX plug-in in the webpage can be implemented, so that all the data resources in the browser side can find a suitable or unified ActiveX plug-in for loading, without requiring the user.
- Manual installation greatly improves the efficiency of loading data resources on the web page on the browser side.
- FIG. 2 a flow chart of a second embodiment of a method for loading a plug-in according to an embodiment of the present invention is shown.
- the embodiment is described from the server side, and specifically includes the following steps:
- Step 201 Receive parameter information of a first plug-in object sent by a browser side.
- Step 202 When it is determined that the second plug-in object is replaceable according to the parameter information of the first plug-in object, extracting parameter information of the second plug-in object and returning to the browser side;
- the browser side creates a second plug-in object according to the parameter information of the second plug-in object, establishes an association between the proxy object and the second plug-in object, and configures the second plug-in object to run by using the proxy object. And loading, by the second plug-in object, the loading of the webpage according to the script, wherein the proxy object is created when the browser side intercepts the creation requirement of the first plug-in object in the process of loading the webpage.
- the parameter information of the first plug-in object may include an identifier of the first plug-in object and a URL of the first file
- the parameter information of the second plug-in object may include the second plug-in object.
- a URL of the second file where the URL of the first file is a URL generated according to a protocol of the first plug-in object, and may include a file name, a file size, and a file hash value; and the URL of the second file is
- the URL generated by the protocol of the second plug-in object may include a file name, a file size, and a file hash value;
- the step 202 may include the following sub-steps:
- the identifier of the second plugin object and the URL of the second file are returned to the browser side.
- the server side returns a prompt information, and the browser side creates a first plug-in object according to the prompt information, and loads the webpage by using the first plug-in object.
- FIG. 3 a block diagram of a structure of a browser according to an embodiment of the present invention is shown. Specifically, the following modules may be included:
- the proxy object creation module 301 is configured to: when the browser side intercepts the creation requirement of the first plug-in object in the process of loading the webpage, create a proxy object, and acquire parameter information of the first plug-in object;
- the parameter information sending module 302 of the first plug-in object is adapted to send the parameter information of the first plug-in object to the server side;
- the parameter information receiving module 303 of the second plug-in object is adapted to receive the parameter information of the second plug-in object returned by the server, and the parameter information of the second plug-in object is determined by the server side according to the parameter of the first plug-in object. The information is obtained by judging that there is a replaceable second plug-in object;
- the second plug-in object creating module 304 is adapted to create a second plug-in object according to the parameter information of the second plug-in object;
- the association establishing module 305 is adapted to establish an association between the proxy object and the second plug-in object.
- a script configuration module 306, configured to configure a script for running the second plug-in object by using the proxy object
- the first page loading module 307 is adapted to perform loading of the webpage according to the script by using the second plugin object.
- the parameter information of the first plug-in object includes an identifier of the first plug-in object and a URL of the first file, and a parameter letter of the second plug-in object.
- the information includes an identifier of the second plug-in object and a URL of the second file, where the URL of the first file is a URL generated according to a protocol of the first plug-in object, including a file name, a file size, and a file hash value;
- the URL of the file is a URL generated according to the protocol of the second plug-in object, including a file name, a file size, and a file hash value; when there is a replaceable second plug-in object, the file name in the URL of the second file,
- the file size and the file hash value are the same as the file name, file size, and file hash value in the URL of the first file.
- the browser side when there is no replaceable second plug-in object, the browser side may further include:
- the prompt information receiving module is adapted to receive the prompt information returned by the server side, where the prompt information is generated by the server side when determining that there is no replaceable second plug-in object according to the parameter information of the first plug-in object;
- a first plug-in object creation module configured to create a first plug-in object according to the prompt information
- the second page loading module is adapted to perform loading of the webpage by using the first plugin object.
- the parameter information of the first plug-in object further includes a first function
- the script run by the second plug-in object includes a second function of the second plug-in object
- the configuration module is also suitable for:
- the first function function When the first function function is invoked, the first function function is replaced with a corresponding second function function by using the proxy object;
- the proxy object replaces the first function function with a corresponding second function function in the second plug-in object by using a scheduling interface IDispatch interface.
- the script running by the second plug-in object is configured according to the second function and the URL of the second file by using the proxy object.
- FIG. 4 a structural block diagram of a server embodiment according to an embodiment of the present invention is shown, which may specifically include the following modules:
- the parameter information receiving module 401 of the first plug-in object is adapted to receive parameter information of the first plug-in object sent by the browser side;
- the parameter information returning module 402 of the second plug-in object is adapted to: when determining that the second plug-in object is replaceable according to the parameter information of the first plug-in object, extracting parameter information of the second plug-in object and returning to the browser side,
- the browser side creates a second plug-in object according to the parameter information of the second plug-in object; establishes an association between the proxy object and the second plug-in object; and configures a script for running the second plug-in object by using the proxy object;
- the loading of the webpage is performed according to the script by using the second plug-in object, wherein the proxy object is created when the browser side intercepts the creation requirement of the first plug-in object in the process of loading the webpage.
- the parameter information of the first plug-in object includes an identifier of the first plug-in object and a URL of the first file
- the parameter information of the second plug-in object includes an identifier of the second plug-in object.
- a URL of the second file where the URL of the first file is a URL generated according to a protocol of the first plug-in object, including a file name, a file size, and a file hash value; and the URL of the second file is according to the second plug-in
- the URL generated by the object's protocol including the file name, file size, and file hash value
- the parameter information returning module of the second plug-in object is further adapted to:
- the identifier of the second plugin object and the URL of the second file are returned to the browser side.
- the server side may further include:
- the prompt information returning module is adapted to return a prompt information when determining that there is no replaceable second plug-in object according to the parameter information of the first plug-in object, and the first plug-in is created by the browser side according to the prompt information. And loading the webpage with the first plugin object.
- the description is relatively simple, and the relevant parts can be referred to the description of the method embodiment.
- the various component embodiments of the present invention may be implemented in hardware, or in a software module running on one or more processors, or in a combination thereof.
- a microprocessor or digital signal processor may be used in practice to implement some or all of the functionality of some or all of the components of the plug-in device in accordance with embodiments of the present invention.
- the invention can also be implemented as a device or device program (e.g., a computer program and a computer program product) for performing some or all of the methods described herein.
- a program implementing the invention may be stored on a computer readable medium or may be in the form of one or more signals. Such signals may be downloaded from an Internet website, provided on a carrier signal, or provided in any other form.
- Figure 5 illustrates a server, such as an application server, that can implement a load plugin in accordance with the present invention.
- the server conventionally includes a processor 510 and a computer program product or computer readable medium in the form of a memory 520.
- the memory 520 may be an electronic memory such as a flash memory, an EEPROM (Electrically Erasable Programmable Read Only Memory), an EPROM, a hard disk, or a ROM.
- Memory 520 has a memory space 530 for program code 531 for performing any of the method steps described above.
- storage space 530 for program code may include various program code 531 for implementing various steps in the above methods, respectively.
- the program code can be read from or written to one or more computer program products.
- These computer program products include program code carriers such as hard disks, compact disks (CDs), memory cards or floppy disks.
- Such computer program products are typically portable or fixed storage units as described with reference to FIG.
- the storage unit may have a storage section, a storage space, and the like arranged similarly to the storage 520 in the server of FIG.
- the program code can be compressed, for example, in an appropriate form.
- the storage unit includes computer readable code 531', code that can be read by a processor, such as 510, which, when executed by a server, causes the server to perform various steps in the methods described above.
Landscapes
- Engineering & Computer Science (AREA)
- Theoretical Computer Science (AREA)
- Software Systems (AREA)
- Databases & Information Systems (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Data Mining & Analysis (AREA)
- Stored Programmes (AREA)
- Information Transfer Between Computers (AREA)
Abstract
本发明公开了一种加载插件的方法,包括当浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时,创建代理对象,并获取所述第一插件对象的参数信息;将所述第一插件对象的参数信息发送至服务器侧;接收所述服务器侧返回的第二插件对象的参数信息;依据所述第二插件对象的参数信息创建第二插件对象;建立所述代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载。本发明可以避免用户下载和安装网页中的ActiveX插件,提高了页面加载的效率。
Description
本发明涉及插件加载的技术领域,尤其涉及一种加载插件的方法、一种浏览器、一种服务器、一种计算机程序,以及一种计算机可读介质。
ActiveX是一个开放的集成平台,为开发人员、用户和Web生产商提供了一个快速而简便的在Internet和Intranet创建程序集成和内容的方法。使用ActiveX,可轻松方便的在Web页中插入多媒体效果、交互式对象、以及复杂程序,创建用户体验相当的高质量多媒体CD-ROM。基于ActiveX的ActiveX插件也具有越来越广泛的应用。ActiveX插件技术是国际上通用的基于Windows平台的软件技术,许多软件均采用此种方式开发,例如Flash动画播放插件、Microsoft MediaPlayer插件、Adobe PDF阅读插件等。
ActiveX插件叫做OLE插件或OCX插件,它是一些软件组件或对象,可以将其插入到WEB网页或其他应用程序中。例如,当用户浏览到特定的网页时,浏览器会提示用户下载并安装ActiveX插件。
在现有技术中,虽然浏览器侧一般都内置有一些基本功能的ActiveX插件,但很多网页也自带ActiveX插件,其需要用户下载并安装网页自带的ActiveX插件方能实现网页的某种功能。例如,浏览器内置插件Qvod插件,其可以支持一些网页元素的播放,但网页中规定使用百度影音插件来播放一些网页资源,因此,即使浏览器内置的Qvod插件支持该网页中视频文件的播放,用户也只能另外下载和安装百度影音插件进行视频播放,造成资源的浪费。并且网页ActiveX插件下载和安装的过程可能造成网页的阻滞,使得嵌有ActiveX脚本程序的页面的加载速度降低,甚至导致浏览器瞬间失去响应。
发明内容
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决或者减缓上述问题的一种加载插件的方法和相应的一种浏览
器、一种服务器、一种计算机程序,以及一种计算机可读介质。
根据本发明的一个方面,提供了一种加载插件的方法,包括:
当浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时,创建代理对象,并获取所述第一插件对象的参数信息;
将所述第一插件对象的参数信息发送至服务器侧;
接收所述服务器侧返回的第二插件对象的参数信息,所述第二插件对象的参数信息通过服务器侧在依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时提取获得;
依据所述第二插件对象的参数信息创建第二插件对象;
建立所述代理对象与所述第二插件对象的关联;
采用所述代理对象配置所述第二插件对象运行的脚本;
采用所述第二插件对象根据所述脚本进行所述网页的加载。
根据本发明的另一个方面,提供了一种加载插件的方法,包括:
接收浏览器侧发送的第一插件对象的参数信息;
依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时,提取所述第二插件对象的参数信息返回浏览器侧,由所述浏览器侧依据所述第二插件对象的参数信息创建第二插件对象;建立代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载,其中,所述代理对象为浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时创建。
根据本发明的另一个方面,提供了一种浏览器,包括:
代理对象创建模块,适于在浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时,创建代理对象,并获取所述第一插件对象的参数信息;
第一插件对象的参数信息发送模块,适于将所述第一插件对象的参数信息发送至服务器侧;
第二插件对象的参数信息接收模块,适于接收所述服务器侧返回的第二插件对象的参数信息,所述第二插件对象的参数信息通过服务器侧在依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时
提取获得;
第二插件对象创建模块,适于依据所述第二插件对象的参数信息创建第二插件对象;
关联建立模块,适于建立所述代理对象与所述第二插件对象的关联;
脚本配置模块,适于采用所述代理对象配置所述第二插件对象运行的脚本;
第一页面加载模块,适于采用所述第二插件对象根据所述脚本进行所述网页的加载。
根据本发明的另一个方面,提供了一种服务器,包括:
第一插件对象的参数信息接收模块,适于接收浏览器侧发送的第一插件对象的参数信息;
第二插件对象的参数信息返回模块,适于依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时,提取所述第二插件对象的参数信息返回浏览器侧,由所述浏览器侧依据所述第二插件对象的参数信息创建第二插件对象;建立代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载,其中,所述代理对象为浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时创建。
根据本发明的又一个方面,提供了一种计算机程序,其包括计算机可读代码,当所述计算机可读代码在服务器上运行时,导致所述服务器执行上述的加载插件的方法。
根据本发明的再一个方面,提供了一种计算机可读介质,其中存储了上述的计算机程序。
本发明的有益效果为:
在本发明中,当浏览器侧的页面进程加载到网页中的ActiveX插件时,可以将其替换为浏览器内置的ActiveX插件,使得浏览器自带的ActiveX插件能够对当前页面中其支持的文件格式的网络元素的接管和打开,避免用户下载和安装网页中的ActiveX插件,提高了页面加载的效率。
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上
述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:
图1示意性示出了根据本发明一个实施例的一种加载插件的方法实施例一的步骤流程图;
图2示意性示出了根据本发明一个实施例的一种加载插件的方法实施例二的步骤流程图;
图3示意性示出了根据本发明一个实施例的一种浏览器实施例的结构框图;
图4示意性地示出了根据本发明一个实施例的一种服务器实施例的结构框图;
图5示意性地示出了用于执行根据本发明的方法的服务器的框图;以及
图6示意性地示出了用于保持或者携带实现根据本发明的方法的程序代码的存储单元。
下面结合附图和具体的实施方式对本发明作进一步的描述。
参照图1,示出了根据本发明一个实施例的一种加载插件的方法实施例一的步骤流程图,从实施例从浏览器侧进行说明,具体可以包括以下步骤:
步骤101,当浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时,创建代理对象,并获取所述第一插件对象的参数信息;
应用于本实施例,所述第一插件对象可以为网页中规定使用的ActiveX插件,如百度影音、QVOD(快播)等。所述浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求,具体可以为,在浏览器侧加载网页的过程中钩挂hook到CoGetClassObject函数时,即拦截到第一插件对象的创建需求。
具体而言,ActiveX插件是一种COM(Component Object Model,组
件对象模型)组件,在COM库中,有三个API(Application Programming Interface,应用程序编程接口)函数可用于对象的创建,它们分别是CoGetClassObject、CoCreateInstance和CoCreateInstanceEx,通常情况下,客户程序调用其中之一完成对象的创建,并返回对象的初始化接口指针,COM库与类厂(类厂也是一个接口或COM对象,其职责是创造组件的对象并返回给客户程序一个接口的指针,每个组件都必须有一个与之相关的类厂)也通过这三个函数进行交互。
CoGetClassObject声明可以表示如下:
STDAPI CoGetClassObject(REFCLSID rclsid,
DWORD dwClsContext,
COSERVERINFO*pServerInfo,
REFIID riid,
LPVOID*ppv);
其中,rclsid用来唯一标识一个对象的CLSID(128位),通过rclsid可以知道需要创建的对象(需要用它来创建指定对象);dwClsContext为组件类别,可使用CLSCTX枚举器中预定义的值;pServerInfo是一个指针,它指向被实例化的类对象所在的机器(如果是本地机器,参数为NULL);riid为引用接口标识符,用来与对象通信;ppv作为输出参数存放返回的类厂接口指针。
当客户程序要调用COM库函数CoCreateInstance以得到类厂接口指针时,CoCreateInstance调用函数CoGetClassObject,在函数CoGetClassObject中使用参数CLSID查找注册表,找到COM组件DLL的路径并加载,调用所述DLL中实现的函数DllGetClassObject,DllGetClassObject函数创建类厂,并逆序返回类厂接口指针给CoGetClassObject,依据所述类厂接口指针创建对象。而在本发明实施例中,当浏览器侧的页面进程需要创建对象时,对CoGetClassObject函数进行hook(hook是Windows中提供的一种用以替换DOS下“中断”的系统机制,中文译为“挂钩”或“钩子”),从而阻止对象的创建。
在本发明实施例中,对于hook到浏览器侧中的CoGetClassObject函数而知道需要创建对象,从而启动代理对象(Prox对象)的创建,使用Prox对象替换CoGetClassObject函数实际要创建的对象。其中,Prox对象包括一系列接口,包括IUnknown指针将会调用的很多标准接口,例如IOleObject、IViewObject等,然后在调用IClassFactory(类厂)的
CreateInstance(创建函数)时,将所创建的代理对象prox返回给页面进程的IUnknown指针,由此代理对象创建完成。
在实际中,在创建插件对象的同时,可以从浏览器侧的页面进程中获取所述第一插件对象的参数信息,从而知道具体需要创建的插件。在本发明实施例的一种优选示例中,所述第一插件对象的参数信息可以包括第一插件对象的标识以及第一文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,可以包括文件名,文件大小和文件哈希值。例如,当第一插件对象为百度影音(BaiduPlayer)插件时,其参数信息可以为:
<object classid="clsid:02E2D748-67F8-48B4-8AB4-0A085374BB99″width=″500″height="400″id="BaiduPlayer″name="BaiduPlayer″>
<PARAM NAME=′URL′VALUE=′bdhd://216615163|5E5F4843ED84AEA1812335413084E718|宫锁心玉02.rmvb′>
<PARAM NAME=′Autoplay′VALUE=′1′>
</object>
其中,object为HTML语言中对COM组件的统一使用方式;classid为HTML语言中对WEB插件的调用语句;clsid为BaiduPlayer插件类型ID值;width/height为在网页中显示的该插件宽与高度;id/name/为BaiduPlayer插件的标识;URL为播放文件地址(即第一文件的URL),该URL值格式为bdhd://文件大小|文件hash值|文件名(bdhd为BaiduPlayer生成URL地址的协议);AutoPlay为是否自动播放,0:不自动播放1:自动播放,默认是不自动播放。
步骤102,将所述第一插件对象的参数信息发送至服务器侧;
步骤103,接收所述服务器侧返回的第二插件对象的参数信息,所述第二插件对象的参数信息通过服务器侧在依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时提取获得;
在本发明实施例中,当浏览器侧的页面进程加载到网页中的ActiveX插件时,可以将其替换为浏览器侧内置的ActiveX插件(第二插件对象),使得浏览器侧内置的ActiveX插件能够对当前页面中其支持的文件格式的网络元素的接管和打开,避免用户下载和安装网页中的ActiveX插件。
具体而言,浏览器侧将所述第一插件对象的标识以及第一文件的URL等信息上传到服务器侧,由服务器侧进行判断是否可以进行插件的
替换操作。在具体实现中,服务器侧的数据资源库中保存有各种数据资源文件(包括文件名、文件大小和文件哈希值),服务器侧可以分别将数据资源库中的各数据资源文件按照浏览器侧内置的第二插件对象的协议生成各数据资源文件的URL(即第二文件的URL),并生成各数据资源文件与对应的URL的映射关系保存在映射表中。当服务器侧接收到浏览器侧上传的第一插件对象的标识以及第一文件的URL时,获得该第一插件对象的第一文件的URL中的文件名、文件大小和文件哈希值的文件信息,在映射表中查找与所述第一文件的URL中的文件名,文件大小和文件哈希值相同的文件名,文件大小和文件哈希值,若查找成功,则确定可以进行第二插件对象的替换,并获得对应的第二文件的URL(例如,与百度影音的播放地址对应的第二文件的URL可以为:
ed2k://|file|Lucky%20Girl%20-%20Just%20My%20Luck%20French%20Dvdrip%20Xvid-Justmyluck-Songo52%20Par%20Idonkey%20Ws.avi|729925632|73CF7916F3ABD182035C82A69CCA29F9|/),服务器侧将该对应的第二文件的URL和第二插件对象的标识(第二文件的URL和第二插件对象组成第二插件对象的参数信息)返回至浏览器侧。
另外,当服务器侧在映射表中没有查找与到所述第一文件的URL中的文件名,文件大小和文件哈希值相同的文件名,文件大小和文件哈希值时,则确定不存在可替换的第二插件对象,服务器侧返回的提示信息至浏览器侧,浏览器侧依据该提示信息,对拦截的CoGetClassObject函数放行,从而创建第一插件对象,采用所述第一插件对象与代理对象进行通信,实现网页的加载。
步骤104,依据所述第二插件对象的参数信息创建第二插件对象;
具体而言,当浏览器侧接收到服务器侧返回的第二插件对象的参数信息后,将所述第二插件对象的参数信息替换页面进程中的第一插件对象的参数信息,浏览器侧再次加载页面进程,在CoGetClassObject函数中获得类厂接口指针后,调用类厂中的创建函数创建第二插件对象,其中,所述第二插件对象为真正实现插件功能的对象。
步骤105,建立所述代理对象与所述第二插件对象的关联;
在本发明实施例中,可以在代理对象和第二插件对象中分别创建与对象关联的通信窗口,以建立所述代理对象与所述第二插件对象的关联,使得代理对象和第二插件对象可以通过通信窗口进行通信,通过代理对象和第二插件对象的通信窗口,实现代理对象调用第二插件对象和/或第
二插件对象调用代理对象,从而实现插件所要实现的功能。
步骤106,采用所述代理对象配置所述第二插件对象运行的脚本;
在具体实现中,代理对象与第二插件对象的通信包括进程间的脚本执行过程,通过代理对象来配置第二插件对象运行的脚本。在本发明的一种优选实施例中,所述第一插件对象的参数信息还可以包括第一功能函数,所述第二插件对象运行的脚本可以包括第二插件对象的第二功能函数,所述步骤106可以包括如下子步骤:
子步骤S21,在调用所述第一功能函数时,采用所述代理对象将所述第一功能函数替换为对应的第二功能函数;
子步骤S22,采用所述代理对象按照所述第二功能函数以及所述第二文件的URL配置所述第二插件对象运行的脚本。
具体而言,所述代理对象可以通过调度接口IDispatch接口将所述第一功能函数替换为第二插件对象中对应的第二功能函数。在具体实现中,浏览器侧的页面进程在加载网页时,当解析到第一插件对象中脚本时,将该脚本中待执行的方法的名称调到代理对象的IDispatch接口中,IDispatch接口为调度接口,用于调用不支持虚函数表的语言程序中的函数,IDispatch接口具有GetIDsOfNames函数和Invoke函数,其中GetIDsOfNames函数提供的是利用方法的名称返回其调度ID的方法,Invoke函数提供的是利用方法的调度ID执行方法的指令。由于第一插件对象并没有真正创建,而第二插件对象是真正的插件的对象,所以代理对象通过通信窗口调用第二插件对象的IDispatch接口,调用第二插件对象的GetIDsOfNames函数提供的方法,让第二插件对象获取待执行的方法的调度ID,并根据所述调度ID获取相应的功能函数(第二功能函数),然后第二插件对象通过通信窗口将该调度ID和第二功能函数返回给代理对象,代理对象将所述第二功能函数替换第一功能函数(例如:第一插件对象中的Play函数,在Prox对象被调用时,实际被映射到第二插件对象的对应Play函数,其名称也可以不是play,但是功能是完全一致的),然后,按照所述第二功能函数以及所述第二文件的URL配置所述第二插件对象运行的脚本。
步骤107,采用所述第二插件对象根据所述脚本进行所述网页的加载。
具体而言,代理对象完成第二插件对象的脚本的配置后,将该脚本反馈给页面进程,页面进程采用所述第二插件对象执行Invoke(ID)的指
令,从而执行脚本中待执行的方法,完成页面的加载。
在本发明实施例中,可以实现对于网页中的任一ActiveX插件的替换操作,从而实现了浏览器侧中所有的数据资源都可以找到一个合适的或者统一的ActiveX插件进行加载,而不需要用户进行手动的安装,大大地提高了浏览器侧对于网页中数据资源加载的效率。
参照图2,示出了根据本发明一个实施例的一种加载插件的方法实施例二的步骤流程图,从实施例从服务器侧进行说明,具体可以包括以下步骤:
步骤201,接收浏览器侧发送的第一插件对象的参数信息;
步骤202,依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时,提取所述第二插件对象的参数信息返回浏览器侧;
其中,所述浏览器侧依据所述第二插件对象的参数信息创建第二插件对象;建立代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载,其中,所述代理对象为浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时创建。
在本发明的一种优选实施例中,所述第一插件对象的参数信息可以包括第一插件对象的标识以及第一文件的URL,所述第二插件对象的参数信息可以包括第二插件对象的标识以及第二文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,可以包括文件名,文件大小和文件哈希值;所述第二文件的URL为按照第二插件对象的协议生成的URL,可以包括文件名,文件大小和文件哈希值;所述步骤202可以包括如下子步骤:
依据所述第一文件的URL,判断在服务器侧预置的映射表中是否存在与所述文件名,文件大小和文件哈希值相同的第二文件的URL;
若是,则依据所述第二文件的URL获取第二插件对象的标识;
将所述第二插件对象的标识以及第二文件的URL返回浏览器侧。
另外,当在服务器侧预置的映射表中不存在与所述文件名,文件大小和文件哈希值相同的第二文件的URL时,则判定不存在可替换的第二
插件对象,此时,服务器侧返回提示信息,由所述浏览器侧依据所述提示信息,创建第一插件对象,并采用所述第一插件对象进行所述网页的加载。
对于图2的方法实施例而言,由于其与图1的方法实施例基本相似,所以描述的比较简单,相关之处参见图1的方法实施例的部分说明即可
参照图3,示出了根据本发明一个实施例的一种浏览器实施例的结构框图,具体可以包括如下模块:
代理对象创建模块301,适于在浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时,创建代理对象,并获取所述第一插件对象的参数信息;
其中,在浏览器侧加载网页的过程中钩挂hook到cogetclassobject函数时,即拦截到第一插件对象的创建需求。
第一插件对象的参数信息发送模块302,适于将所述第一插件对象的参数信息发送至服务器侧;
第二插件对象的参数信息接收模块303,适于接收所述服务器侧返回的第二插件对象的参数信息,所述第二插件对象的参数信息通过服务器侧在依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时提取获得;
第二插件对象创建模块304,适于依据所述第二插件对象的参数信息创建第二插件对象;
关联建立模块305,适于建立所述代理对象与所述第二插件对象的关联;
脚本配置模块306,适于采用所述代理对象配置所述第二插件对象运行的脚本;
第一页面加载模块307,适于采用所述第二插件对象根据所述脚本进行所述网页的加载。
在本发明的一种优选实施例中,所述第一插件对象的参数信息包括第一插件对象的标识以及第一文件的URL,所述第二插件对象的参数信
息包括第二插件对象的标识以及第二文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述第二文件的URL为按照第二插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;当存在可替换的第二插件对象时,所述第二文件的URL中的文件名,文件大小和文件哈希值,与所述第一文件的URL中的文件名,文件大小和文件哈希值相同。
在本发明实施例中,当不存在可替换的第二插件对象时,所述浏览器侧还可以包括:
提示信息接收模块,适于接收服务器侧返回的提示信息,所述提示信息通过服务器侧在依据所述第一插件对象的参数信息判断不存在可替换的第二插件对象时生成;
第一插件对象创建模块,适于依据所述提示信息,创建第一插件对象;
第二页面加载模块,适于采用所述第一插件对象进行所述网页的加载。
在本发明的一种优选实施例中,所述第一插件对象的参数信息还包括第一功能函数,所述第二插件对象运行的脚本包括第二插件对象的第二功能函数,所述脚本配置模块还适于:
在调用所述第一功能函数时,采用所述代理对象将所述第一功能函数替换为对应的第二功能函数;
其中,所述代理对象通过调度接口IDispatch接口将所述第一功能函数替换为第二插件对象中对应的第二功能函数。
采用所述代理对象按照所述第二功能函数以及所述第二文件的URL配置所述第二插件对象运行的脚本。
对于浏览器实施例而言,由于其与上述方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
参照图4,示出了根据本发明一个实施例的一种服务器实施例的结构框图,具体可以包括如下模块:
第一插件对象的参数信息接收模块401,适于接收浏览器侧发送的第一插件对象的参数信息;
第二插件对象的参数信息返回模块402,适于依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时,提取所述第二插件对象的参数信息返回浏览器侧,由所述浏览器侧依据所述第二插件对象的参数信息创建第二插件对象;建立代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载,其中,所述代理对象为浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时创建。
在本发明的一种优选实施例中,所述第一插件对象的参数信息包括第一插件对象的标识以及第一文件的URL,所述第二插件对象的参数信息包括第二插件对象的标识以及第二文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述第二文件的URL为按照第二插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;
所述第二插件对象的参数信息返回模块还适于:
依据所述第一文件的URL,判断在服务器侧预置的映射表中是否存在与所述文件名,文件大小和文件哈希值相同的第二文件的URL;
若是,则依据所述第二文件的URL获取第二插件对象的标识;
将所述第二插件对象的标识以及第二文件的URL返回浏览器侧。
在本发明实施例中,当不存在可替换的第二插件对象时,所述服务器侧还可以包括:
提示信息返回模块,适于在依据所述第一插件对象的参数信息判断不存在可替换的第二插件对象时,返回提示信息,由所述浏览器侧依据所述提示信息,创建第一插件对象,并采用所述第一插件对象进行所述网页的加载。
对于服务器实施例而言,由于其与方法实施例基本相似,所以描述的比较简单,相关之处参见方法实施例的部分说明即可。
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的加载插件的设备中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。
例如,图5示出了可以实现根据本发明的加载插件的的服务器,例如应用服务器。该服务器传统上包括处理器510和以存储器520形式的计算机程序产品或者计算机可读介质。存储器520可以是诸如闪存、EEPROM(电可擦除可编程只读存储器)、EPROM、硬盘或者ROM之类的电子存储器。存储器520具有用于执行上述方法中的任何方法步骤的程序代码531的存储空间530。例如,用于程序代码的存储空间530可以包括分别用于实现上面的方法中的各种步骤的各个程序代码531。这些程序代码可以从一个或者多个计算机程序产品中读出或者写入到这一个或者多个计算机程序产品中。这些计算机程序产品包括诸如硬盘,紧致盘(CD)、存储卡或者软盘之类的程序代码载体。这样的计算机程序产品通常为如参考图6所述的便携式或者固定存储单元。该存储单元可以具有与图5的服务器中的存储器520类似布置的存储段、存储空间等。程序代码可以例如以适当形式进行压缩。通常,存储单元包括计算机可读代码531’,即可以由例如诸如510之类的处理器读取的代码,这些代码当由服务器运行时,导致该服务器执行上面所描述的方法中的各个步骤。
本文中所称的“一个实施例”、“实施例”或者“一个或者多个实施例”意味着,结合实施例描述的特定特征、结构或者特性包括在本发明的至少一个实施例中。此外,请注意,这里“在一个实施例中”的词语例子不一定全指同一个实施例。
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下被实践。在一些实例
中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。
此外,还应当注意,本说明书中使用的语言主要是为了可读性和教导的目的而选择的,而不是为了解释或者限定本发明的主题而选择的。因此,在不偏离所附权利要求书的范围和精神的情况下,对于本技术领域的普通技术人员来说许多修改和变更都是显而易见的。对于本发明的范围,对本发明所做的公开是说明性的,而非限制性的,本发明的范围由所附权利要求书限定。
Claims (20)
- 一种加载插件的方法,包括步骤:当浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时,创建代理对象,并获取所述第一插件对象的参数信息;将所述第一插件对象的参数信息发送至服务器侧;接收所述服务器侧返回的第二插件对象的参数信息,所述第二插件对象的参数信息通过服务器侧在依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时提取获得;依据所述第二插件对象的参数信息创建第二插件对象;建立所述代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载。
- 如权利要求1所述的方法,其特征在于,所述第一插件对象的参数信息包括第一插件对象的标识以及第一文件的URL,所述第二插件对象的参数信息包括第二插件对象的标识以及第二文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述第二文件的URL为按照第二插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;当存在可替换的第二插件对象时,所述第二文件的URL中的文件名,文件大小和文件哈希值,与所述第一文件的URL中的文件名,文件大小和文件哈希值相同。
- 如权利要求1或2所述的方法,其特征在于,还包括步骤:浏览器侧接收服务器侧返回的提示信息,所述提示信息通过服务器侧在依据所述第一插件对象的参数信息判断不存在可替换的第二插件对象时生成;依据所述提示信息,创建第一插件对象;采用所述第一插件对象进行所述网页的加载。
- 如权利要求2所述的方法,其特征在于,所述第一插件对象的参数信息还包括第一功能函数,所述第二插件对象运行的脚本包括第二插件对象的第二功能函数,所述采用所述代理对象配置所述第二插件对象 运行的脚本的步骤包括:在调用所述第一功能函数时,采用所述代理对象将所述第一功能函数替换为对应的第二功能函数;采用所述代理对象按照所述第二功能函数以及所述第二文件的URL配置所述第二插件对象运行的脚本。
- 如权利要求4所述的方法,其特征在于,所述代理对象通过调度接口IDispatch接口将所述第一功能函数替换为第二插件对象中对应的第二功能函数。
- 如权利要求1所述的方法,其特征在于,在浏览器侧加载网页的过程中钩挂hook到cogetclassobject函数时,即拦截到第一插件对象的创建需求。
- 一种加载插件的方法,包括步骤:接收浏览器侧发送的第一插件对象的参数信息;依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时,提取所述第二插件对象的参数信息返回浏览器侧,由所述浏览器侧依据所述第二插件对象的参数信息创建第二插件对象;建立代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载,其中,所述代理对象为浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时创建。
- 如权利要求7所述的方法,其特征在于,所述第一插件对象的参数信息包括第一插件对象的标识以及第一文件的URL,所述第二插件对象的参数信息包括第二插件对象的标识以及第二文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述第二文件的URL为按照第二插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时,提取所述第二插件对象的参数信息返回浏览器侧的步骤,具体 包括:依据所述第一文件的URL,判断在服务器侧预置的映射表中是否存在与所述文件名,文件大小和文件哈希值相同的第二文件的URL;若是,则依据所述第二文件的URL获取第二插件对象的标识;将所述第二插件对象的标识以及第二文件的URL返回浏览器侧。
- 如权利要求7或8所述的方法,其特征在于,还包括步骤:在依据所述第一插件对象的参数信息判断不存在可替换的第二插件对象时,返回提示信息,由所述浏览器侧依据所述提示信息,创建第一插件对象,并采用所述第一插件对象进行所述网页的加载。
- 一种浏览器,包括:代理对象创建模块,适于在浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时,创建代理对象,并获取所述第一插件对象的参数信息;第一插件对象的参数信息发送模块,适于将所述第一插件对象的参数信息发送至服务器侧;第二插件对象的参数信息接收模块,适于接收所述服务器侧返回的第二插件对象的参数信息,所述第二插件对象的参数信息通过服务器侧在依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时提取获得;第二插件对象创建模块,适于依据所述第二插件对象的参数信息创建第二插件对象;关联建立模块,适于建立所述代理对象与所述第二插件对象的关联;脚本配置模块,适于采用所述代理对象配置所述第二插件对象运行的脚本;第一页面加载模块,适于采用所述第二插件对象根据所述脚本进行所述网页的加载。
- 如权利要求10所述的浏览器,其特征在于,所述第一插件对象的参数信息包括第一插件对象的标识以及第一文件的URL,所述第二插 件对象的参数信息包括第二插件对象的标识以及第二文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述第二文件的URL为按照第二插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;当存在可替换的第二插件对象时,所述第二文件的URL中的文件名,文件大小和文件哈希值,与所述第一文件的URL中的文件名,文件大小和文件哈希值相同。
- 如权利要求10或11所述的浏览器,其特征在于,还包括:提示信息接收模块,适于接收服务器侧返回的提示信息,所述提示信息通过服务器侧在依据所述第一插件对象的参数信息判断不存在可替换的第二插件对象时生成;第一插件对象创建模块,适于依据所述提示信息,创建第一插件对象;第二页面加载模块,适于采用所述第一插件对象进行所述网页的加载。
- 如权利要求11所述的浏览器,其特征在于,所述第一插件对象的参数信息还包括第一功能函数,所述第二插件对象运行的脚本包括第二插件对象的第二功能函数,所述脚本配置模块还适于:在调用所述第一功能函数时,采用所述代理对象将所述第一功能函数替换为对应的第二功能函数;采用所述代理对象按照所述第二功能函数以及所述第二文件的URL配置所述第二插件对象运行的脚本。
- 如权利要求13所述的浏览器,其特征在于,所述代理对象通过调度接口IDispatch接口将所述第一功能函数替换为第二插件对象中对应的第二功能函数。
- 如权利要求10所述的浏览器,其特征在于,在浏览器侧加载网页的过程中钩挂hook到cogetclassobject函数时,即拦截到第一插件对象的创建需求。
- 一种服务器,包括:第一插件对象的参数信息接收模块,适于接收浏览器侧发送的第一插件对象的参数信息;第二插件对象的参数信息返回模块,适于依据所述第一插件对象的参数信息判断存在可替换的第二插件对象时,提取所述第二插件对象的参数信息返回浏览器侧,由所述浏览器侧依据所述第二插件对象的参数信息创建第二插件对象;建立代理对象与所述第二插件对象的关联;采用所述代理对象配置所述第二插件对象运行的脚本;采用所述第二插件对象根据所述脚本进行所述网页的加载,其中,所述代理对象为浏览器侧在加载网页的过程中拦截到第一插件对象的创建需求时创建。
- 如权利要求16所述的服务器,其特征在于,所述第一插件对象的参数信息包括第一插件对象的标识以及第一文件的URL,所述第二插件对象的参数信息包括第二插件对象的标识以及第二文件的URL,所述第一文件的URL为按照第一插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述第二文件的URL为按照第二插件对象的协议生成的URL,包括文件名,文件大小和文件哈希值;所述第二插件对象的参数信息返回模块还适于:依据所述第一文件的URL,判断在服务器侧预置的映射表中是否存在与所述文件名,文件大小和文件哈希值相同的第二文件的URL;若是,则依据所述第二文件的URL获取第二插件对象的标识;将所述第二插件对象的标识以及第二文件的URL返回浏览器侧。
- 如权利要求16或17所述的服务器,其特征在于,还包括:提示信息返回模块,适于在依据所述第一插件对象的参数信息判断不存在可替换的第二插件对象时,返回提示信息,由所述浏览器侧依据所述提示信息,创建第一插件对象,并采用所述第一插件对象进行所述网页的加载。
- 一种计算机程序,包括计算机可读代码,当所述计算机可读代码在服务器上运行时,导致所述服务器执行根据权利要求1-9中的任一个所述的加载插件的方法。
- 一种计算机可读介质,其中存储了如权利要求19所述的计算机程序。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310513333.XA CN103577227B (zh) | 2013-10-25 | 2013-10-25 | 一种加载插件的方法、浏览器和服务器 |
| CN201310513333.X | 2013-10-25 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2015058716A1 true WO2015058716A1 (zh) | 2015-04-30 |
Family
ID=50049074
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2014/089473 Ceased WO2015058716A1 (zh) | 2013-10-25 | 2014-10-24 | 一种加载插件的方法、浏览器和服务器 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN103577227B (zh) |
| WO (1) | WO2015058716A1 (zh) |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110580156A (zh) * | 2019-08-21 | 2019-12-17 | 北京摩拜科技有限公司 | 页面处理方法、装置及电子设备 |
| CN110908726A (zh) * | 2018-09-14 | 2020-03-24 | 广州神马移动信息科技有限公司 | 数据管理方法、装置、设备及计算机可读存储介质 |
| CN113204336A (zh) * | 2021-05-21 | 2021-08-03 | 珠海金山网络游戏科技有限公司 | 一种游戏平台创建方法及装置 |
Families Citing this family (10)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103577227B (zh) * | 2013-10-25 | 2017-01-18 | 北京奇虎科技有限公司 | 一种加载插件的方法、浏览器和服务器 |
| CN103810008B (zh) * | 2014-02-19 | 2018-03-02 | 迈普通信技术股份有限公司 | 插件加载方法及系统 |
| CN105893092B (zh) * | 2016-04-01 | 2021-02-12 | 腾讯科技(深圳)有限公司 | Com组件处理方法和装置 |
| CN106789535B (zh) * | 2016-12-29 | 2019-12-06 | 杭州迪普科技股份有限公司 | Ssl vpn的ip接入方法及装置 |
| CN110968358A (zh) * | 2018-09-30 | 2020-04-07 | 北京国双科技有限公司 | 一种基于浏览器插件加载脚本模块的方法及装置 |
| CN110062195A (zh) * | 2019-04-19 | 2019-07-26 | 视联动力信息技术股份有限公司 | 一种视频会议接入方法及系统 |
| CN110806882B (zh) * | 2019-11-08 | 2023-05-26 | 山东德昌电子科技有限公司 | 一种监控插件安装的方法及系统 |
| CN111124713B (zh) * | 2019-12-24 | 2024-03-26 | 北京安兔兔科技有限公司 | 设备系统函数调用方法、装置、终端设备和存储介质 |
| CN113448756B (zh) * | 2021-08-30 | 2021-12-07 | 统信软件技术有限公司 | 一种进程间通信系统、方法及计算设备 |
| CN117312706A (zh) * | 2022-08-29 | 2023-12-29 | 北京国信创服科技有限公司 | 一种基于Hook的windows系统IE插件信创环境兼容性评估方法 |
Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102567516A (zh) * | 2011-12-28 | 2012-07-11 | 华为技术有限公司 | 脚本加载方法及装置 |
| CN102929656A (zh) * | 2012-09-28 | 2013-02-13 | 北京奇虎科技有限公司 | 使用浏览器中内置ActiveX插件的方法和客户端 |
| CN103179166A (zh) * | 2011-12-23 | 2013-06-26 | 腾讯科技(深圳)有限公司 | 在客户端中提供服务的方法和客户端 |
| CN103577227A (zh) * | 2013-10-25 | 2014-02-12 | 北京奇虎科技有限公司 | 一种加载插件的方法、浏览器和服务器 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103019733B (zh) * | 2012-12-25 | 2016-07-06 | 北京奇虎科技有限公司 | 一种用于浏览器的活动对象执行方法、系统及浏览器 |
-
2013
- 2013-10-25 CN CN201310513333.XA patent/CN103577227B/zh active Active
-
2014
- 2014-10-24 WO PCT/CN2014/089473 patent/WO2015058716A1/zh not_active Ceased
Patent Citations (4)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN103179166A (zh) * | 2011-12-23 | 2013-06-26 | 腾讯科技(深圳)有限公司 | 在客户端中提供服务的方法和客户端 |
| CN102567516A (zh) * | 2011-12-28 | 2012-07-11 | 华为技术有限公司 | 脚本加载方法及装置 |
| CN102929656A (zh) * | 2012-09-28 | 2013-02-13 | 北京奇虎科技有限公司 | 使用浏览器中内置ActiveX插件的方法和客户端 |
| CN103577227A (zh) * | 2013-10-25 | 2014-02-12 | 北京奇虎科技有限公司 | 一种加载插件的方法、浏览器和服务器 |
Cited By (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN110908726A (zh) * | 2018-09-14 | 2020-03-24 | 广州神马移动信息科技有限公司 | 数据管理方法、装置、设备及计算机可读存储介质 |
| CN110580156A (zh) * | 2019-08-21 | 2019-12-17 | 北京摩拜科技有限公司 | 页面处理方法、装置及电子设备 |
| CN113204336A (zh) * | 2021-05-21 | 2021-08-03 | 珠海金山网络游戏科技有限公司 | 一种游戏平台创建方法及装置 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103577227A (zh) | 2014-02-12 |
| CN103577227B (zh) | 2017-01-18 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US12429833B1 (en) | Method and system of running an application | |
| CN103577227B (zh) | 一种加载插件的方法、浏览器和服务器 | |
| CN104866512B (zh) | 提取网页内容的方法、装置及系统 | |
| CN103064738B (zh) | Linux下本地应用程序窗体嵌入浏览器的方法及系统 | |
| US10207190B2 (en) | Technologies for native game experience in web rendering engine | |
| CN104915977B (zh) | 本地应用程序的动画文件生成方法及装置 | |
| US20130031454A1 (en) | System for Programmatically Accessing Document Annotations | |
| WO2013166906A1 (zh) | 一种基于Webkit内核提供网页浏览的方法及装置 | |
| CN110955428A (zh) | 一种页面显示方法、装置、电子设备及介质 | |
| CN105389222A (zh) | 一种动态调用原生接口的方法、装置和系统 | |
| US9286142B2 (en) | Methods and systems for supporting a rendering API using a runtime environment | |
| WO2016155388A1 (zh) | 应用安装、运行方法及装置 | |
| CN104049986A (zh) | 插件加载方法及装置 | |
| WO2014048240A1 (zh) | 使用浏览器中内置ActiveX插件的方法和客户端 | |
| US10554784B2 (en) | Method and system for rendering content using templates | |
| CN102982169A (zh) | 用于隔离网页插件的浏览器和方法 | |
| CN103034495A (zh) | 对网页中插件进行隔离的浏览器及网页插件的隔离方法 | |
| WO2013139268A1 (zh) | 离线应用的生成及调用方法、终端及系统 | |
| US20110004602A1 (en) | Method for generating widget icon, apparatus for generating widget summary information file, and widget engine | |
| US20130081010A1 (en) | Template and server content download using protocol handlers | |
| CN105955833A (zh) | 引擎调用方法和装置 | |
| CN105988814A (zh) | 界面生成方法及装置 | |
| JP5039946B2 (ja) | クライアント装置およびサーバ装置の間の通信を中継する技術 | |
| CN103677979B (zh) | 应用软件和插件的交互方法及装置 | |
| CN104834589A (zh) | 一种网页检测方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 14855096 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |
|
| 122 | Ep: pct application non-entry in european phase |
Ref document number: 14855096 Country of ref document: EP Kind code of ref document: A1 |