CN103176834B - A kind of method of invoke extensions interface and device - Google Patents

A kind of method of invoke extensions interface and device Download PDF

Info

Publication number
CN103176834B
CN103176834B CN201110441715.7A CN201110441715A CN103176834B CN 103176834 B CN103176834 B CN 103176834B CN 201110441715 A CN201110441715 A CN 201110441715A CN 103176834 B CN103176834 B CN 103176834B
Authority
CN
China
Prior art keywords
expansion interface
data structure
interface
parameter
browser kernel
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201110441715.7A
Other languages
Chinese (zh)
Other versions
CN103176834A (en
Inventor
常平
李临
黄奎
屈超
谭志辉
孟昭俊
谢昕虬
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Tencent Technology Shenzhen Co Ltd
Original Assignee
Tencent Technology Shenzhen Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Tencent Technology Shenzhen Co Ltd filed Critical Tencent Technology Shenzhen Co Ltd
Priority to CN201110441715.7A priority Critical patent/CN103176834B/en
Publication of CN103176834A publication Critical patent/CN103176834A/en
Application granted granted Critical
Publication of CN103176834B publication Critical patent/CN103176834B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Computer And Data Communications (AREA)
  • User Interface Of Digital Computer (AREA)

Abstract

The invention discloses a kind of method and device of invoke extensions interface, belong to computer realm.Described method comprises: receive the mark of the expansion interface that browser kernel needs call and parameter corresponding to described expansion interface; The parameter corresponding to described expansion interface is resolved, and Parameter Switch corresponding for described expansion interface is become the parameter of common data structure, and described common data structure is the data structure that described expansion interface can identify; Call the expansion interface of the mark correspondence of described expansion interface, described expansion interface is run according to the parameter of described common data structure, obtains operation result; The data structure adopting described browser kernel to support encapsulates described operation result, and the operation result of described encapsulation is sent to described browser kernel.Described device comprises: receiver module, parsing module, calling module and the first package module.The present invention can reduce the cost of development of multi-core browser.

Description

A kind of method of invoke extensions interface and device
Technical field
The present invention relates to computer realm, particularly a kind of method of invoke extensions interface and device.
Background technology
When developing Web (webpage) and applying, often occur that application interface that browser provides can not meet the demand of Web application, so need to expand the ability of browser kernel; Current technician can develop expansion interface, browser kernel can invoke extensions interface meet Web application demand, thus realize the ability of browser kernel is expanded.
Wherein, current expansion interface is all developed based on specific browser kernel, make the corresponding a set of expansion interface of often kind of browser kernel, and often kind of browser kernel can only call the expansion interface of its correspondence, such as, IE (InternetExplorer, internet browser) kernel and WebKit kernel are two kinds of common at present browser kernels, for IE kernel development goes out a set of expansion interface of its correspondence to expand the ability of IE kernel; And go out corresponding a set of expansion interface to expand the ability of WebKit kernel for WebKit kernel development.
Realizing in process of the present invention, inventor finds that prior art at least exists following problem:
There is multi-core browser at present, in order to expand the ability of the browser kernel in browser, having needed for each browser kernel in multi-core browser develops a set of expansion interface of its correspondence, as this increased the cost of development of multi-core browser.
Summary of the invention
In order to reduce the cost of development of multi-core browser, the invention provides a kind of method and device of invoke extensions interface.Described technical scheme is as follows:
A method for invoke extensions interface, described method comprises:
Receive browser kernel and need the mark of the expansion interface called and parameter corresponding to described expansion interface;
The parameter corresponding to described expansion interface is resolved, and Parameter Switch corresponding for described expansion interface is become the parameter of common data structure, and described common data structure is the data structure that described expansion interface can identify;
Call the expansion interface of the mark correspondence of described expansion interface, described expansion interface is run according to the parameter of described common data structure, obtains operation result;
The data structure adopting described browser kernel to support encapsulates described operation result, and the operation result of described encapsulation is sent to described browser kernel.
The described parameter corresponding to described expansion interface is resolved, and Parameter Switch corresponding for described expansion interface is become the parameter of common data structure, comprising:
Obtain the parsing interface that described browser kernel is corresponding;
Parse described browser kernel by described parsing interface and encapsulate the data structure that parameter corresponding to described expansion interface adopt, obtain the data structure that described browser kernel is supported;
The data structure supported according to the described browser kernel parameter corresponding to described expansion interface carries out decapsulation, obtains the parameter of common data structure.
The parsing interface that the described browser kernel of described acquisition is corresponding, comprising:
Obtain the type of described browser kernel, determine the mark of corresponding parsing interface according to the type of described browser kernel;
From the mark of parsing receiving port stored and the corresponding relation of index, obtain the index that described parsing interface is corresponding;
The index corresponding according to described parsing interface obtains described parsing interface from terminal local.
The described expansion interface calling the mark correspondence of described expansion interface, makes described expansion interface run according to the parameter of described common data structure, obtains operation result, comprising:
According to the mark of described expansion interface from the mark of the expansion interface stored and the corresponding relation of index, obtain the index that described expansion interface is corresponding;
Index according to described acquisition obtains described expansion interface from terminal local, described expansion interface is given by the parameter transmission of corresponding for described expansion interface common data structure, described expansion interface is run according to the parameter of the corresponding common data structure of described expansion interface, obtains operation result.
Described described expansion interface is run according to the parameter of described common data structure, obtains operation result, also comprise:
When described expansion interface to carry out in the process run according to the parameter of described common data structure, if described expansion interface produces event, the data structure then adopting described browser kernel to support encapsulates described event, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
A device for invoke extensions interface, described device comprises:
Receiver module, needs the mark of the expansion interface called and parameter corresponding to described expansion interface for receiving browser kernel;
Parsing module, resolves for the parameter corresponding to described expansion interface, Parameter Switch corresponding for described expansion interface is become the parameter of common data structure, and described common data structure is the data structure that described expansion interface can identify;
Calling module, for calling the expansion interface of the mark correspondence of described expansion interface, making described expansion interface run according to the parameter of described common data structure, obtaining operation result;
First package module, the data structure supported for adopting described browser kernel encapsulates described operation result, and the operation result of described encapsulation is sent to described browser kernel.
Described parsing module comprises:
First acquiring unit, for obtaining parsing interface corresponding to described browser kernel;
Resolution unit, is encapsulated for being parsed described browser kernel by described parsing interface the data structure that parameter corresponding to described expansion interface adopt, obtains the data structure that described browser kernel is supported;
Decapsulation unit, the parameter corresponding to described expansion interface of the data structure for supporting according to described browser kernel carries out decapsulation, obtains the parameter of common data structure.
Described first acquiring unit comprises:
First obtains subelement, for obtaining the type of described browser kernel, determines the mark of corresponding parsing interface according to the type of described browser kernel;
Second obtains subelement, for from the mark of parsing interface stored and the corresponding relation of index, obtains the index that described parsing interface is corresponding;
3rd obtains subelement, obtains described parsing interface for the index corresponding according to described parsing interface from terminal local.
Described calling module comprises:
Second acquisition unit, for according to the mark of described expansion interface from the mark of the expansion interface stored and the corresponding relation of index, obtain the index that described expansion interface is corresponding;
Running unit, described expansion interface is obtained from terminal local for the index according to described acquisition, described expansion interface is given by the parameter transmission of corresponding for described expansion interface common data structure, described expansion interface is run according to the parameter of the corresponding common data structure of described expansion interface, obtains operation result.
Described device also comprises:
Second package module, for in the process of to carry out according to the parameter of described common data structure running when described expansion interface, if described expansion interface produces event, the data structure then adopting described browser kernel to support encapsulates described event, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
In the present invention, receive browser kernel and need the mark of the expansion interface called and parameter corresponding to this expansion interface, the parameter corresponding to this expansion interface is resolved, the parameter of the common data structure that this expansion interface of Parameter Switch that this expansion interface is corresponding can identify, call the expansion interface of the mark correspondence of this expansion interface, make this expansion interface carry out operation according to the parameter of common data structure and obtain operation result, the data structure adopting this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need for multi-core browser develops a set of expansion interface, each browser kernel in this multi-core browser can share this cover expansion interface, thus reduce the cost of development of multi-core browser, in addition, the exploitation of expansion interface does not need based on concrete browser kernel, and browser kernel and expansion interface are completely independent, have higher extendability from making multi-core browser.
Accompanying drawing explanation
Fig. 1 is the method flow diagram of a kind of invoke extensions interface that the embodiment of the present invention 1 provides;
Fig. 2 is the method flow diagram of a kind of invoke extensions interface that the embodiment of the present invention 2 provides;
Fig. 3 is a kind of multi-core browser structural representation that the embodiment of the present invention 2 provides;
Fig. 4 is the configuration diagram of a kind of WebKit kernel that the embodiment of the present invention 2 provides;
Fig. 5 is the configuration diagram of a kind of IE kernel that the embodiment of the present invention 2 provides;
Fig. 6 is the apparatus structure schematic diagram of a kind of invoke extensions interface that the embodiment of the present invention 3 provides.
Embodiment
For making the object, technical solutions and advantages of the present invention clearly, below in conjunction with accompanying drawing, embodiment of the present invention is described further in detail.
Embodiment 1
As shown in Figure 1, embodiments provide a kind of method of invoke extensions interface, comprising:
Step 101: receiving browser kernel needs the mark of the expansion interface called and parameter corresponding to this expansion interface;
Step 102: the parameter corresponding to this expansion interface is resolved, and Parameter Switch corresponding for this expansion interface is become the parameter of common data structure form, common data structure is the data structure that this expansion interface can identify;
Step 103: the expansion interface calling the mark correspondence of this expansion interface, makes this expansion interface run according to the parameter of common data structure, obtains operation result;
Step 104: the data structure adopting browser kernel to support encapsulates operation result, and the operation result of encapsulation is sent to browser kernel.
Wherein, above-mentioned steps 102, can comprise:
1021: obtain the parsing interface that browser kernel is corresponding;
1022: parse browser kernel by this parsing interface and encapsulate the data structure that parameter corresponding to this expansion interface adopt, obtain the data structure that browser kernel is supported;
1023: the data structure supported according to the browser kernel parameter corresponding to this expansion interface carries out decapsulation, obtains the parameter of common data structure.
Wherein, above-mentioned steps 1021, can comprise:
(1): the type obtaining browser kernel, the mark of corresponding parsing interface is determined according to the type of browser kernel;
(2): from the mark of parsing interface stored and the corresponding relation of index, obtain the index that this parsing interface is corresponding;
(3): the index corresponding according to this parsing interface obtains this parsing interface from terminal local.
Wherein, above-mentioned steps 103, can comprise:
1031: according to the mark of this expansion interface from the mark of expansion interface and the corresponding relation of index, obtain the index that this expansion interface is corresponding;
1032: the index according to obtaining obtains this expansion interface from terminal local, this expansion interface is given by the parameter transmission of corresponding for this expansion interface common data structure, and this expansion interface is run according to the parameter of the corresponding common data structure of this expansion interface, obtain operation result.
Further, the method also comprises:
When this expansion interface to carry out in the process run according to the parameter of common data structure, if this expansion interface produces event, the data structure then adopting browser kernel to support encapsulates the event produced, and the event of encapsulation is submitted to browser kernel, processed by the event of browser kernel to encapsulation.
Wherein, in the present invention, terminal comprises client, Web terminal or wireless terminal, identical therewith in the implication of other local terminals occurred of the present invention, illustrates no longer one by one.
In embodiments of the present invention, receive browser kernel and need the mark of expansion interface called and the parameter of this expansion interface, obtain the data structure that this browser kernel is supported, the parameter of the common data structure being become by the Parameter Switch of this expansion interface this expansion interface to identify, call the expansion interface of the mark correspondence of this expansion interface, this expansion interface is given by the parameter transmission of common data structure, this expansion interface is run according to the parameter of common data structure, obtain operation result, the data structure adopting this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need for multi-core browser develops a set of expansion interface, each browser kernel in this multi-core browser can share this cover expansion interface, thus reduce the cost of exploitation multi-core browser.
Embodiment 2
Embodiments provide a kind of method of invoke extensions interface.Wherein, in the present embodiment, develop a set of expansion interface for multi-core browser and a calling device is set in multi-core browser, when the browser kernel in this multi-core browser needs invoke extensions interface, this browser kernel of method call that calling device can provide by this enforcement needs the expansion interface called, see Fig. 2, the method comprises:
Step 201: receive the mark of expansion interface that needs that this browser kernel sends call and parameter corresponding to this expansion interface;
Wherein, the code that the text that browser kernel is applied Web comprises is resolved, when parsing this Web application and needing invoke extensions interface, the mark of expansion interface and the parameter of this expansion interface that need to call is obtained from the body of an instrument part that this Web applies, then the parameter of data structure to this expansion interface that this browser kernel adopts himself to support encapsulates, then parameter corresponding to this expansion interface sent after the mark of this expansion interface and encapsulation is to calling device.Wherein, the mark of expansion interface can be the title of this expansion interface.
Wherein, in the File of Web application, define this Web be applied in the browser kernel used in multi-core browser, also comprise Web in the File of Web application and apply the displaying contents shown in a browser, the layout information of each displaying contents and the script for realizing action, the displaying contents of Web application can be picture, word and/or button etc., the layout information of displaying contents can comprise the position of displaying contents, color and/or size etc.
Wherein, see Fig. 3, the code that browser kernel comprises for the File of resolving Web application provides running environment, browser kernel at least comprises typesetting engine and script engine, the layout information that typesetting engine is used for realizing displaying contents and each displaying contents in Web application makes an explanation, arranges and plays up, and script engine is used for resolving for the script realizing action in Web application.
Wherein, when running certain Web and apply in multi-core browser, calling device determines that this Web applies the browser kernel used, the each displaying contents comprised by the File that this Web applies and the layout information of each displaying contents submit to the typesetting engine of this browser kernel, and the text that this Web the applies script comprised for realizing action are submitted to the script engine of this browser kernel; Then the layout information of typesetting engine to each displaying contents and each displaying contents of this browser kernel makes an explanation, arranges and plays up, when needing invoke extensions interface in the process explained, arrange and play up, the mark of this expansion interface and parameter corresponding to this expansion interface is obtained from the layout information of each displaying contents and each displaying contents, and the data structure adopting this browser kernel the to support parameter corresponding to this expansion interface encapsulates, and the parameter after the mark of this expansion interface and encapsulation is sent to calling device; And, the script engine of this browser kernel is resolved the script that the text that this Web applies comprises for realizing action, when needing invoke extensions interface in the process of resolving, the mark of this expansion interface and parameter corresponding to this expansion interface is obtained from the script for realizing action, and the data structure adopting this browser kernel the to support parameter corresponding to this expansion interface encapsulates, and the parameter after the mark of this expansion interface and encapsulation is sent to calling device.
Wherein, WebKit kernel and IE kernel are two kinds of common at present browser kernels, the framework of WebKit kernel shown in Figure 4, WebKit kernel is except comprising typesetting engine and script engine, also comprise binding interface and port, the typesetting engine of WebKit kernel can be WebCore, script engine can be JavaScript, the content interpret unit for explaining displaying contents is at least comprised in typesetting engine, for explain the layout information of displaying contents layout Interpretation unit and for the layout rendering unit of to arrange to displaying contents according to the layout information of displaying contents and play up, typesetting engine and script engine are undertaken alternately by binding interface, typesetting engine and script engine are undertaken by the outside of port and WebKit kernel alternately.
The framework of IE kernel shown in Figure 5, IE kernel is except comprising typesetting engine and script engine, also comprise network communication interface and port, the typesetting engine of IE kernel can be Trident, script engine can be MSJscriptengine (MicrosoftJscriptengine, Microsoft's script engine), IE kernel can be communicated with network by network communication interface, and is undertaken alternately by the outside of port and IE kernel.
Step 202: the parameter corresponding to this expansion interface is resolved, obtain the data structure that this browser kernel is supported, and Parameter Switch corresponding for this expansion interface being become the parameter of common data structure, common data structure is the data structure that this expansion interface can identify;
Particularly, obtain the parsing interface that this browser kernel is corresponding, parse this browser kernel by this parsing interface and encapsulate the data structure that parameter corresponding to this expansion interface adopt, obtain the data structure that this browser kernel is supported, and the data structure supported according to this browser kernel parameter corresponding to this expansion interface carries out decapsulation, obtains the parameter of common data structure.
Wherein, be the parsing interface of each browser kernel configuration correspondence in multi-core browser in advance, and the installation kit of this multi-core browser comprise parsing interface corresponding to each browser kernel; Parsing interface corresponding for each browser kernel can be stored in terminal local when installing the installation kit of multi-core browser by terminal, and terminal can form the parsing mark of interface and the corresponding relation of index when installing the installation kit of this multi-core browser, the index of resolving each parsing interface stored in the mark of interface and the corresponding relation of index points to each parsing interface of terminal local storage respectively.
Wherein, obtain the operation of parsing interface corresponding to this browser kernel, can be specially:
Obtain the type of this browser kernel, the mark of corresponding parsing interface is determined according to the type of this browser kernel, and from the mark of parsing interface stored and the corresponding relation of index, obtain the index that this parsing interface is corresponding, the index according to this parsing interface obtains corresponding parsing interface from terminal local.
Wherein, the type of current common browser kernel comprises IE kernel and WebKit kernel etc.
Wherein, in the present embodiment, the data structure that certain programming language can be defined is as common data structure, and the data structure such as shaping, character string type that such as C++ programming language can be defined is as common data structure; In addition, technician can adopt common data structure to develop a set of expansion interface corresponding to multi-core browser, so each expansion interface corresponding to this multi-core browser can identify the data of common data structure.
Step 203: call corresponding expansion interface according to the mark of this expansion interface, this expansion interface is run according to the parameter of this common data structure, obtains operation result;
Wherein, the embedded browser object of multi-core browser (such as, widndow (window) object and document (document) object etc.), in advance each browser object expanded and develop expansion interface, obtain a set of expansion interface that the configuration of this multi-core browser is corresponding, and the installation kit of this multi-core browser comprises a set of expansion interface corresponding to this multi-core browser; A set of expansion interface corresponding for this multi-core browser can be stored in terminal local when installing the installation kit of multi-core browser by terminal, and terminal can form the mark of expansion interface and the corresponding relation of index when installing installation kit, the index of each expansion interface in the mark of expansion interface and the corresponding relation of index points to each expansion interface that terminal local stores respectively.
Particularly, according to the mark of this expansion interface from the mark of the expansion interface stored and the corresponding relation of index, obtain the index that this expansion interface is corresponding, index according to obtaining obtains this expansion interface from terminal local, this expansion interface is given by the parameter transmission of common data structure corresponding for this expansion interface, this expansion interface is run according to the parameter of common data structure corresponding to this expansion interface, obtains operation result.
Wherein, it should be noted that: in the present embodiment, tree form data structure can be adopted at terminal local storing and resolving interface and expansion interface, node in tree form data structure is used for storing and resolving interface or expansion interface, and resolve in index point tree form data structure corresponding to parsing interface in the mark of interface and the corresponding relation of index for storing the node of this parsing interface, and, for storing the node of this expansion interface in the index point tree form data structure that the mark of expansion interface is corresponding with the expansion interface in the corresponding relation of index.
Step 204: the data structure adopting this browser kernel to support encapsulates the operation result obtained, and the operation result after encapsulation is sent to this browser kernel.
Wherein, often kind of browser kernel can only identify the data of its data structure supported, in the present embodiment, the data of the data structure encapsulation adopted by often kind of browser kernel convert the data of common data structure to, and a set of expansion interface of exploitation can identify the data of common data structure; In addition, the data structure adopting browser kernel to support encapsulates operation result, the operation result after making browser kernel can identify encapsulation, thus processes operation result.
Further, when this expansion interface carries out in the process run according to the parameter of the corresponding common data structure of this expansion interface, if this expansion interface produces event, the data structure that this browser kernel then can be adopted to support encapsulates this event, and the event after encapsulation is submitted to this browser kernel, by this browser kernel, this event is processed.
In embodiments of the present invention, receive browser kernel and need the mark of expansion interface called and the parameter of this expansion interface, obtain the data structure that this browser kernel is supported, the parameter of the common data structure being become by the Parameter Switch of this expansion interface this expansion interface to identify, call the expansion interface of the mark correspondence of this expansion interface, make this expansion interface carry out operation according to the parameter of common data structure and obtain operation result, the data structure adopting this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need for multi-core browser develops a set of expansion interface, each browser kernel in this multi-core browser can share this cover expansion interface, thus reduce the cost of exploitation multi-core browser.
Embodiment 3
As shown in Figure 4, embodiments provide a kind of device of invoke extensions interface, comprising:
Receiver module 301, needs the mark of the expansion interface called and parameter corresponding to this expansion interface for receiving browser kernel;
Parsing module 302, resolves for the parameter corresponding to this expansion interface, Parameter Switch corresponding for this expansion interface is become the parameter of common data structure, and common data structure is the data structure that this expansion interface can identify;
Calling module 303, for calling the expansion interface of the mark correspondence of this expansion interface, making this expansion interface run according to the parameter of common data structure, obtaining operation result;
First package module 304, encapsulates operation result for the data structure adopting this browser kernel to support, the operation result of encapsulation is sent to this browser kernel.
Wherein, parsing module 302 comprises:
First acquiring unit, for obtaining parsing interface corresponding to this browser kernel;
Resolution unit, is encapsulated for being parsed this browser kernel by this parsing interface the data structure that parameter corresponding to this expansion interface adopt, obtains the data structure that this browser kernel is supported;
Decapsulation unit, the parameter corresponding to this expansion interface of the data structure for supporting according to this browser kernel carries out decapsulation, obtains the parameter of common data structure.
Wherein, the first acquiring unit comprises:
First obtains subelement, for obtaining the type of this browser kernel, determines the mark of corresponding parsing interface according to the type of this browser kernel;
Second obtains subelement, for from the mark of parsing interface stored and the corresponding relation of index, obtains the index that this parsing interface is corresponding;
3rd obtains subelement, obtains this parsing interface for the index corresponding according to this parsing interface from terminal local.
Wherein, calling module 303 comprises:
Second acquisition unit, for according to the mark of this expansion interface from the mark of the expansion interface stored and the corresponding relation of index, obtain the index that this expansion interface is corresponding;
Running unit, for obtaining this expansion interface according to the index obtained from terminal local, give this expansion interface by the parameter transmission of corresponding for this expansion interface common data structure, this expansion interface is run according to the parameter of the corresponding common data structure of this expansion interface, obtains operation result.
Further, this device also comprises:
Second package module, for in the process of to carry out according to the parameter of common data structure running when this expansion interface, if this expansion interface produces event, the data structure then adopting this browser kernel to support encapsulates the event produced, and the event of encapsulation is submitted to this browser kernel, processed by the event of this browser kernel to encapsulation.
In embodiments of the present invention, receive browser kernel and need the mark of expansion interface called and the parameter of this expansion interface, obtain the data structure that this browser kernel is supported, the parameter of the common data structure becoming this expansion interface to identify the Parameter Switch of this expansion interface, call the expansion interface of the mark correspondence of this expansion interface, this expansion interface is run according to the parameter of common data structure, obtain operation result, the data structure adopting this browser kernel to support encapsulates operation result, operation result after encapsulation is sent to this browser kernel, so only need for multi-core browser develops a set of expansion interface, each browser kernel in this multi-core browser can share this cover expansion interface, thus reduce the cost of exploitation multi-core browser.
It should be noted that: the device of a kind of invoke extensions interface that above-described embodiment provides is when invoke extensions interface, only be illustrated with the division of above-mentioned each functional module, in practical application, can distribute as required and by above-mentioned functions and be completed by different functional modules, inner structure by device is divided into different functional modules, to complete all or part of function described above.In addition, above-described embodiment provides the embodiment of the method for the device of invoke extensions interface and invoke extensions interface to belong to same design, and its specific implementation process refers to embodiment of the method, repeats no more here.
One of ordinary skill in the art will appreciate that all or part of step realizing above-described embodiment can have been come by hardware, the hardware that also can carry out instruction relevant by program completes, described program can be stored in a kind of computer-readable recording medium, the above-mentioned storage medium mentioned can be ROM (read-only memory), disk or CD etc.
The foregoing is only preferred embodiment of the present invention, not in order to limit the present invention, within the spirit and principles in the present invention all, any amendment done, equivalent replacement, improvement etc., all should be included within protection scope of the present invention.

Claims (8)

1. a method for invoke extensions interface, is characterized in that, described method comprises:
Receive browser kernel and need the mark of the expansion interface called and parameter corresponding to described expansion interface;
The parameter corresponding to described expansion interface is resolved, and Parameter Switch corresponding for described expansion interface is become the parameter of common data structure, and described common data structure is the data structure that described expansion interface can identify;
Call the expansion interface of the mark correspondence of described expansion interface, described expansion interface is run according to the parameter of described common data structure, obtains operation result;
The data structure adopting described browser kernel to support encapsulates described operation result, and the operation result of described encapsulation is sent to described browser kernel;
Wherein, described in described expansion interface is run according to the parameter of described common data structure, obtain operation result, also comprise:
When described expansion interface to carry out in the process run according to the parameter of described common data structure, if described expansion interface produces event, the data structure then adopting described browser kernel to support encapsulates described event, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
2. the method for claim 1, is characterized in that, the described parameter corresponding to described expansion interface is resolved, and Parameter Switch corresponding for described expansion interface is become the parameter of common data structure, comprising:
Obtain the parsing interface that described browser kernel is corresponding;
Parse described browser kernel by described parsing interface and encapsulate the data structure that parameter corresponding to described expansion interface adopt, obtain the data structure that described browser kernel is supported;
The data structure supported according to the described browser kernel parameter corresponding to described expansion interface carries out decapsulation, obtains the parameter of common data structure.
3. method as claimed in claim 2, is characterized in that the parsing interface that the described browser kernel of described acquisition is corresponding comprises:
Obtain the type of described browser kernel, determine the mark of corresponding parsing interface according to the type of described browser kernel;
From the mark of parsing interface stored and the corresponding relation of index, obtain the index that described parsing interface is corresponding;
The index corresponding according to described parsing interface obtains described parsing interface from terminal local.
4. the method for claim 1, is characterized in that, described in call the expansion interface of the mark correspondence of described expansion interface, described expansion interface is run according to the parameter of described common data structure, obtains operation result, comprising:
According to the mark of described expansion interface from the mark of the expansion interface stored and the corresponding relation of index, obtain the index that described expansion interface is corresponding;
Index according to described acquisition obtains described expansion interface from terminal local, described expansion interface is given by the parameter transmission of corresponding for described expansion interface common data structure, described expansion interface is run according to the parameter of the corresponding common data structure of described expansion interface, obtains operation result.
5. a device for invoke extensions interface, is characterized in that, described device comprises:
Receiver module, needs the mark of the expansion interface called and parameter corresponding to described expansion interface for receiving browser kernel;
Parsing module, resolves for the parameter corresponding to described expansion interface, Parameter Switch corresponding for described expansion interface is become the parameter of common data structure, and described common data structure is the data structure that described expansion interface can identify;
Calling module, for calling the expansion interface of the mark correspondence of described expansion interface, making described expansion interface run according to the parameter of described common data structure, obtaining operation result;
First package module, the data structure supported for adopting described browser kernel encapsulates described operation result, and the operation result of described encapsulation is sent to described browser kernel;
Wherein, described device also comprises:
Second package module, for in the process of to carry out according to the parameter of described common data structure running when described expansion interface, if described expansion interface produces event, the data structure then adopting described browser kernel to support encapsulates described event, and the event of described encapsulation is submitted to described browser kernel, by described browser kernel, described event is processed.
6. device as claimed in claim 5, it is characterized in that, described parsing module comprises:
First acquiring unit, for obtaining parsing interface corresponding to described browser kernel;
Resolution unit, is encapsulated for being parsed described browser kernel by described parsing interface the data structure that parameter corresponding to described expansion interface adopt, obtains the data structure that described browser kernel is supported;
Decapsulation unit, the parameter corresponding to described expansion interface of the data structure for supporting according to described browser kernel carries out decapsulation, obtains the parameter of common data structure.
7. device as claimed in claim 6, it is characterized in that, described first acquiring unit comprises:
First obtains subelement, for obtaining the type of described browser kernel, determines the mark of corresponding parsing interface according to the type of described browser kernel;
Second obtains subelement, for from the mark of parsing interface stored and the corresponding relation of index, obtains the index that described parsing interface is corresponding;
3rd obtains subelement, obtains described parsing interface for the index corresponding according to described parsing interface from terminal local.
8. device as claimed in claim 5, it is characterized in that, described calling module comprises:
Second acquisition unit, for according to the mark of described expansion interface from the mark of the expansion interface stored and the corresponding relation of index, obtain the index that described expansion interface is corresponding;
Running unit, described expansion interface is obtained from terminal local for the index according to described acquisition, described expansion interface is given by the parameter transmission of corresponding for described expansion interface common data structure, described expansion interface is run according to the parameter of the corresponding common data structure of described expansion interface, obtains operation result.
CN201110441715.7A 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device Active CN103176834B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201110441715.7A CN103176834B (en) 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201110441715.7A CN103176834B (en) 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device

Publications (2)

Publication Number Publication Date
CN103176834A CN103176834A (en) 2013-06-26
CN103176834B true CN103176834B (en) 2016-02-17

Family

ID=48636737

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201110441715.7A Active CN103176834B (en) 2011-12-26 2011-12-26 A kind of method of invoke extensions interface and device

Country Status (1)

Country Link
CN (1) CN103176834B (en)

Families Citing this family (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103955515B (en) * 2014-05-05 2018-03-30 百度在线网络技术(北京)有限公司 The processing method and processing device of double-core browser
CN104281455A (en) * 2014-10-11 2015-01-14 北京金山安全软件有限公司 Interface calling method and device and terminal
CN104881318B (en) * 2015-05-07 2019-06-25 珠海豹趣科技有限公司 A kind of interface call method, device and terminal
CN105389222B (en) * 2015-12-15 2018-12-21 中国科学院声学研究所 A kind of methods, devices and systems of dynamic call native interface
CN106980550A (en) * 2017-03-23 2017-07-25 青岛海信电器股份有限公司 Expansion interface call method and device
CN108334382A (en) * 2018-01-30 2018-07-27 美通云动(北京)科技有限公司 Control method, device, electronic equipment and the computer-readable medium of browser
CN111352360A (en) * 2018-12-24 2020-06-30 深圳市优必选科技有限公司 Robot control method, robot control device, robot, and computer storage medium
CN110008035B (en) * 2018-12-27 2022-11-18 阿里巴巴集团控股有限公司 Data interface extension method, data processing method, device and equipment
CN112925589B (en) * 2019-12-06 2023-10-17 深圳市雅阅科技有限公司 Calling method and device of expansion interface
CN112988410A (en) * 2019-12-17 2021-06-18 腾讯科技(深圳)有限公司 Calling method and device of browser extension interface, terminal and storage medium

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039320A (en) * 2005-12-29 2007-09-19 国际商业机器公司 Method and apparatus for providing an interface between a client application and a web service
CN102075800A (en) * 2011-01-11 2011-05-25 中兴通讯股份有限公司 File play control method and system based on interactive personnel television set top box

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101039320A (en) * 2005-12-29 2007-09-19 国际商业机器公司 Method and apparatus for providing an interface between a client application and a web service
CN102075800A (en) * 2011-01-11 2011-05-25 中兴通讯股份有限公司 File play control method and system based on interactive personnel television set top box

Also Published As

Publication number Publication date
CN103176834A (en) 2013-06-26

Similar Documents

Publication Publication Date Title
CN103176834B (en) A kind of method of invoke extensions interface and device
CN108664239B (en) Cross-technology-stack web front-end development system and method based on micro-service
EP2916243B1 (en) Method, apparatus, server and system for implementing web application
CN109561078B (en) External link url resource calling method and device
CN103873918A (en) Picture processing method, device and terminal
CN105159677A (en) Controlled display method of terminal user interface and controlled display device of terminal user interface
CN110221848A (en) APP method for updating pages, device, electronic equipment and storage medium
CN109284454B (en) Page rendering method, device, computer equipment and storage medium
CN104866512A (en) Method, device and system for extracting webpage content
US20150169600A1 (en) Interface display method and system for home gateway applicable to various display types
CN102323880A (en) Mobile phone application interface development method and terminal based on browser parsing mode
CN102096582A (en) Off-line gadget integration development environment
CN104038510A (en) IOS system transparent agent realization method and system
WO2018133772A1 (en) Method, device, storage medium, and electronic device for obtaining webpage resources
JP2023537767A (en) Image processing method and apparatus, and computer-readable storage medium
CN101702641A (en) Coding method and network server
CN104615670A (en) Method for supporting multiple rendering engines in android browser and browser
CN108885544B (en) Front-end page internationalized processing method, application server and computer-readable storage medium
CN110895481A (en) Rendering method, device and system of desktop application
CN102508887A (en) System and method for resolving digital television interaction service markup language
CN114297549A (en) Component processing method and device
CN101964742B (en) Method, system and device for using network open ability
CN111124924B (en) API deployment method and device, electronic equipment and storage medium
CN102523271B (en) Terminal and communication method and system thereof
CN108874373A (en) Method and device, display terminal and the storage medium of information are inserted into webpage

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
C14 Grant of patent or utility model
GR01 Patent grant