CN102981848B - Webpage main body element process browser and method - Google Patents

Webpage main body element process browser and method Download PDF

Info

Publication number
CN102981848B
CN102981848B CN201210455581.9A CN201210455581A CN102981848B CN 102981848 B CN102981848 B CN 102981848B CN 201210455581 A CN201210455581 A CN 201210455581A CN 102981848 B CN102981848 B CN 102981848B
Authority
CN
China
Prior art keywords
main body
body element
dom object
dom
webpage main
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
CN201210455581.9A
Other languages
Chinese (zh)
Other versions
CN102981848A (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

Abstract

The invention discloses webpage main body element process browser and method, the method comprises: load in browser side and obtain the page, and analyzing web page main element be converted into DOM object; The customized treatment that the DOM object of DOM object handler to conversion calling at least one webpage main body element of setting is arranged, is arranged according to the webpage main body element of web page background pictorial information to current page arranged in this customized treatment; Process is played up to the dom tree completing webpage main body element customized treatment; Wherein, the customized treatment that the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting is arranged comprises: the background information obtaining the webpage main body element that user is arranged from the DOM object of conversion; According to the analysis result of background information, call the customized treatment that the DOM object of corresponding DOM object handler to conversion is arranged.Adopt the present invention can carry out customized treatment to webpage main body element according to user's request.

Description

Webpage main body element process browser and method
Technical field
The present invention relates to network application field, especially relate to a kind of webpage main body element process browser and a kind of webpage main body element disposal route.
Background technology
Along with the fast development of Internet, also present fulminant growth based on the application of Internet and information.Web browser is that Internet user provides a kind of accesses network information and uses the mode of network application, and which applicability is strong, and more many users have got used to obtaining various information by web browser and using various application.The network information and application vendor provide with such as HTML (HTML (Hypertext Markup Language), and so on HypertextMarkupLanguage) webpage of the language compilation of form, web browser presents these webpages at user place, thus makes the user of web browser to obtain relevant information.Along with the fast development of network technology, the content presented by web browser is also more and more abundanter, therefore web browser present function also from strength to strength with important.Web browser common at present has InternetExplorer, MozillaFirefox, Chrome, Opera of Google and the Safari of Apple etc. of Microsoft.
In the related, web browser utilizes render engine (RenderingEngine) explain content (as HTML, JavaScript) in webpage and play up (display) webpage.Render engine determines the browser how content of display web page and the format information of the page.The explanation of different render engines to program grammer also has difference, and therefore same webpage (display) effect of playing up in the browser of different render engine also may be different.
The render engine of current web browser is by converting DOM model to play up by each element in HTML and js code.When changing, whole html document is fabricated dom tree, and each element in HTML is converted into the object in dom tree, and the relation that the relation between object is constructed between node and child node constructs, by using the method for related objects, addressing and operation can be carried out to these objects.DOM model has had much public specification and definition.
When web browser process html page, the render engine in browser is analyzed html page language, is treated to DOM model, utilizes DOM model to be subsequently configured to the inner structure of display page in a browser.DOMAPI also provides the interface of monitoring or amendment webpage to js code.
The mechanism that render engine introduces based on event processes DOM object.Each DOM object has the multiple events be associated, and these events can be triggered.Such as, the JS code in render engine analyzing web page, and corresponding JS code and event are associated, thus make to obtain particular event when being triggered, perform corresponding JS code.
But in current web browser, render engine mostly just controls corresponding DOM object according to the JS code in html web page, therefore, user uses during browser and is difficult to DOM object, and each element namely in webpage carries out customization and plays up.
In summary, present web browser is when presenting webpage, and the mode usually required by network application and Information Provider presents web page contents, and does not take into full account the preference of user to page presentation mode.Although therefore existing web browser has different render engines, when it, to present effect substantially identical.
Particularly for web page background, in prior art, web page background etc. can be arranged in the main body of webpage (<body>) unit.Current internet content provider utilizes body element to arrange the essential information of some webpages, but user is when browsing pages, as computed desktop, wishes the page layout background that can arrange oneself.But in existing browser, web page background cannot be arranged according to the demand of user, user cannot the abundant background content that presents of personalized customization web browser, and the impression reducing user is experienced.
Summary of the invention
In view of the above problems, the present invention is proposed to provide a kind of overcoming the problems referred to above or the webpage main body element process browser solved the problem at least in part and corresponding webpage main body element disposal route.
According to one aspect of the present invention, provide a kind of webpage main body element process browser, this browser side is provided with web page background pictorial information, and this browser comprises:
The DOM object handles module of at least one webpage main body element, wherein each DOM object handles block configuration is store the customized treatment to webpage main body element;
Page parsing module, is configured to load in described browser side obtain the page, and resolves the webpage main body element in the page, this webpage main body element is converted to DOM object;
DOM processing module, the DOM object of DOM object handles module to described conversion being configured at least one webpage main body element calling described setting carries out the customized treatment of described setting, the webpage main body element of web page background pictorial information to current page according to described setting in this customized treatment is arranged, and is also configured to the background information obtaining the webpage main body element that user is arranged from the DOM object of described conversion; According to the analysis result of the background information that described user is arranged, call the customized treatment that the DOM object of corresponding DOM object handles module to described conversion carries out described setting;
Play up processing module, the dom tree be configured to completing webpage main body element customized treatment plays up process.
Alternatively, described background information comprises background image list.
Alternatively, part DOM object handles module is configured to store at least piece image in described background image list;
Now, described DOM processing module is also configured to call the background image of this part DOM object handles module to the page and changes.
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 described background image list backward change;
According to described background image list circulation change;
According to described background image list random order change.
Alternatively, above-mentioned browser also comprises acquisition module, is configured to the script process obtaining image change order from browser side; Now,
Described DOM processing module is also configured to according to described script process, calls the order respective change of background image according to background image list of described webpage main body element.
Alternatively, above-mentioned browser also comprises:
Enquiry module, is configured to inquire about from object handles registration table in described browser the DOM object handles module whether existing and process described webpage main body element, wherein, and registration at least one DOM object handles module described in described object handles registration table.
Alternatively, when described DOM processing module is also configured to the ContentReady event triggered when described webpage main body element has loaded, the DOM object of DOM object handles module to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
Alternatively, when described DOM processing module is also configured to the DocumentReady event triggered when web page files has loaded, the DOM object of DOM object handles module to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
Alternatively, when described browser is IE browser, described webpage main body element is stored in body element.
According to another aspect of the present invention, provide a kind of webpage main body element disposal route, be provided with web page background pictorial information in a browser, and the DOM object handler of at least one webpage main body element is set in browser side, wherein each DOM object handler is configured to store the customized treatment to webpage main body element, comprising:
Load in described browser side and obtain the page, and the webpage main body element in the page is resolved, this webpage main body element is converted to DOM object;
The DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting, and the webpage main body element of web page background pictorial information to current page according to described setting in this customized treatment is arranged;
Process is played up to the dom tree completing webpage main body element customized treatment;
Wherein, the customized treatment that the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting described in carries out described setting comprises:
The background information of the webpage main body element that user is arranged is obtained from the DOM object of described conversion;
According to the analysis result of the background information that described user is arranged, call the customized treatment that the DOM object of corresponding DOM object handler to described conversion carries out described setting.
Alternatively, described background information comprises background image list.
Alternatively, when storing at least piece image in described background image list in part DOM object handler,
The DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting, comprising: call the background image of this part DOM object handler to the page and change.
Alternatively, the change order of described background image comprise following one of arbitrarily:
According to described background image tab sequential change;
According to described background image list backward change;
According to described background image list circulation change;
According to described background image list random order change.
Alternatively, said method also comprises:
The script process of image change order is obtained from browser side;
According to described script process, call the order respective change of background image according to background image list of described webpage main body element.
Alternatively, the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting comprises before carrying out the customized treatment of described setting:
The DOM object handler whether existing and described webpage main body element is processed is inquired about in described browser from object handles registration table, wherein, registration at least one DOM object handler described in described object handles registration table.
Alternatively, during the ContentReady event triggered when described webpage main body element has loaded, the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
Alternatively, during the DocumentReady event triggered when web page files has loaded, the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
Alternatively, when described browser is 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 WebBrowser plug-in unit, wherein, described first interface and described second interface are used for calling each DOM object handler, described 3rd interface is used for each DOM object handler to be registered in described object handles registration table, described 4th interface and client associate;
Call the DOM object handler of at least one webpage main body element of described setting, comprising:
Core engine calls behavior querying method by first interface, and inquiry client about second interface of M_BODY, and provides described 4th interface associated, receives the object instance that client returns;
Described core engine, when Web page loading main element, calls element behavior Notification Method, the stress state of notice customer terminal webpage element.
In embodiments of the present invention, for each DOM object that webpage main body element parses, the DOM object handles module of it being carried out to customized treatment is set at network side, in the acquisition process of the page, utilizes the customized treatment that the DOM object handles module called is arranged DOM object.Because at least one DOM object handles module can store at least one customized treatment mode, therefore, at least one process can be carried out to webpage main body element, and then different element in webpage main body element can be adjusted present different conditions.As can be seen here, adopt the browser processed webpage main body element that the embodiment of the present invention provides, can process respectively the different DOM objects in webpage main body element, the webpage main body element presented thus can realize personalized customization process, such as, different background images is set.Ensure that webpage main body element is not the fixed form required by network application and Information Provider, and then achieve the object that content that user can present webpage main body element carries out personalized customization, meet the preference of different users, the impression improving user is experienced.
Above-mentioned explanation is only the general introduction of technical solution of the present invention, in order to technological means of the present invention can be better understood, and can be implemented according to the content of instructions, and can become apparent, below especially exemplified by the specific embodiment of the present invention to allow above and other objects of the present invention, feature and advantage.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit will become cheer and bright for those of ordinary skill in the art.Accompanying drawing only for illustrating the object of preferred implementation, and does not think limitation of the present invention.And in whole accompanying drawing, represent identical parts by identical reference symbol.In the accompanying drawings:
Fig. 1 shows the structural representation of webpage main body element process browser according to an embodiment of the invention;
Fig. 2 shows the process flow diagram of webpage main body element disposal route according to an embodiment of the invention; And
Fig. 3 shows the structural representation of webpage main body element process browser according to an embodiment of the invention.
Embodiment
Below with reference to accompanying drawings exemplary embodiment of the present disclosure is described in more detail.Although show exemplary embodiment of the present disclosure in accompanying drawing, however should be appreciated that can realize the disclosure in a variety of manners and not should limit by the embodiment set forth here.On the contrary, provide these embodiments to be in order to more thoroughly the disclosure can be understood, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
For solving the technical matters mentioned in background technology of the present invention, embodiments provide a kind of browser processed webpage main body element, this browser side is provided with web page background pictorial information.Fig. 1 shows the structural representation of webpage main body element process browser according to an embodiment of the invention.This browser comprises DOM object handles module 110, page parsing module 120, the DOM processing module 130 of at least one webpage main body element and plays up processing module 140.Now the function of each module that browser comprises is described in detail.
First the DOM object handles module of at least one webpage main body element is introduced.The quantity of DOM object handles module is at least one, and is set in advance in browser side, stores the customized treatment to webpage main body 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 the quantity of specific DOM object and customized treatment.In order to illustrate in Fig. 1, be set to 3.
Secondly, page parsing module 120 is introduced.When processing the page obtained, page parsing module 120 loads in browser side and obtains the page.Consider that the page and page elements can not directly process, therefore, page parsing module 120 needs to resolve the webpage main body element in the page, and this webpage main body element is converted to DOM object, processes for follow-up DOM processing module 130.
Then, DOM processing module 130 is introduced.Be couple to page parsing module 120 see Fig. 1, DOM processing module 130 one end, the other end is couple to the DOM object handles module 110 of at least one webpage main body element pre-seted in browser side.After the parsing of webpage main body element and conversion operations are terminated, the customized treatment that the DOM object of DOM object handles module 110 to conversion that DOM processing module 130 can call at least one webpage main body element of setting is arranged, is arranged according to the webpage main body element of web page background pictorial information to current page arranged in this customized treatment.
Finally, processing module 140 is played up in introduction.See Fig. 1, play up processing module 140 and be couple to DOM processing module 130.After the customized treatment operation of DOM processing module 130 terminates, treated DOM object can form dom tree, then plays up process by playing up processing module 140 to the dom tree completing webpage main body element customized treatment.
In embodiments of the present invention, for each DOM object that webpage main body element parses, the DOM object handles module of it being carried out to customized treatment is set at network side, in the acquisition process of the page, utilizes the customized treatment that the DOM object handles module called is arranged DOM object.Because at least one DOM object handles module can store at least one customized treatment mode, therefore, at least one process can be carried out to webpage main body element, and then different element in webpage main body element can be adjusted present different conditions.As can be seen here, adopt the browser processed webpage main body element that the embodiment of the present invention provides, can process respectively the different DOM objects in webpage main body element, the webpage main body element presented thus can realize personalized customization process, such as, different background images is set.Ensure that webpage main body element is not the fixed form required by network application and Information Provider, and then achieve the object that content that user can present webpage main body element carries out personalized customization, meet the preference of different users, the impression improving user is experienced.
For reaching the object selecting different background informations according to the demand of user, DOM processing module 130 can obtain the background information of the webpage main body element that user is arranged from the DOM object of conversion.Then, according to the analysis result of the background information that user is arranged, DOM processing module 130 calls the customized treatment that the DOM object of corresponding DOM object handles module to conversion is arranged.
The background information mentioned in the present embodiment comprises polytype, such as, can comprise background image list, can also comprise background music list, can also comprise background video list, etc.Be described for background image list herein.Background image list is made up of multiple image, and carried out encoding and sorting accordingly to each width image, just it shows and calls more convenient.
When background information is background image list, in part DOM object handles module 110, store at least piece image in background image list.Accordingly, now, the background image that DOM processing module 130 is also configured to call this part DOM object handles module 110 pairs of pages is changed.Owing to storing different background images in different DOM object handles modules 110, then, when calling different DOM object handles modules, the background image of generation is also different, therefore, can realize the object of the demand amendment background according to user.
Mention above, DOM processing module 130 realizes the change of background image by calling different DOM object handles modules 110.So, it should be noted that, the order that DOM processing module 130 changes background image can follow certain order, such as, can change according to background image tab sequential, also can change according to background image list backward, according to background image list circulation change, and can also change according to background image list random order.Concrete change order is specified by user.Multiple changing mode also show further the setting of background image in the embodiment of the present invention.
The order of image change can be arranged on browser side with the form of script process in advance.For obtaining this script process, see Fig. 1, in browser, acquisition module 150 being also set, utilizing this acquisition module 150 to obtain the script process of image change order from browser side.Now, the script process that DOM processing module 130 obtains according to acquisition module 150, obtains 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 list.
Wherein, for the call operation of DOM object handles module 110, DOM processing module 130 needs the address knowing each DOM object handles module 110, and then call accordingly, if when the more and memory address relative distribution of DOM object handles module, will there is certain difficulty in calling of DOM processing module 130.A kind of preferred method of calling is now provided, in this example, object handles registration table is set, in this form, register the register information of all DOM object handles modules, whether called etc. register information herein can comprise the customization operations, of the memory address of each DOM object handles module, each DOM object handles module.Accordingly, see Fig. 1, the webpage main body element process browser that the embodiment of the present invention provides also comprises enquiry module 160.This enquiry module 160 is coupled with DOM processing module 130, whether there is the DOM object handles module processed web page element element from object handles registration table in Query Browser.After poll-final, Query Result is notified DOM processing module 130 by enquiry module 160, and DOM processing module 130 can call corresponding DOM object handles module 110 according to Query Result.
For each DOM object, all have at least two events, an event ContentReady being this DOM object and having triggered when having loaded, another is the event DocumentReady that whole HTML triggers when having loaded.Because the embodiment of the present invention relates to, webpage main body element is processed, therefore the event ContentReady triggered when this DOM object has loaded only is related to, the customized treatment that the DOM object of DOM object handles module 110 to conversion that DOM processing module 130 can call at least one webpage main body element of setting is arranged.Further, during the DocumentReady event that can also trigger when web page files has loaded at least one DOM processing module 130 that the embodiment of the present invention provides, the customized treatment that the DOM object of DOM object handles module 110 to conversion calling at least one webpage main body element of setting is arranged.
Preferably, when browser is IE browser, webpage main body element can be stored in body element.
Above-mentioned provides according to its function each several part framework of the browser that page text frame processes, and actual framework is not limited in each part mentioned above, can also comprise other parts, module, device etc.
Fig. 2 shows the processing flow chart of webpage main body element disposal route according to an embodiment of the invention.In this example, be provided with web page background pictorial information in a browser, and arrange the DOM object handler of at least one webpage main body element in browser side, wherein each DOM object handler is configured to store the customized treatment to webpage main body element.The method comprising the steps of S202 is to step S206.
Step S202, to load in browser side and obtain the page, and the webpage main body element in the page to be resolved, this webpage main body element is converted to DOM object.
The customized treatment that step S204, the DOM object of DOM object handler to conversion calling at least one webpage main body element of setting are arranged, is arranged according to the webpage main body element of web page background pictorial information to current page arranged in this customized treatment.
Step S206, process is played up to the dom tree completing webpage main body element customized treatment.
In embodiments of the present invention, for each DOM object that webpage main body element parses, the DOM object handler of it being carried out to customized treatment is set at network side, in the acquisition process of the page, utilizes the customized treatment that the DOM object handler called is arranged DOM object.Because at least one DOM object handler can store at least one customized treatment mode, therefore, at least one process can be carried out to webpage main body element, and then different element in webpage main body element can be adjusted present different conditions.As can be seen here, adopt the method processed webpage main body element that the embodiment of the present invention provides, can process respectively the different DOM objects in webpage main body element, the webpage main body element presented thus can realize personalized customization process, such as, different background images is set.Ensure that webpage main body element is not the fixed form required by network application and Information Provider, and then achieve the object that content that user can present webpage main body element carries out personalized customization, meet the preference of different users, the impression improving user is experienced.
It should be noted that, the function of the DOM object handler in this flow process and DOM object handles module mentioned above is similar, because relating to the framework of browser above, is therefore referred to as DOM object handles module.And in this flow process, only relate to DOM object handler parts, therefore, need not module be referred to as, hereinafter be repeated no more.
See Fig. 2, step S204 mentions the customized treatment that the DOM object of the DOM object handler of at least one webpage main body element calling setting to conversion is arranged when implementing.Preferably, the background information of the webpage main body element that user is arranged can be obtained from the DOM object of conversion.And then, according to the analysis result of the background information that user is arranged, call the customized treatment that the DOM object of corresponding DOM object handler to conversion is arranged.
Wherein, the background information mentioned in the present embodiment comprises polytype, such as, can comprise background image list, can also comprise background music list, can also comprise background video list, etc.Be described for background image list herein.Background image list is made up of multiple image, and carried out encoding and sorting accordingly to each width image, just it shows and calls more convenient.
When background information is background image list, at least piece image in background image list can be stored in part DOM object handler.Accordingly, the customized treatment that the DOM object of DOM object handler to conversion calling at least one webpage main body element of setting is arranged, comprising: can call the background image of this part DOM object handler to the page and change.
Mentioning above, the change of background image can be realized by calling different DOM object handler.So, it should be noted that, the order of change background image can follow certain order, such as, can change according to background image tab sequential, also can change according to background image list backward, according to background image list circulation change, and can also change according to background image list random order.Concrete change order is specified by user.Multiple changing mode also show further the setting of background image in the embodiment of the present invention.
The order of image change can be arranged on browser side with the form of script process in advance.The script process of image change order is obtained from browser side.Then according to the script process obtained, 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 list.
It calls wherein, for the call operation of DOM object handler, need the address knowing each DOM object handler, and then call accordingly, if when the more and memory address relative distribution of DOM object handler, will exist certain difficulty.A kind of preferred method of calling is now provided, in this example, object handles registration table is set, in this form, register the register information of all DOM object handler, whether called etc. register information herein can comprise the customization operations, of the memory address of each DOM object handler, each DOM object handler.Accordingly, see Fig. 1, whether what the embodiment of the present invention provided exists to the browser that webpage main body element processes the DOM object handler processed webpage main body element from object handles registration table in Query Browser.After poll-final, corresponding DOM object handler can be called according to Query Result.
For each DOM object, all have at least two events, an event ContentReady being this DOM object and having triggered when having loaded, another is the event DocumentReady that whole HTML triggers when having loaded.Because the embodiment of the present invention relates to, webpage main body element is processed, therefore the event ContentReady triggered when this DOM object has loaded only is related to, the customized treatment that the DOM object of DOM object handler to conversion that can call at least one webpage main body element of setting is arranged.Further, during the DocumentReady event that the embodiment of the present invention can also trigger when web page files has loaded, the customized treatment that the DOM object of DOM object handler to conversion calling at least one webpage main body element of setting is arranged.
Embodiment one
The browser be mentioned in the embodiment of the present invention can for multiple, the InternetExplorer (being called for short IE) of such as Microsoft, MozillaFirefox, Chrome, Opera of Google and the Safari of Apple etc.
Now set forth in detail for the concrete disposal route of IE browser to the text box element that the embodiment of the present invention provides and illustrate.
For the particular procedure for each web page element, may need to realize
IElementBehavior (element behavior)
ImplementingtheIElementBehaviorInterface (performing element behavior interface)
ImplementingtheNotifyMethod (execution Notification Method)
ImplementingtheInitMethod (execution initial method)
ImplementingtheDetachMethod (execution separation method)
IElementBehaviorFactory (behavior of element behavior factory)
IElementNamespaceFactory (element NameSpace factor interface)
IElementNamespaceFactoryCallback (element NameSpace callback interface)
After Initialize installation, the concrete treatment step that client WebBrowser (web browser) plug-in unit in IE browser realizes web page element is as follows:
Step 1, client WebBrowser plug-in unit realize IElementBehaviorFactory interface.
Step 2, client WebBrowser plug-in unit realize IDocHostUIHandler interface.
Note: WebBrowser plug-in unit is here exactly in the embodiment of par-ticular processor in IE for specific DOM object, realize IDocHostUIHandler interface to be adopted by DOM processor for par-ticular processor is registered in object registry, realize IElementBehaviorFactory and IElementBehavior interface and realize for illustration of concrete customized treatment.
When step 3, page creation, MSHTML can call the GetHostInfo method of IDocHostUIHandler, and client-side program provides the BehaviorName of page elements TAG and correspondence to MSHTML.
Note: MSHTML corresponds to core engine, and this step corresponds to DOM processor and inquires about all DOM object handler lists.
When step 4, the page load, MSHTML according to the BehaviorName provided above, can call the FindBehavior method of IElementBehaviorFactory, provides the IElementBehavior Interface realization about M_BODY by client one by one.
Herein, preferably, and associate with the corresponding interface IElementBehaviorSite that the page provides, to determine whether customization behavior.
Step 5, MSHTML are when loading BODY element, and invoking web page main element behavior Notification Method, to page insertion objects (OBJECT) element, plays MP3 or FLASH.
Note: webpage subject behavior Notification Method realizes utilizing CBodyIElementBehavior::Notify method in IE.
Wherein, timer can be created, carousel Background.
Wherein, it should be noted that step 4 and step 5 are called corresponding DOM object handler corresponding to DOM processing module and processed DOM object.
The method of the present embodiment is not only for IE browser, and for other browsers, its implementation is similar.
Embodiment two
Present embodiments provide the concrete grammar that webpage main body element is processed.
Before the page loads, obtain the background information that user is arranged, comprise background image list, background music list etc.
Further, when load page, the background (background) obtained in body element is arranged, and is revised as first figure in display background image list.
Then, background music is set in body element.
Finally, js code is set, the background image of body element is changed according to list content.
Embodiment three
Above-described is directly process webpage main body element, as everyone knows, the page elements of browser has multiple, and browser needs all to change each page elements and process, then the page elements after process is played up, just generate the webpage presented.
Fig. 3 shows the structural representation of page main element process browser according to an embodiment of the invention.See Fig. 3, this browser comprises at least one the DOM object handler 310, page parsing device 320 and the DOM processor 330 that are arranged on browser side.
Wherein, DOM object handler 310 comprises at least one, and is set in advance in 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 the quantity of specific DOM object and customized treatment.In order to illustrate in Fig. 3, be set to 3.
When processing the page obtained, page parsing device 320 loads this acquisition page in browser side, and resolves the page elements obtaining the page.Consider that the page and page elements can not directly process, therefore, each page elements is converted to DOM object by page parsing device 320 in resolving, processes for follow-up DOM processor 330.
See Fig. 3, DOM processor 330, be couple to page parsing device 320 and at least one DOM object handler 310.After page parsing device 320 parsing terminates, start DOM processor 330.DOM processor 330 selects at least one as the current DOM object preparing process in the DOM object of conversion, calls at least one DOM object handler 310 of setting, to the customized treatment that the DOM object selected is arranged.
See Fig. 3, this browser also comprises tree maker 340, is couple to DOM processor 330.When DOM processor 330 calls DOM object handler 310, carry out after customized treatment terminates to DOM object, tree maker 340 utilizes the DOM object of the customized treatment through arranging to generate final dom tree, and plays up dom tree.
And webpage main body element is the one of page elements, therefore, when page elements is webpage main body element, the device utilizing browser to carry out page elements process can directly process webpage main body element, and the customized treatment mode that its DOM object handler selected stores is the customized treatment for webpage main body element.That is, in this example, see Fig. 3, its DOM object handler 310 selected should be the DOM object handler 310 of webpage main body element.The function of other each parts remains unchanged.
In this example, page parsing device 320 is similar with the function of page parsing module 120 in the previous embodiments, is all that corresponding element is converted to DOM object.And DOM processor 330 is similar with the function of DOM processing module 130 in the previous embodiments, calls corresponding DOM object handles module (or DOM object handler), respective handling is carried out to current DOM object.
Adopt browser provided by the invention and corresponding disposal route, following beneficial effect can be reached:
In embodiments of the present invention, for each DOM object that webpage main body element parses, the DOM object handles module of it being carried out to customized treatment is set at network side, in the acquisition process of the page, utilizes the customized treatment that the DOM object handles module called is arranged DOM object.Because at least one DOM object handles module can store at least one customized treatment mode, therefore, at least one process can be carried out to webpage main body element, and then different element in webpage main body element can be adjusted present different conditions.As can be seen here, adopt the browser processed webpage main body element that the embodiment of the present invention provides, can process respectively the different DOM objects in webpage main body element, the webpage main body element presented thus can realize personalized customization process, such as, different background images is set.Ensure that webpage main body element is not the fixed form required by network application and Information Provider, and then achieve the object that content that user can present webpage main body element carries out personalized customization, meet the preference of different users, the impression improving user is experienced.
Intrinsic not relevant to any certain computer, virtual system or miscellaneous equipment with display at this algorithm provided.Various general-purpose system also can with use based on together with this teaching.According to description above, the structure constructed required by this type systematic is apparent.In addition, the present invention is not also for any certain programmed language.It should be understood that and various programming language can be utilized to realize content of the present invention described here, and the description done language-specific is above to disclose preferred forms of the present invention.
In instructions provided herein, describe a large amount of detail.But can understand, embodiments of the invention can be put into practice when not having these details.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 in each inventive aspect one or more, in the description above 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.But, the method for the disclosure should be construed to the following intention of reflection: namely the present invention for required protection requires feature more more than the feature clearly recorded in each claim.Or rather, as claims below reflect, all features of disclosed single embodiment before inventive aspect is to be less than.Therefore, the claims following embodiment are incorporated to this embodiment thus clearly, and wherein each claim itself is as independent embodiment of the present invention.
Those skilled in the art are appreciated that and adaptively can change the module in the equipment in embodiment and they are arranged in one or more equipment different from this embodiment.Module in embodiment or unit or assembly can be combined into a module or unit or assembly, and multiple submodule or subelement or sub-component can be put them in addition.Except at least some in such feature and/or process or unit be mutually repel except, any combination can be adopted to combine all processes of all features disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment or unit.Unless expressly stated otherwise, each feature disclosed in this instructions (comprising adjoint claim, summary and accompanying drawing) can by providing identical, alternative features that is equivalent or similar object replaces.
In addition, those skilled in the art can understand, although embodiments more described herein to comprise in other embodiment some included feature instead of further feature, the combination of the feature of different embodiment means and to be within scope of the present invention and to form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can use with arbitrary array mode.
All parts embodiment of the present invention with hardware implementing, or can realize with the software module run on one or more processor, or realizes with their combination.It will be understood by those of skill in the art that the some or all functions that microprocessor or digital signal processor (DSP) can be used in practice to realize according to the some or all parts in the page main element process browser of the embodiment of the present invention.The present invention can also be embodied as part or all equipment for performing method as described herein or device program (such as, computer program and computer program).Realizing program of the present invention and can store on a computer-readable medium like this, or the form of one or more signal can be had.Such signal can be downloaded from internet website and obtain, or provides on carrier signal, or provides with any other form.
The present invention will be described instead of limit the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment when not departing from the scope of 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 does not arrange element in the claims or step.Word "a" or "an" before being positioned at element is not got rid of and be there is multiple such element.The present invention can by means of including the hardware of some different elements and realizing by means of the computing machine of suitably programming.In the unit claim listing some devices, several in these devices can be carry out imbody by same hardware branch.Word first, second and third-class use do not represent any order.Can be title by these word explanations.

Claims (18)

1. a webpage main body element process browser, this browser side is provided with web page background pictorial information, and this browser comprises:
The DOM object handles module of at least one webpage main body element, wherein each DOM object handles block configuration is store the customized treatment to webpage main body element, presents different conditions to adjust different element in webpage main body element;
Page parsing module, is configured to load in described browser side obtain the page, and resolves the webpage main body element in the page, this webpage main body element is converted to DOM object;
DOM processing module, the DOM object of DOM object handles module to described conversion being configured at least one webpage main body element calling described setting carries out the customized treatment of described setting, the webpage main body element of web page background pictorial information to current page according to described setting in this customized treatment is arranged, and is also configured to the background information obtaining the webpage main body element that user is arranged from the DOM object of described conversion; According to the analysis result of the background information that described user is arranged, call the customized treatment that the DOM object of corresponding DOM object handles module to described conversion carries out described setting;
Play up processing module, the dom tree be configured to completing webpage main body element customized treatment plays up process.
2. browser according to claim 1, is characterized in that, described background information comprises background image list.
3. browser according to claim 2, is characterized in that, part DOM object handles module is configured to store at least piece image in described background image list;
Now, described DOM processing module is also configured to call the background image of this part DOM object handles module to the page and changes.
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 described background image list backward change;
According to described background image list circulation change;
According to described background image list random order change.
5. the browser according to any one of Claims 1-4, is characterized in that, also comprises acquisition module, is configured to the script process obtaining image change order from browser side; Then,
Described DOM processing module is also configured to according to described script process, calls the order respective change of background image according to background image list of described webpage main body element.
6. the browser according to any one of Claims 1-4, is characterized in that, also comprises:
Enquiry module, is configured to inquire about from object handles registration table in described browser the DOM object handles module whether existing and process described webpage main body element, wherein, and registration at least one DOM object handles module described in described object handles registration table.
7. the browser according to any one of Claims 1-4, it is characterized in that, when described DOM processing module is also configured to the ContentReady event triggered when described webpage main body element has loaded, the DOM object of DOM object handles module to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
8. the browser according to any one of Claims 1-4, it is characterized in that, when described DOM processing module is also configured to the DocumentReady event triggered when web page files has loaded, the DOM object of DOM object handles module to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
9. the browser according to any one of Claims 1-4, is characterized in that, when described browser is IE browser, described webpage main body element is stored in body element.
10. a webpage main body element disposal route, be provided with web page background pictorial information in a browser, and the DOM object handler of at least one webpage main body element is set in browser side, wherein each DOM object handler is configured to store the customized treatment to webpage main body element, present different conditions to adjust different element in webpage main body element, comprising:
Load in described browser side and obtain the page, and the webpage main body element in the page is resolved, this webpage main body element is converted to DOM object;
The DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting, and the webpage main body element of web page background pictorial information to current page according to described setting in this customized treatment is arranged;
Process is played up to the dom tree completing webpage main body element customized treatment;
Wherein, the customized treatment that the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting described in carries out described setting comprises:
The background information of the webpage main body element that user is arranged is obtained from the DOM object of described conversion;
According to the analysis result of the background information that described user is arranged, call the customized treatment that the DOM object of corresponding DOM object handler to described conversion carries out described setting.
11. methods according to claim 10, is characterized in that, described background information comprises background image list.
12. methods according to claim 11, is characterized in that, when storing at least piece image in described background image list in part DOM object handler,
The DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting, comprising: call the background image of this part DOM object handler to the page and change.
13. methods according to claim 12, is characterized in that, the change of described background image order comprise following one of arbitrarily:
According to described background image tab sequential change;
According to described background image list backward change;
According to described background image list circulation change;
According to described background image list random order change.
14., according to claim 10 to the method described in 13 any one, is characterized in that, also comprise:
The script process of image change order is obtained from browser side;
According to described script process, call the order respective change of background image according to background image list of described webpage main body element.
15., according to claim 10 to the method described in 13 any one, is characterized in that, the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting comprises before carrying out the customized treatment of described setting:
The DOM object handler whether existing and described webpage main body element is processed is inquired about in described browser from object handles registration table, wherein, registration at least one DOM object handler described in described object handles registration table.
16. according to claim 10 to the method described in 13 any one, it is characterized in that, during the ContentReady event triggered when described webpage main body element has loaded, the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
17. according to claim 10 to the method described in 13 any one, it is characterized in that, during the DocumentReady event triggered when web page files has loaded, the DOM object of DOM object handler to described conversion calling at least one webpage main body element of described setting carries out the customized treatment of described setting.
18. according to claim 10 to the method described in 13 any one, it is characterized in that, when described browser is IE browser, the client at described browser place arranges first interface IElementBehaviorFactory at WebBrowser plug-in unit, second interface IElementBehavior, 3rd interface IDocHostUIHandler and the 4th interface IElementBehaviorSite, wherein, described first interface and described second interface are used for calling each DOM object handler, described 3rd interface is used for each DOM object handler to be registered in described object handles registration table, described 4th interface and client associate,
Call the DOM object handler of at least one webpage main body element of described setting, comprising:
Core engine calls behavior querying method by first interface, and inquiry client about second interface of M_BODY, and provides described 4th interface associated, receives the object instance that client returns;
Described core engine, when Web page loading main element, calls element behavior Notification Method, 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 CN102981848A (en) 2013-03-20
CN102981848B true 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)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981844B (en) * 2012-11-13 2016-07-13 北京奇虎科技有限公司 The browser that webpage main body element is processed and method
US9996512B2 (en) * 2012-11-13 2018-06-12 Beijing Qihoo Technology Company Limited Customized processing of DOM objects
CN104021158A (en) * 2014-05-23 2014-09-03 北京金山网络科技有限公司 Method and device for adjusting webpage elements in webpage and mobile terminal
CN105574049B (en) * 2014-10-30 2020-07-03 阿里巴巴集团控股有限公司 Page processing method, device and system for mobile application
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
CN112016014B (en) * 2020-08-18 2023-12-26 北京达佳互联信息技术有限公司 Webpage display method, webpage resource generation device, electronic equipment and medium
CN117111803B (en) * 2023-10-20 2024-04-05 荣耀终端有限公司 Background image display method and electronic equipment

