CN102981848A - Webpage main body element processing browser and method - Google Patents

Webpage main body element processing browser and method Download PDF

Info

Publication number
CN102981848A
CN102981848A CN2012104555819A CN201210455581A CN102981848A CN 102981848 A CN102981848 A CN 102981848A CN 2012104555819 A CN2012104555819 A CN 2012104555819A CN 201210455581 A CN201210455581 A CN 201210455581A CN 102981848 A CN102981848 A CN 102981848A
Authority
CN
China
Prior art keywords
main element
dom object
dom
webpage main
browser
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Granted
Application number
CN2012104555819A
Other languages
Chinese (zh)
Other versions
CN102981848B (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.)
Beijing Qihoo Technology Co Ltd
Original Assignee
Beijing Qihoo Technology Co Ltd
Qizhi Software Beijing Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Qihoo Technology Co Ltd, Qizhi Software Beijing Co Ltd filed Critical Beijing Qihoo Technology Co Ltd
Priority to CN201210455581.9A priority Critical patent/CN102981848B/en
Publication of CN102981848A publication Critical patent/CN102981848A/en
Application granted granted Critical
Publication of CN102981848B publication Critical patent/CN102981848B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The invention discloses a webpage main body element processing browser and a method. The method includes that a webpage is loaded and obtained on the browser, and a webpage main body element is analyzed and converted to a document object model (DOM) object. Custom-made processing includes that a DOM object processor of at least one webpage main body element is called and a converted DOM object is set, and the custom-made processing sets the webpage main body element on an existing webpage according to set webpage background picture information. Render processing is conducted on a DOM tree which completes the custom-made processing of the webpage main body element. The custom-made processing that the DOM object processor of at least one webpage main body element is called and the converted DOM object and includes that background information of the webpage main body element is obtained from the converted DOM object, and the background information is set by the user. According to analysis result of the background information, a corresponding DOM object process is called to conduct the custom-made processing on a set DOM object. The webpage main body element processing browser and the method are adopted so as to be capable of conducting the custom-made processing on the webpage main body element according to user demands.

Description

The webpage main element is processed browser and method
Technical field
The present invention relates to the network application field, especially relate to a kind of webpage main element and process browser and a kind of webpage main element disposal route.
Background technology
Along with the fast development of Internet, also present fulminant growth based on application and the information of Internet.Web browser provides a kind of accesses network information for the Internet user and has used the mode of network application, and this mode applicability is strong, and more many users have got used to obtaining various information and using various application by web browser.The network information and application vendor provide with such as the HTML(HTML (Hypertext Markup Language), Hypertext MarkupLanguage) and so on the webpage of the language compilation of form, web browser presents these webpages at the user place, thereby so that the user of web browser can obtain relevant information.Along with the fast development of network technology, the content that is presented by web browser is also more and more abundanter, thus web browser present function also from strength to strength with important.Common web browser has Internet Explorer, the Mozilla Firefox of Microsoft, Chrome, the Opera of Google and Safari of Apple etc. at present.
In correlation technique, web browser utilizes render engine (Rendering Engine) to explain the content (such as HTML, JavaScript) in the webpage and plays up (demonstration) webpage.Render engine has determined the browser how content of display web page and the format information of the page.Different render engines also has difference to the explanation of program grammer, and therefore same webpage playing up in the browser of different render engines (demonstration) effect also may be different.
At present the render engine of web browser is played up by converting each element among the HTML and js code to the DOM model.When changing, whole html document is fabricated dom tree, and each element among the HTML is converted into the object in the dom tree, and the relation that the relation between the object is constructed between node and the child node is constructed, by using the method for relevant object, can carry out addressing and operation to these objects.The DOM model has had a lot of public standard and definition.
When web browser was processed html page, the render engine in the browser was analyzed the html page language, and it is treated to the DOM model, utilizes subsequently the DOM model to be configured to the inner structure of display page in browser.DOM API also provides the interface of monitoring or modification webpage to the js code.
Render engine has been introduced based on the mechanism of event and has been processed the DOM object.Each DOM object has a plurality of events that are associated, and these events can be triggered.For example, the JS code in the render engine analyzing web page, and corresponding JS code and event be associated, thus make when obtaining particular event and being triggered, carry out corresponding JS code.
Yet in present web browser, render engine is mostly just controlled corresponding DOM object according to the JS code in the html web page, therefore, is difficult to the DOM object when user uses browser, and namely each element in the webpage customizes and plays up.
In summary, present web browser usually presents web page contents according to the desired mode of network application and Information Provider, and does not take into full account the user to the preference of page presentation mode when presenting webpage.Therefore although existing web browser has different render engines, to present effect basic identical when it.
Particularly for web page background, in the prior art, web page background etc. can arrange in the main body of webpage (<body 〉) unit.At present internet content provider utilizes the body element that the essential information of some webpages is set, but the user when browsing pages, as computed desktop, hope can arrange the page layout background of oneself.But in the existing browser, web page background can't be according to user's demand setting, and the user is the background content that presents of personalized customization web browser fully, reduces user's impression and experiences.
Summary of the invention
In view of the above problems, the present invention has been proposed in order to provide a kind of webpage main element that overcomes the problems referred to above or address the above problem at least in part to process browser and corresponding webpage main element disposal route.
According to one aspect of the present invention, provide a kind of webpage main element to process browser, this browser side is provided with the web page background pictorial information, and this browser comprises:
The DOM object handles module of at least one webpage main element, wherein each DOM object handles block configuration is the customized treatment that stores the webpage main element;
Page parsing module is configured to obtain the page in described browser side loading, and the webpage main element in the page is resolved, and this webpage main element is converted to the DOM object;
The DOM processing module, be configured to call the DOM object handles module of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment, arrange according to the web page background pictorial information of the described setting webpage main element to current page in this customized treatment, and the background information that also is configured to from the DOM object of described conversion, to obtain the webpage main element that the user arranges; The analysis result of the background information that arranges according to described user calls corresponding DOM object handles module is carried out described setting to the DOM object of described conversion customized treatment;
Play up processing module, be configured to the dom tree of finishing webpage main element customized treatment is played up processing.
Alternatively, described background information comprises the background image tabulation.
Alternatively, part DOM object handles module is configured to store at least piece image in the described background image tabulation;
At this moment, described DOM processing module also is configured to call this part DOM object handles module the background image of the page is changed.
Alternatively, the order of described DOM processing module change background image comprise following one of arbitrarily:
According to described background image tab sequential change;
According to the change of described background image tabulation backward;
According to described background image tabulation circulation change;
According to described background image tabulation random order change.
Alternatively, above-mentioned browser also comprises acquisition module, is configured to obtain from the browser side script process of image change order; At this moment,
Described DOM processing module also is configured to according to described script process, calls the background image of described webpage main element according to the order respective change of background image tabulation.
Alternatively, above-mentioned browser also comprises:
Enquiry module is configured to whether have the DOM object handles module that described webpage main element is processed in the described browser of inquiry from the object handles registration table, wherein, and described at least one DOM object handles module of registration in the described object handles registration table.
Alternatively, described DOM processing module also is configured to when described webpage main element loads the ContentReady event that triggers when finishing, and calls the DOM object handles module of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
Alternatively, described DOM processing module also is configured to when web page files loads the DocumentReady event that triggers when finishing, and calls the DOM object handles module of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
Alternatively, when described browser was the IE browser, described webpage main element was stored in the body element.
According to another aspect of the present invention, a kind of webpage main element disposal route is provided, in browser, be provided with the web page background pictorial information, and the DOM object handler of at least one webpage main element is set in the browser side, wherein each DOM object handler is configured to store the customized treatment to the webpage main element, comprising:
Obtain the page in described browser side loading, and the webpage main element in the page is resolved, this webpage main element is converted to the DOM object;
Call the customized treatment that the DOM object handler of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion, arrange according to the web page background pictorial information of the described setting webpage main element to current page in this customized treatment;
The dom tree of finishing webpage main element customized treatment is played up processing;
Wherein, the DOM object handler of described at least one the webpage main element that calls described setting comprises the customized treatment that the DOM object of described conversion carries out described setting:
From the DOM object of described conversion, obtain the background information of the webpage main element of user's setting;
The analysis result of the background information that arranges according to described user calls corresponding DOM object handler is carried out described setting to the DOM object of described conversion customized treatment.
Alternatively, described background information comprises the background image tabulation.
Alternatively, when at least piece image in the described background image tabulation of storage in the part DOM object handler,
Call the DOM object handler of at least one webpage main element of described setting to the customized treatment that the DOM object of described conversion carries out described setting, comprising: call this part DOM object handler the background image of the page is changed.
Alternatively, the change of described background image sequentially comprise following one of arbitrarily:
According to described background image tab sequential change;
According to the change of described background image tabulation backward;
According to described background image tabulation circulation change;
According to described background image tabulation random order change.
Alternatively, said method also comprises:
Obtain the script process of image change order from the browser side;
According to described script process, call the background image of described webpage main element according to the order respective change of background image tabulation.
Alternatively, the DOM object handler of calling at least one webpage main element of described setting carries out comprising before the customized treatment of described setting to the DOM object of described conversion:
From the object handles registration table, whether there is the DOM object handler that described webpage main element is processed in the described browser of inquiry, wherein, described at least one DOM object handler of registration in the described object handles registration table.
Alternatively, when described webpage main element loads the ContentReady event that triggers when finishing, call the DOM object handler of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
Alternatively, when web page files loads the DocumentReady event that triggers when finishing, call the DOM object handler of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
Alternatively, when described browser is the IE browser, the client at described browser place arranges first interface IElementBehaviorFactory, the second interface IElementBehavior, the 3rd interface IDocHostUIHandler and the 4th interface IElementBehaviorSite at the WebBrowser plug-in unit, wherein, described first interface and described the second interface are used for calling each DOM object handler, described the 3rd interface is used for each DOM object handler is registered to described object handles registration table, and described the 4th interface is related with client;
Call the DOM object handler of at least one webpage main element of described setting, comprising:
Core engine is called the behavior querying method by first interface, and the query user holds the second interface about M_BODY, and described the 4th interface associated is provided, and receives the object instance that client is returned;
Described core engine is called element behavior Notification Method when the Web page loading main element, the stress state of notice customer terminal webpage element.
In embodiments of the present invention, each the DOM object that parses for the webpage main element, at network side the DOM object handles module of it being carried out customized treatment is set, in the acquisition process of the page, the customized treatment that the DOM object handles module that utilization is called arranges the DOM object.Because at least one DOM object handles module can store at least a customized treatment mode, therefore, can carry out at least a processing to the webpage main element, and then can adjust that different elements present different conditions in the webpage main element.This shows, the browser that the webpage main element is processed that adopts that the embodiment of the invention provides can be processed respectively the different DOM objects in the webpage main element, and the webpage main element that presents thus can realize that personalized customization processes, for example, different background images is set.Guaranteed that the webpage main element is not is according to the desired fixed form of network application and Information Provider, and then realized the purpose that the user can carry out personalized customization to content that the webpage main element presents, satisfy different users' preference, improve user's impression and experience.
Above-mentioned explanation only is the general introduction of technical solution of the present invention, for can clearer understanding technological means of the present invention, and can be implemented according to the content of instructions, and for above and other objects of the present invention, feature and advantage can be become apparent, below especially exemplified by the specific embodiment of the present invention.
Description of drawings
By reading hereinafter detailed description of the preferred embodiment, various other advantage and benefits will become cheer and bright for those of ordinary skills.Accompanying drawing only is used for the purpose of preferred implementation is shown, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts with identical reference symbol.In the accompanying drawings:
Fig. 1 shows the according to an embodiment of the invention structural representation of webpage main element processing browser;
Fig. 2 shows the according to an embodiment of the invention process flow diagram of webpage main element disposal route; And
Fig. 3 shows the according to an embodiment of the invention structural representation of webpage main element processing browser.
Embodiment
Exemplary embodiment of the present disclosure is described below with reference to accompanying drawings in more detail.Although shown exemplary embodiment of the present disclosure in the accompanying drawing, yet should be appreciated that and to realize the disclosure and the embodiment that should do not set forth limits here with various forms.On the contrary, it is in order to understand the disclosure more thoroughly that these embodiment are provided, and can with the scope of the present disclosure complete convey to those skilled in the art.
For solving the technical matters of mentioning in the background technology of the present invention, the embodiment of the invention provides a kind of browser that the webpage main element is processed, and this browser side is provided with the web page background pictorial information.Fig. 1 shows the structural representation that webpage main element according to an embodiment of the invention is processed browser.This browser comprises DOM object handles module 110, page parsing module 120, the DOM processing module 130 of at least one Password Input frame element and plays up processing module 140.The function of each module that now browser is comprised is elaborated.
The DOM object handles module of at least one webpage main element of paper.The quantity of DOM object handles module is at least one, and sets in advance in the browser side, stores the customized treatment to the webpage main element in each DOM object handles module.The quantity of DOM object handles module can be 1, also can be 2, also can be 3,4,5 or more, and concrete quantity determines according to the quantity of specific DOM object and the quantity of customized treatment.Among Fig. 1 in order to illustrate that it is set to 3.
Secondly, introduce page parsing module 120.When a page that obtains was processed, page parsing module 120 loaded in the browser side and obtains the page.Consider that the page and page elements can not directly process, therefore, page parsing module 120 need to be resolved the webpage main element in the page, and this webpage main element is converted to the DOM object, processes for follow-up DOM module 130.
Then, introduce DOM processor 130.Referring to Fig. 1, DOM processing module 130 1 ends are couple to page parsing module 120, and the other end is couple to the DOM object handles module 110 of at least one the password box element that pre-sets in the browser side.After parsing and conversion operations end to the webpage main element, DOM processing module 130 can be called the customized treatment that the DOM object of 110 pairs of conversions of DOM object handles module of at least one webpage main element of setting arranges, and arranges according to the webpage main element of the web page background pictorial information that arranges to current page in this customized treatment.
At last, processing module 140 is played up in introduction.Referring to Fig. 1, play up processing module 140 and be couple to DOM processing module 130.Behind the customized treatment EO of DOM processing module 130, treated DOM object can form dom tree, then plays up processing by the dom tree of playing up 140 pairs of processing modules and finish webpage main element customized treatment.
In embodiments of the present invention, each the DOM object that parses for the webpage main element, at network side the DOM object handles module of it being carried out customized treatment is set, in the acquisition process of the page, the customized treatment that the DOM object handles module that utilization is called arranges the DOM object.Because at least one DOM object handles module can store at least a customized treatment mode, therefore, can carry out at least a processing to the webpage main element, and then can adjust that different elements present different conditions in the webpage main element.This shows, the browser that the webpage main element is processed that adopts that the embodiment of the invention provides can be processed respectively the different DOM objects in the webpage main element, and the webpage main element that presents thus can realize that personalized customization processes, for example, different background images is set.Guaranteed that the webpage main element is not is according to the desired fixed form of network application and Information Provider, and then realized the purpose that the user can carry out personalized customization to content that the webpage main element presents, satisfy different users' preference, improve user's impression and experience.
For reaching the purpose of selecting different background informations according to user's demand, DOM processing module 130 can be obtained the background information of the webpage main element of user's setting from the DOM object of conversion.Then, the analysis result of the background information that arranges according to the user, DOM processing module 130 is called the customized treatment that corresponding DOM object handles module arranges the DOM object of conversion.
The background information of mentioning in the present embodiment comprises polytype, for example, can comprise the background image tabulation, can also comprise the background music tabulation, can also comprise the background video tabulation, etc.Describe as an example of the background image tabulation example herein.Background image tabulation is comprised of multiple image, and each width of cloth image has been carried out coding and corresponding ordering, just its demonstration and call more convenient.
When background information is the background image tabulation, at least piece image in the part DOM object handles module 110 in the tabulation of storage background image.Accordingly, at this moment, DOM processing module 130 also is configured to call the background image of 110 pairs of pages of this part DOM object handles module and changes.Because the different background image of storage in the different DOM object handles modules 110, when then calling different DOM object handles modules, the background image of generation is also different, therefore, can realize revising according to user's demand the purpose of background.
Mention that above DOM processing module 130 realizes the change of background image by calling different DOM object handles module 110.So, need to prove, the order of DOM processing module 130 change background images can be followed certain order, for example, can change according to the background image tab sequential, also can be according to tabulate backward change of background image, can also be according to background image tabulation circulation change, and according to background image tabulation random order change.Concrete change order is specified by the user.Multiple changing mode has also further shown the setting of background image in the embodiment of the invention.
The order of image change can be in advance be arranged on the browser side with the form of script process.For obtaining this script process, referring to Fig. 1, acquisition module 150 is set also in the browser, utilize this acquisition module 150 to obtain the script process of image change order from the browser side.At this moment, DOM processing module 130 obtains the order of image change according to the script process that acquisition module 150 obtains, and then the background image of invoking web page main element is according to the order respective change of background image tabulation.
Wherein, call operation for DOM object handles module 110, DOM processing module 130 need to be known the address of each DOM object handles module 110, and then call accordingly, if in the situation that DOM object handles module is more and memory address is disperseed relatively, will there be certain difficulty in calling of DOM processing module 130.A kind of preferred method of calling now is provided, in this example, the object handles registration table is set, the register information of all DOM object handles module of registration in this form, register information herein can comprise memory address, each DOM object handles module of each DOM object handles module customization operations, whether be called etc.Accordingly, referring to Fig. 1, the browser that page password box is processed that the embodiment of the invention provides also comprises enquiry module 160.Whether this enquiry module 160 and 130 couplings of DOM processing module exist the DOM object handles module that the web page element element is processed in the Query Browser from the object handles registration table.Behind the poll-final, enquiry module 160 is notified DOM processing module 130 with Query Result, and DOM processing module 130 can be called corresponding DOM object handles module 110 according to Query Result.
For each DOM object, all have at least two events, one is that this DOM object has loaded the event ContentReady that triggers when finishing, another is that whole HTML has loaded the event DocumentReady that triggers when finishing.Because the embodiment of the invention relates to the webpage main element is processed, therefore only relate to this DOM object and loaded the event ContentReady that triggers when finishing, DOM processing module 130 can be called the customized treatment that the DOM object of 110 pairs of conversions of DOM object handles module of at least one webpage main element of setting arranges.Further, can also be when web page files load the DocumentReady event that triggers when finishing at least one DOM processing module 130 that the embodiment of the invention provides, call the customized treatment that the DOM object of 110 pairs of conversions of DOM object handles module of at least one webpage main element of setting arranges.
Preferably, when browser was the IE browser, the webpage main element can be stored in the body element.
The each several part framework of the above-mentioned browser that the page text frame is processed provides according to its function, and actual framework is not limited in each part mentioned above, can also comprise other parts, module, device etc.
Fig. 2 shows the according to an embodiment of the invention processing flow chart of webpage main element disposal route.In this example, be provided with the web page background pictorial information in browser, and in the browser side DOM object handler of at least one webpage main element be set, wherein each DOM object handler is configured to store the customized treatment to the webpage main element.The method comprising the steps of S202 is to step S206.
Step S202, load in the browser side and to obtain the page, and the webpage main element in the page is resolved, this webpage main element is converted to the DOM object.
Step S204, call setting the DOM object handler of at least one webpage main element to the customized treatment that arranges of DOM object of conversion, arrange according to the webpage main element of the web page background pictorial information that arranges to current page in this customized treatment.
Step S206, the dom tree of finishing webpage main element customized treatment is played up processing.
In embodiments of the present invention, each the DOM object that parses for the webpage main element, at network side the DOM object handler of it being carried out customized treatment is set, in the acquisition process of the page, the customized treatment that the DOM object handler that utilization is called arranges the DOM object.Because at least one DOM object handler can store at least a customized treatment mode, therefore, can carry out at least a processing to the webpage main element, and then can adjust that different elements present different conditions in the webpage main element.This shows, the method that the webpage main element is processed that adopts that the embodiment of the invention provides can be processed respectively the different DOM objects in the webpage main element, and the webpage main element that presents thus can realize that personalized customization processes, for example, different background images is set.Guaranteed that the webpage main element is not is according to the desired fixed form of network application and Information Provider, and then realized the purpose that the user can carry out personalized customization to content that the webpage main element presents, satisfy different users' preference, improve user's impression and experience.
Need to prove that the function of the DOM object handler in this flow process and DOM object handles module mentioned above is similar, because preamble relates to the framework of browser, so be referred to as DOM object handles module.And only relate to parts of DOM object handler in this flow process, and therefore, it need not be referred to as module, hereinafter repeat no more.
Referring to Fig. 2, step S204 mentions the customized treatment that the DOM object handler of at least one the webpage main element that calls setting arranges the DOM object of changing when implementing.Preferably, can from the DOM object of conversion, obtain the background information of the webpage main element of user's setting.And then the analysis result of the background information that arranges according to the user calls the customized treatment that corresponding DOM object handler arranges the DOM object of conversion.
Wherein, the background information of mentioning in the present embodiment comprises polytype, for example, can comprise the background image tabulation, can also comprise the background music tabulation, can also comprise the background video tabulation, etc.Describe as an example of the background image tabulation example herein.Background image tabulation is comprised of multiple image, and each width of cloth image has been carried out coding and corresponding ordering, just its demonstration and call more convenient.
When background information is the background image tabulation, can in part DOM object handler, store at least piece image in the background image tabulation.Accordingly, call the DOM object handler of at least one webpage main element of setting to the customized treatment that arranges of DOM object of conversion, comprising: can call this part DOM object handler the background image of the page is changed.
Above mention, can realize by calling different DOM object handler the change of background image.So, need to prove, the order of change background image can be followed certain order, for example, can change according to the background image tab sequential, also can be according to tabulate backward change of background image, can also be according to background image tabulation circulation change, and according to background image tabulation random order change.Concrete change order is specified by the user.Multiple changing mode has also further shown the setting of background image in the embodiment of the invention.
The order of image change can be in advance be arranged on the browser side with the form of script process.Obtain the script process of image change order from the browser side.Then according to the script process of obtaining, obtain the order of image change, and then the background image of invoking web page main element is according to the order respective change of background image tabulation.
Wherein, for the call operation of DOM object handler, need to know the address of each DOM object handler, and then call accordingly, if in the situation that the DOM object handler is more and memory address is disperseed relatively, it calls and will have certain difficulty.A kind of preferred method of calling now is provided, in this example, the object handles registration table is set, the register information of all DOM object handler of registration in this form, register information herein can comprise memory address, each DOM object handler of each DOM object handler customization operations, whether be called etc.Accordingly, referring to Fig. 1, whether the browser that the webpage main element is processed that the embodiment of the invention provides exists the DOM object handler that the webpage main element is processed in the Query Browser from the object handles registration table.Behind the poll-final, can call corresponding DOM object handler according to Query Result.
For each DOM object, all have at least two events, one is that this DOM object has loaded the event ContentReady that triggers when finishing, another is that whole HTML has loaded the event DocumentReady that triggers when finishing.Because the embodiment of the invention relates to the webpage main element is processed, therefore only relate to this DOM object and loaded the event ContentReady that triggers when finishing, can call the customized treatment that the DOM object handler of at least one webpage main element of setting arranges the DOM object of conversion.Further, the embodiment of the invention can also be when web page files loads the DocumentReady event that triggers when finishing, and calls the customized treatment that the DOM object handler of at least one webpage main element of setting arranges the DOM object of conversion.
Embodiment one
The browser that is mentioned in the embodiment of the invention can be for multiple, and for example the Internet Explorer(of Microsoft is called for short IE), Mozilla Firefox, Chrome, the Opera of Google and Safari of Apple etc.
The concrete disposal route of the text box element that now as an example of the IE browser example the embodiment of the invention is provided is at length set forth and is illustrated.
For the particular procedure for each web page element, may need to realize
The behavior of IElementBehavior(element)
Implementing the IElementBehavior Interface(carries out the element behavior interface)
Implementing the Notify Method(carries out Notification Method)
Implementing the Init Method (execution initial method)
Implementing the Detach Method(carries out separation method)
The behavior of IElementBehaviorFactory(element behavior factory)
IElementNamespaceFactory(element NameSpace factor interface)
IElementNamespaceFactoryCallback(element NameSpace callback interface)
After initialization arranges, the client WebBrowser(web browser in the IE browser) plug-in unit realizes that the concrete treatment step of web page element is as follows:
Step 1, client WebBrowser plug-in unit are realized the IElementBehaviorFactory interface.
Step 2, client WebBrowser plug-in unit are realized the IDocHostUIHandler interface.
Annotate: the WebBrowser plug-in unit here is exactly in the embodiment of par-ticular processor in IE for specific DOM object, realize that the IDocHostUIHandler interface is used for par-ticular processor is registered to object registry by the DOM processor adopting, realize that IElementBehaviorFactory and IElementBehavior interface are used for illustrating that concrete customized treatment realizes.
When step 3, page creation, MSHTML can call the GetHostInfo method of IDocHostUIHandler, and client-side program provides page elements TAG and corresponding Behavior Name to MSHTML.
Annotate: MSHTML is corresponding to core engine, and this step is inquired about all DOM object handler tabulations corresponding to the DOM processor.
When step 4, the page load, MSHTML can according to more than the Behavior Name that provide, call one by one the FindBehavior method of IElementBehaviorFactory, provide IElementBehavior Interface realization about M_BODY by client.
Herein, preferred, and the corresponding interface IElementBehaviorSite that provides with the page is related, to determine whether the customization behavior.
Step 5, MSHTML are when loading the BODY element, and invoking web page main element behavior Notification Method to page insertion objects (OBJECT) element, is play MP3 or FLASH.
Annotate: webpage subject behavior Notification Method is realized utilizing the CBodyIElementBehavior::Notify method in IE.
Wherein, can create timer, the carousel Background.
Wherein, it should be noted that step 4 and step 5 call corresponding DOM object handler corresponding to the DOM processing module DOM object is processed.
The method of present embodiment is not only for the IE browser, and for other browsers, its implementation is similar.
Embodiment two
Present embodiment provides the concrete grammar that the webpage main element is processed.
Before the page loads, obtain the background information that the user arranges, comprise background image tabulation, background music tabulation etc.
Further, when load page, the background (background) of obtaining in the body element arranges, and it is revised as first figure in the display background image list.
Then, in the body element, background music is set.
At last, the js code is set, so that the background image of body element changes according to list content.
Embodiment three
Above-described is directly the webpage main element to be processed, as everyone knows, the page elements of browser has multiple, and browser need to all be changed and process each page elements, then the page elements after will processing is played up, and just generates the webpage that presents.
Fig. 3 shows the according to an embodiment of the invention structural representation of page main element processing browser.Referring to Fig. 3, this browser comprises at least one DOM object handler 310, page resolver 320 and the DOM processor 330 that is arranged on the browser side.
Wherein, DOM object handler 310 comprises at least one, and sets in advance in the browser side, stores the customized treatment of specific DOM object in each DOM object handler 310.The quantity of DOM object handler can be 1, also can be 2, also can be 3,4,5 or more, and concrete quantity determines according to the quantity of specific DOM object and the quantity of customized treatment.Among Fig. 3 in order to illustrate that it is set to 3.
When a page that obtains was processed, page resolver 320 loaded this in the browser side and obtains the page, and the page elements that obtains the page is resolved.Consider that the page and page elements can not directly process, therefore, page resolver 320 is converted to the DOM object with each page elements in resolving, processes for follow-up DOM processor 330.
Referring to Fig. 3, DOM processor 330 is couple to page resolver 320 and at least one DOM object handler 310.After page resolver 320 is resolved end, start DOM processor 330.DOM processor 330 selects at least one as DOM object that current preparation is processed in the DOM object of conversion, calls at least one DOM object handler 310 of setting, the customized treatment that the DOM object of selecting is arranged.
Referring to Fig. 3, this browser also comprises tree maker 330, is couple to DOM processor 330.After DOM processor 330 called DOM object handler 310, and the DOM object is carried out the customized treatment end, tree maker 330 utilized the final dom tree of DOM object generation through the customized treatment that arranges, and dom tree is played up.
And the webpage main element is a kind of of page elements, therefore, when page elements is the webpage main element, utilizing browser to carry out the device that page elements processes can directly process the webpage main element, and the customized treatment mode of the DOM object handler storage of its selection is that the customized treatment for the webpage main element gets final product.That is to say that in this example, referring to Fig. 3, the DOM object handler 310 of its selection should be the DOM object handler 310 of webpage main element.The function of other each parts remains unchanged.
In this example, page resolver 320 is similar with the function of page parsing module 120 the preceding embodiment, all is that corresponding element is converted to the DOM object.And DOM processor 330 is similar with the function of DOM processing module 130 the preceding embodiment, calls corresponding DOM object handles module (or DOM object handler), and current DOM object is carried out respective handling.
Adopt browser provided by the invention and corresponding disposal route, can reach following beneficial effect:
In embodiments of the present invention, each the DOM object that parses for the webpage main element, at network side the DOM object handles module of it being carried out customized treatment is set, in the acquisition process of the page, the customized treatment that the DOM object handles module that utilization is called arranges the DOM object.Because at least one DOM object handles module can store at least a customized treatment mode, therefore, can carry out at least a processing to the webpage main element, and then can adjust that different elements present different conditions in the webpage main element.This shows, the browser that the webpage main element is processed that adopts that the embodiment of the invention provides can be processed respectively the different DOM objects in the webpage main element, and the webpage main element that presents thus can realize that personalized customization processes, for example, different background images is set.Guaranteed that the webpage main element is not is according to the desired fixed form of network application and Information Provider, and then realized the purpose that the user can carry out personalized customization to content that the webpage main element presents, satisfy different users' preference, improve user's impression and experience.
Intrinsic not relevant with any certain computer, virtual system or miscellaneous equipment with demonstration at this algorithm that provides.Various general-purpose systems also can be with using based on the teaching at this.According to top description, it is apparent constructing the desired structure of this type systematic.In addition, the present invention is not also for any certain programmed language.Should be understood that and to utilize various programming languages to realize content of the present invention described here, and the top description that language-specific is done is in order to disclose preferred forms of the present invention.
In the instructions that provides herein, a large amount of details have been described.Yet, can understand, embodiments of the invention can be put into practice in the situation of these details not having.In some instances, be not shown specifically known method, structure and technology, so that not fuzzy understanding of this description.
Similarly, be to be understood that, in order to simplify the disclosure and to help to understand one or more in each inventive aspect, in the description to exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or the description to it sometimes in the above.Yet the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires the more feature of feature clearly put down in writing than institute in each claim.Or rather, as following claims reflected, inventive aspect was to be less than all features of the disclosed single embodiment in front.Therefore, follow claims of embodiment and incorporate clearly thus this embodiment into, wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and can adaptively change and they are arranged in one or more equipment different from this embodiment the module in the equipment among the embodiment.Can be combined into a module or unit or assembly to the module among the embodiment or unit or assembly, and can be divided into a plurality of submodules or subelement or sub-component to them in addition.In such feature and/or process or unit at least some are mutually repelling, and can adopt any combination to disclosed all features in this instructions (comprising claim, summary and the accompanying drawing followed) and so all processes or the unit of disclosed any method or equipment make up.Unless in addition clearly statement, disclosed each feature can be by providing identical, being equal to or the alternative features of similar purpose replaces in this instructions (comprising claim, summary and the accompanying drawing followed).
In addition, those skilled in the art can understand, although embodiment more described herein comprise some feature rather than further feature included among other embodiment, the combination of the feature of different embodiment means and is within the scope of the present invention and forms different embodiment.For example, in the following claims, the one of any of embodiment required for protection can be used with array mode arbitrarily.
All parts embodiment of the present invention can realize with hardware, perhaps realizes with the software module of moving at one or more processor, and perhaps the combination with them realizes.It will be understood by those of skill in the art that and to use in practice microprocessor or digital signal processor (DSP) to realize processing some or all some or repertoire of parts in the browser according to the page main element of the embodiment of the invention.The present invention can also be embodied as be used to part or all equipment or the device program (for example, computer program and computer program) of carrying out method as described herein.Such realization program of the present invention can be stored on the computer-readable medium, perhaps can have the form of one or more signal.Such signal can be downloaded from internet website and obtain, and perhaps provides at carrier signal, perhaps provides with any other form.
It should be noted above-described embodiment the present invention will be described rather than limit the invention, and those skilled in the art can design alternative embodiment in the situation of the scope that does not break away from claims.In the claims, any reference symbol between bracket should be configured to limitations on claims.Word " comprises " not to be got rid of existence and is not listed in element or step in the claim.Being positioned at word " " before the element or " one " does not get rid of and has a plurality of such elements.The present invention can realize by means of the hardware that includes some different elements and by means of the computing machine of suitably programming.In having enumerated the unit claim of some devices, several in these devices can be to come imbody by same hardware branch.The use of word first, second and C grade does not represent any order.Can be title with these word explanations.