Citations (4)

* 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
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

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US8522132B2 (en) * 2010-09-13 2013-08-27 International Business Machines Corporation Widget behavior customization via cascaded style sheets

Patent Citations (4)

* 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
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

Also Published As

Publication number Publication date
CN102981848A (en) 2013-03-20

Similar Documents

Publication Publication Date Title
CN102981848B (en) Webpage main body element process browser and method
CN102981844B (en) The browser that webpage main body element is processed and method
CN102999578B (en) Page elements treatment process and device
CN102999579B (en) Page text frame process browser and page text frame element disposal route
CN108984714B (en) Page rendering method and device, electronic equipment and computer readable medium
US8990289B2 (en) Server based framework for improving Ajax performance
US20190243866A1 (en) Mobile enablement of existing web sites
CN105094786B (en) Method and system based on JavaScript customized web page
CN102981845B (en) Browser carries out method and the device of page elements process
US20170102925A1 (en) Automatch process and system for software development kit for application programming interface
CN103500194A (en) Method, device and browser for loading webpage
CN104063460A (en) Method and device for loading webpage in browser
US8682964B1 (en) Progressively loading network content
CN103019817B (en) A kind of method and apparatus mutual for the page
WO2007107100A1 (en) Method for accessing a parent page while browsing web pages
CN102981846A (en) Method for treating password input box element and browser for treating the password input box element
CN105516333B (en) A kind of web-based exchange method and system
CN102981847B (en) The browser that page text frame is processed and method
CN103530329A (en) Method and device for performing webpage loading and browsers
CN105447198A (en) Convenient page script importing method and device
CN105183890B (en) Webpage loading method based on browser and browser device
CN104063247A (en) Application program calling method and system
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
CN112947900B (en) Web application development method and device, server and development terminal

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.