Claims (18)

1. a webpage main element is processed browser, and this browser side is provided with the web page background pictorial information, and this browser comprises:
The DOM object handles module of at least one webpage main element, wherein each DOM object handler is configured to store the customized treatment to the webpage main element;
Page parsing module is configured to obtain the page in described browser side loading, and the webpage main element in the page is resolved, and this webpage main element is converted to the DOM object;
The DOM processing module, be configured to call the DOM object handles module of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment, arrange according to the web page background pictorial information of the described setting webpage main element to current page in this customized treatment, and the background information that also is configured to from the DOM object of described conversion, to obtain the webpage main element that the user arranges; The analysis result of the background information that arranges according to described user calls corresponding DOM object handles module is carried out described setting to the DOM object of described conversion customized treatment;
Play up processing module, be configured to the dom tree of finishing webpage main element customized treatment is played up processing.
2. browser according to claim 1 is characterized in that, described background information comprises the background image tabulation.
3. browser according to claim 2 is characterized in that, part DOM object handles module is configured to store at least piece image in the described background image tabulation;
At this moment, described DOM processing module also is configured to call this part DOM object handles module the background image of the page is changed.
4. browser according to claim 3 is characterized in that, the order of described DOM processing module change background image comprise following one of arbitrarily:
According to described background image tab sequential change;
According to the change of described background image tabulation backward;
According to described background image tabulation circulation change;
According to described background image tabulation random order change.
5. according to claim 1 to 4 each described browsers, it is characterized in that, also comprise acquisition module, be configured to obtain from the browser side script process of image change order; Then,
Described DOM processing module also is configured to according to described script process, calls the background image of described webpage main element according to the order respective change of background image tabulation.
6. according to claim 1 to 5 each described browsers, it is characterized in that, also comprise:
Enquiry module is configured to whether have the DOM object handles module that described webpage main element is processed in the described browser of inquiry from the object handles registration table, wherein, and described at least one DOM object handles module of registration in the described object handles registration table.
7. according to claim 1 to 6 each described browsers, it is characterized in that, described DOM processing module also is configured to when described webpage main element loads the ContentReady event that triggers when finishing, and calls the DOM object handles module of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
8. according to claim 1 to 7 each described browsers, it is characterized in that, described DOM processing module also is configured to when web page files loads the DocumentReady event that triggers when finishing, and calls the DOM object handles module of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
9. according to claim 1 to 8 each described browsers, it is characterized in that when described browser was I E browser, described webpage main element was stored in the body element.
10. webpage main element disposal route, in browser, be provided with the web page background pictorial information, and in the browser side DOM object handler of at least one webpage main element is set, wherein each DOM object handler is configured to store the customized treatment to the webpage main element, comprising:
Obtain the page in described browser side loading, and the webpage main element in the page is resolved, this webpage main element is converted to the DOM object;
Call the customized treatment that the DOM object handler of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion, arrange according to the web page background pictorial information of the described setting webpage main element to current page in this customized treatment;
The dom tree of finishing webpage main element customized treatment is played up processing;
Wherein, the DOM object handler of described at least one the webpage main element that calls described setting comprises the customized treatment that the DOM object of described conversion carries out described setting:
From the DOM object of described conversion, obtain the background information of the webpage main element of user's setting;
The analysis result of the background information that arranges according to described user calls corresponding DOM object handler is carried out described setting to the DOM object of described conversion customized treatment.
11. method according to claim 10 is characterized in that, described background information comprises the background image tabulation.
12. method according to claim 11 is characterized in that, when at least piece image in the described background image tabulation of storage in the part DOM object handler,
Call the DOM object handler of at least one webpage main element of described setting to the customized treatment that the DOM object of described conversion carries out described setting, comprising: call this part DOM object handler the background image of the page is changed.
13. method according to claim 12 is characterized in that, the change of described background image sequentially comprise following one of arbitrarily:
According to described background image tab sequential change;
According to the change of described background image tabulation backward;
According to described background image tabulation circulation change;
According to described background image tabulation random order change.
14. to 13 each described methods, it is characterized in that according to claim 10, also comprise:
Obtain the script process of image change order from the browser side;
According to described script process, call the background image of described webpage main element according to the order respective change of background image tabulation.
15. to 14 each described methods, it is characterized in that according to claim 10, call the DOM object handler of at least one webpage main element of described setting the DOM object of described conversion is carried out comprising before the customized treatment of described setting:
From the object handles registration table, whether there is the DOM object handler that described webpage main element is processed in the described browser of inquiry, wherein, described at least one DOM object handler of registration in the described object handles registration table.
16. according to claim 10 to 15 each described methods, it is characterized in that, when described webpage main element loads the ContentReady event that triggers when finishing, call the DOM object handler of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
17. according to claim 10 to 16 each described methods, it is characterized in that, when web page files loads the DocumentReady event that triggers when finishing, call the DOM object handler of at least one webpage main element of described setting is carried out described setting to the DOM object of described conversion customized treatment.
18. according to claim 10 to 17 each described methods, it is characterized in that, when described browser is the IE browser, the client at described browser place arranges first interface IElementBehaviorFactory at the WebBrowser plug-in unit, the second interface IElementBehavior, the 3rd interface IDocHostUIHandler and the 4th interface IElementBehaviorSite, wherein, described first interface and described the second interface are used for calling each DOM object handler, described the 3rd interface is used for each DOM object handler is registered to described object handles registration table, and described the 4th interface is related with client;
Call the DOM object handler of at least one webpage main element of described setting, comprising:
Core engine is called the behavior querying method by first interface, and the query user holds the second interface about M_BODY, and described the 4th interface associated is provided, and receives the object instance that client is returned;
Described core engine is called element behavior Notification Method when the Web page loading main element, the stress state of notice customer terminal webpage element.
CN201210455581.9A 2012-11-13 2012-11-13 Webpage main body element process browser and method Active CN102981848B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210455581.9A CN102981848B (en) 2012-11-13 2012-11-13 Webpage main body element process browser and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210455581.9A CN102981848B (en) 2012-11-13 2012-11-13 Webpage main body element process browser and method

Publications (2)

Publication Number Publication Date
CN102981848A true CN102981848A (en) 2013-03-20
CN102981848B CN102981848B (en) 2015-12-09

Family

ID=47855913

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210455581.9A Active CN102981848B (en) 2012-11-13 2012-11-13 Webpage main body element process browser and method

Country Status (1)

Country Link
CN (1) CN102981848B (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981844A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Browser treating webpage main body element and method treating the webpage main body element
WO2014075509A1 (en) * 2012-11-13 2014-05-22 北京奇虎科技有限公司 Method and device for browser to process page element
CN104021158A (en) * 2014-05-23 2014-09-03 北京金山网络科技有限公司 Method and device for adjusting webpage elements in webpage and mobile terminal
JP2017538991A (en) * 2014-10-30 2017-12-28 アリババ・グループ・ホールディング・リミテッドAlibaba Group Holding Limited Page processing for mobile apps
CN108153762A (en) * 2016-12-05 2018-06-12 天脉聚源(北京)科技有限公司 A kind of method and system of content of pages switching display
CN109740082A (en) * 2014-11-19 2019-05-10 北京奇虎科技有限公司 Webpage loading method and device
CN112016014A (en) * 2020-08-18 2020-12-01 北京达佳互联信息技术有限公司 Webpage display method, webpage resource generation method, webpage display device, webpage resource generation device, electronic equipment and medium
CN117111803A (en) * 2023-10-20 2023-11-24 荣耀终端有限公司 Background image display method and electronic equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6981211B1 (en) * 1999-09-30 2005-12-27 International Business Machines Corporation Method for processing a document object model (DOM) tree using a tagbean
CN1987854A (en) * 2005-12-20 2007-06-27 北京亿中邮信息技术有限公司 Method for personalized replacing webpage subject
US20120066585A1 (en) * 2010-09-13 2012-03-15 International Business Machines Corporation Widget behavior customization via cascaded style sheets
CN102662672A (en) * 2012-04-05 2012-09-12 广州市动景计算机科技有限公司 Method and device for conducting skin changing process to webpages as well as mobile terminal
CN102981844A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Browser treating webpage main body element and method treating the webpage main body element

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US6981211B1 (en) * 1999-09-30 2005-12-27 International Business Machines Corporation Method for processing a document object model (DOM) tree using a tagbean
CN1987854A (en) * 2005-12-20 2007-06-27 北京亿中邮信息技术有限公司 Method for personalized replacing webpage subject
US20120066585A1 (en) * 2010-09-13 2012-03-15 International Business Machines Corporation Widget behavior customization via cascaded style sheets
CN102662672A (en) * 2012-04-05 2012-09-12 广州市动景计算机科技有限公司 Method and device for conducting skin changing process to webpages as well as mobile terminal
CN102981844A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Browser treating webpage main body element and method treating the webpage main body element

Cited By (11)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981844A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Browser treating webpage main body element and method treating the webpage main body element
WO2014075509A1 (en) * 2012-11-13 2014-05-22 北京奇虎科技有限公司 Method and device for browser to process page element
CN102981844B (en) * 2012-11-13 2016-07-13 北京奇虎科技有限公司 The browser that webpage main body element is processed and method
CN104021158A (en) * 2014-05-23 2014-09-03 北京金山网络科技有限公司 Method and device for adjusting webpage elements in webpage and mobile terminal
JP2017538991A (en) * 2014-10-30 2017-12-28 アリババ・グループ・ホールディング・リミテッドAlibaba Group Holding Limited Page processing for mobile apps
CN109740082A (en) * 2014-11-19 2019-05-10 北京奇虎科技有限公司 Webpage loading method and device
CN108153762A (en) * 2016-12-05 2018-06-12 天脉聚源(北京)科技有限公司 A kind of method and system of content of pages switching display
CN112016014A (en) * 2020-08-18 2020-12-01 北京达佳互联信息技术有限公司 Webpage display method, webpage resource generation method, webpage display device, webpage resource generation device, electronic equipment and medium
CN112016014B (en) * 2020-08-18 2023-12-26 北京达佳互联信息技术有限公司 Webpage display method, webpage resource generation device, electronic equipment and medium
CN117111803A (en) * 2023-10-20 2023-11-24 荣耀终端有限公司 Background image display method and electronic equipment
CN117111803B (en) * 2023-10-20 2024-04-05 荣耀终端有限公司 Background image display method and electronic equipment

Also Published As

Publication number Publication date
CN102981848B (en) 2015-12-09

Similar Documents

Publication Publication Date Title
CN102981848A (en) Webpage main body element processing browser and method
CN102981844A (en) Browser treating webpage main body element and method treating the webpage main body element
CN102999578A (en) Method and device for processing page element
CN102999579B (en) Page text frame process browser and page text frame element disposal route
US20190243866A1 (en) Mobile enablement of existing web sites
US8775926B2 (en) Stylesheet conversion engine
CN110309451B (en) Method and device for generating web preloading page
US8682964B1 (en) Progressively loading network content
CN102981845A (en) Page elements processing method of browser and page elements processing device of browser
CN103605688A (en) Intercept method and intercept device for homepage advertisements and browser
CN111639019A (en) Code testing method and device and readable storage medium
CN102981846A (en) Method for treating password input box element and browser for treating the password input box element
CN103559222A (en) Method and device for displaying page loading time in browsers
CN103019720A (en) Method and device for processing page in browser
CN103034622A (en) Rich text content processing method and server
CN102981847B (en) The browser that page text frame is processed and method
CN105447198A (en) Convenient page script importing method and device
CN103559097A (en) Inter-process communication method and device in browser and browser
CN103034723A (en) Page presenting method and equipment
CN103685518A (en) Method, client side and system for providing image-text pages for mobile terminal
CN105183887A (en) Data processing method based on browser and browser device
CN102999580A (en) Code input frame element processing method and browser
Oh et al. Automated transformation of template-based web applications into single-page applications
CN103258055A (en) Device and method for file downloading
CN113792208B (en) Picture interaction method, device, equipment, medium and program product based on 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
TR01 Transfer of patent right
TR01 Transfer of patent right

Effective date of registration: 20220714

Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015

Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park)

Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd.

Patentee before: Qizhi software (Beijing) Co.,Ltd.