CN102981844B - The browser that webpage main body element is processed and method - Google Patents

The browser that webpage main body element is processed and method Download PDF

Info

Publication number
CN102981844B
CN102981844B CN201210453663.XA CN201210453663A CN102981844B CN 102981844 B CN102981844 B CN 102981844B CN 201210453663 A CN201210453663 A CN 201210453663A CN 102981844 B CN102981844 B CN 102981844B
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
CN201210453663.XA
Other languages
Chinese (zh)
Other versions
CN102981844A (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 CN201210453663.XA priority Critical patent/CN102981844B/en
Publication of CN102981844A publication Critical patent/CN102981844A/en
Application granted granted Critical
Publication of CN102981844B publication Critical patent/CN102981844B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Landscapes

  • Information Transfer Between Computers (AREA)

Abstract

The invention discloses the browser that webpage main body element is processed, browser side is provided with web page background pictorial information, including: the DOM object handles module of at least one webpage main body element, each DOM object handler storage has the customized treatment to webpage main body element;Page parsing module, loads in browser side and obtains the page, the webpage main body element in the page is resolved, this webpage main body element is converted to DOM object;DOM processing module, call the customized treatment that the DOM object of conversion is configured by the DOM object handles module of at least one webpage main body element of setting, the webpage main body element of current page is configured according to the web page background pictorial information arranged by this customized treatment;Render processing module, the dom tree completing webpage main body element customized treatment is rendered process.Adopt the present invention can be customized processing according to user's request to webpage main body element.The invention also discloses corresponding method.

Description

The browser that webpage main body element is processed and method
Technical field
The present invention relates to network application field, especially relate to a kind of browser that webpage main body element is processed and a kind of method webpage main body element processed in browser side.
Background technology
Along with the fast development of Internet, application and information based on Internet also present fulminant growth.Web browser is that Internet user provides a kind of mode accessing the network information and using network application, and which suitability is strong, and more many 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, etc HypertextMarkupLanguage) webpage that the language of form is write, web browser presents these webpages at user place, so that the user of web browser can obtain relevant information.Along with the fast development of network technology, web browser the content presented is also more and more abundanter, therefore web browser present function also from strength to strength with important.Web browser common at present has Safari of the InternetExplorer of Microsoft, MozillaFirefox, Chrome, Opera of Google and Apple etc..
In the related, web browser utilizes content (such as HTML, JavaScript) that rendering engine (RenderingEngine) explains in webpage and renders (display) webpage.Rendering engine determines how browser shows the content of webpage and the format information of the page.The explanation of program grammer is also had difference by different rendering engines, and therefore same webpage (display) effect that renders in the browser of different rendering engines is likely to difference.
The rendering engine of current web browser renders by converting each element in HTML and js code to DOM model.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 configured between node and child node constructs, by using the method about object, it is possible to these objects are addressed and operate.DOM model has had much public specification and definition.
When web browser processes html page, html page language is analyzed by the rendering engine in browser, is processed into DOM model, is configured to show in a browser the internal structure of the page followed by DOM model.DOMAPI also provides monitoring or the interface of amendment webpage to js code.
Rendering engine introduces the mechanism based on event and processes DOM object.Each DOM object has associated plurality of event, and these events can be triggered.Such as, rendering engine analyzes the JS code in webpage, and corresponding JS code and event is associated to particular event be triggered time, perform corresponding JS code.
But, in current web browser, rendering engine mostly just controls corresponding DOM object according to the JS code in html web page, and therefore, user uses and is difficult to DOM object during browser, and namely each element in webpage is customized rendering.
In summary, present web browser, when presenting webpage, presents web page contents generally according to the mode required by network application and Information Provider, and does not take into full account user's preference to page presentation mode.Although therefore existing web browser has different rendering engines, when it, to present effect essentially identical.
Especially for web page background, in prior art, web page background etc. can webpage main body (<body>) unit is arranged.Current internet content provider utilizes body element to arrange the essential information of some webpages, but user is when browsing pages, as the desktop using computer, it is desirable to be able to arrange the page layout background of oneself.But in existing browser, web page background cannot be arranged according to the demand of user, user cannot background content that fully personalized customization web browser presents, the impression reducing user is experienced.
Summary of the invention
In view of the above problems, it is proposed that the present invention is to provide a kind of and overcome the problems referred to above or solve the browser that webpage main body element is processed of the problems referred to above and the method accordingly webpage main body element processed at least in part.
According to one aspect of the present invention, it is provided that a kind of browser that webpage main body element is processed, this browser side is provided with web page background pictorial information, and this browser includes:
The DOM object handles module of at least one webpage main body element, wherein each DOM object handles module is configured to store the customized treatment to webpage main body element;
Page parsing module, is configured to load in described browser side obtain the page, and the webpage main body element in the page is resolved, this webpage main body element is converted to DOM object;
DOM processing module, being configured to the DOM object handles module calling at least one webpage main body element of described setting and the DOM object of described conversion carries out the customized treatment of described setting, in this customized treatment, the webpage main body element of current page is configured by the web page background pictorial information according to described setting;
Render processing module, be configured to the dom tree to completing webpage main body element customized treatment and render process.
Alternatively, described DOM processing module is additionally configured to:
The background information of the webpage main body element of user setup is obtained from the DOM object of described conversion;
The analysis result of the background information according to described user setup, calls corresponding DOM object handles module and the DOM object of described conversion carries out the customized treatment of described setting.
Alternatively, described background information includes 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 additionally configured to call this part DOM object handles module the background image of the page is modified.
Alternatively, the order of described DOM processing module change background image include following arbitrarily it
Change according to described background image tab sequential;
Change according to described background image list backward;
According to described background image list circulation change;
Change according to described background image list random order.
Alternatively, above-mentioned browser also includes acquisition module, is configured to obtain the script process of image change order from browser side;Now,
Described DOM processing module is additionally configured to, according to described script process, call the background image order respective change according to background image list of described webpage main body element.
Alternatively, above-mentioned browser also includes:
Enquiry module, is configured to inquire about from object handles registration table whether there is the DOM object handles module that described webpage main body element is processed in described browser, wherein, and registration at least one DOM object handles module described in described object handles registration table.
Alternatively, when described DOM processing module is additionally configured to the ContentReady event triggered when described webpage main body element has loaded, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handles module calling at least one webpage main body element of described setting.
Alternatively, when described DOM processing module is additionally configured to the DocumentReady event triggered when web page files has loaded, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handles module calling at least one webpage main body element 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 method that webpage main body element is processed, it is 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, including:
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 described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting, and in this customized treatment, the webpage main body element of current page is configured by the web page background pictorial information according to described setting;
The dom tree completing webpage main body element customized treatment is rendered process.
Alternatively, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting, including:
The background information of the webpage main body element of user setup is obtained from the DOM object of described conversion;
The analysis result of the background information according to described user setup, calls the corresponding DOM object handler DOM object to described conversion and carries out the customized treatment of described setting.
Alternatively, described background information includes background image list.
Alternatively, when at least piece image stored in part DOM object handler in described background image list,
The DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting, including: call this part DOM object handler and the background image of the page is modified.
Alternatively, the change order of described background image include following one of arbitrarily:
Change according to described background image tab sequential;
Change according to described background image list backward;
According to described background image list circulation change;
Change according to described background image list random order.
Alternatively, said method also includes:
The script process of image change order is obtained from browser side;
According to described script process, call the background image order respective change according to background image list of described webpage main body element.
Alternatively, before calling the customized treatment that the DOM object of described conversion is carried out described setting by the DOM object handler of at least one webpage main body element of described setting, including:
Inquire about from object handles registration table in described browser and whether there is the DOM object handler that described webpage main body element is processed, 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 described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting.
Alternatively, during the DocumentReady event triggered when web page files has loaded, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element 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 being registered in described object handles registration table by each DOM object handler, described 4th interface and client associate;
Call the DOM object handler of at least one webpage main body element of described setting, including:
Core engine calls behavior querying method by first interface, and inquiry client is about second interface of M_BODY, and provides described 4th interface associated, receives the object instance that client returns;
Described core engine, when loading webpage main body 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, arrange its DOM object handles module being customized process at network side, in the acquisition process of the page, utilize the customized treatment that DOM object is configured by the DOM object handles module called.Owing at least one DOM object handles module can store at least one customized treatment mode, therefore, it can webpage main body element carries out at least one process, and then different elements in webpage main body element can be adjusted present different conditions.As can be seen here, adopting the browser that webpage main body element is processed that the embodiment of the present invention provides, it is possible to the different DOM objects in webpage main body element are respectively processed, the webpage main body element thus presented can realize personalized customization and 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 content that webpage main body element can present by user and carry out the purpose of personalized customization, meeting the preference of different users, the impression improving user is experienced.
Described above is only the general introduction of technical solution of the present invention, in order to better understand the technological means of the present invention, and can be practiced according to the content of description, and in order to 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.
Accompanying drawing explanation
By reading hereafter detailed description of the preferred embodiment, various other advantage and benefit those of ordinary skill in the art be will be clear from understanding.Accompanying drawing is only for illustrating the purpose of preferred implementation, and is not considered as limitation of the present invention.And in whole accompanying drawing, it is denoted by the same reference numerals identical parts.In the accompanying drawings:
Fig. 1 illustrates the structural representation of the browser according to an embodiment of the invention webpage main body element processed;
Fig. 2 illustrates the flow chart of the method according to an embodiment of the invention webpage main body element processed;And
Fig. 3 illustrates the structural representation of the browser according to an embodiment of the invention webpage main body element processed.
Detailed description of the invention
It is more fully described the exemplary embodiment of the disclosure below with reference to accompanying drawings.Although accompanying drawing showing the exemplary embodiment of the disclosure, it being understood, however, that may be realized in various forms the disclosure and should do not limited by embodiments set forth here.On the contrary, it is provided that these embodiments are able to be best understood from the disclosure, and complete for the scope of the present disclosure can be conveyed to those skilled in the art.
For solving the technical problem mentioned in background of invention, embodiments providing a kind of browser that webpage main body element is processed, this browser side is provided with web page background pictorial information.Fig. 1 illustrates the structural representation of the browser that webpage main body element is processed according to an embodiment of the invention.This browser includes the DOM object handles module 110 of at least one Password Input frame element, page parsing module 120, DOM processing module 130 and renders processing module 140.The function of each module now browser included 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, and in each DOM object handles module, storage has the customized treatment to webpage main body element.The quantity of DOM object handles module can be 1, it is also possible to is 2, it is also possible to is 3,4,5 or more, and concrete quantity determines according to the quantity of specific DOM object and the quantity of customized treatment.In order to illustrate in Fig. 1, it is set to 3.
Secondly, page parsing module 120 is introduced.When the page obtained is processed, page parsing module 120 loads in browser side and obtains the page.Considering that the page and page elements can not be made directly process, therefore, page parsing module 120 needs the webpage main body element in the page is resolved, and this webpage main body element is converted to DOM object, processes for follow-up DOM module 130.
Then, DOM processor 130 is introduced.Being couple to page parsing module 120 referring to Fig. 1, DOM processing module 130 one end, the other end is couple to the DOM object handles module 110 of at least one the password box element pre-seted in browser side.After the parsing of webpage main body element and conversion operation are terminated, DOM processing module 130 can call the customized treatment that the DOM object of conversion is configured by the DOM object handles module 110 of at least one webpage main body element of setting, according to the web page background pictorial information arranged, the webpage main body element of current page is configured in this customized treatment.
Finally, introduction renders processing module 140.Referring to Fig. 1, render processing module 140 and be couple to DOM processing module 130.After the customized treatment of DOM processing module 130 operates and terminates, treated DOM object can form dom tree, then renders process by rendering the processing module 140 dom tree to completing webpage main body element customized treatment.
In embodiments of the present invention, for each DOM object that webpage main body element parses, arrange its DOM object handles module being customized process at network side, in the acquisition process of the page, utilize the customized treatment that DOM object is configured by the DOM object handles module called.Owing at least one DOM object handles module can store at least one customized treatment mode, therefore, it can webpage main body element carries out at least one process, and then different elements in webpage main body element can be adjusted present different conditions.As can be seen here, adopting the browser that webpage main body element is processed that the embodiment of the present invention provides, it is possible to the different DOM objects in webpage main body element are respectively processed, the webpage main body element thus presented can realize personalized customization and 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 content that webpage main body element can present by user and carry out the purpose of personalized customization, meeting the preference of different users, the impression improving user is experienced.
Select the purpose of different background informations for the demand reached according to user, DOM processing module 130 can obtain the background information of the webpage main body element of user setup from the DOM object of conversion.Then, the analysis result according to the background information of user setup, DOM processing module 130 calls the customized treatment that the corresponding DOM object handles module DOM object to conversion is configured.
The background information mentioned in the present embodiment includes polytype, for instance, it is possible to include background image list, it is also possible to include background music list, it is also possible to include background video list, etc..Illustrate for background image list herein.Background image list is made up of multiple image, each width image has carried out coding and has sorted accordingly, and just it shows and calls more convenient.
When background information is background image list, part DOM object handles module 110 stores at least piece image in background image list.Accordingly, now, DOM processing module 130 is additionally configured to call this part DOM object handles module 110 background image of the page is modified.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, it is thereby achieved that the purpose of the demand amendment background according to user.
Mentioned 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, DOM processing module 130 changes the order of background image can follow certain order, such as, can change according to background image tab sequential, can also change according to background image list backward, it is also possible to according to background image list circulation change, and 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, referring to Fig. 1, browser also sets up acquisition module 150, utilize 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, 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.
Wherein, call operation for DOM object handles module 110, DOM processing module 130 is it is to be appreciated that the address of each DOM object handles module 110, and then call accordingly, if DOM object handles module is more and stores address relative distribution, 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, registering the register information of all of DOM object handles module in this form, whether called etc. register information herein can include the customization operations, of the storage address of each DOM object handles module, each DOM object handles module.Accordingly, referring to Fig. 1, the browser that page password box is processed that the embodiment of the present invention provides also includes enquiry module 160.This enquiry module 160 couples with DOM processing module 130, whether there is the DOM object handles module that web page element element is processed 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 having at least two event, one is the event ContentReady that this DOM object has triggered when having loaded, and another is the whole HTML event DocumentReady triggered when all having loaded.Owing to the present embodiments relate to that webpage main body element is processed, therefore event ContentReady, the DOM processing module 130 merely relating to trigger when this DOM object has loaded can call the customized treatment that the DOM object of conversion is configured by the DOM object handles module 110 of at least one webpage main body element of setting.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, call the customized treatment that the DOM object of conversion is configured by the DOM object handles module 110 of at least one webpage main body element of setting.
Preferably, when browser is IE browser, webpage main body element can be stored in body element.
The above-mentioned each several part framework to the browser that page text frame processes provides according to its function, and actual framework is not limited in each part mentioned above, it is also possible to include other parts, module, device etc..
Fig. 2 illustrates that browser processes the process chart of the method for webpage main body element according to an embodiment of the invention.In this example, being 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 to step S206.
Step S202, load in 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.
Step S204, call the DOM object handler of at least one webpage main body element of the setting customized treatment that is configured of DOM object to conversion, the webpage main body element of current page is configured according to the web page background pictorial information arranged by this customized treatment.
Step S206, the dom tree completing webpage main body element customized treatment is rendered process.
In embodiments of the present invention, for each DOM object that webpage main body element parses, arrange its DOM object handler being customized process at network side, in the acquisition process of the page, utilize the customized treatment that DOM object is configured by the DOM object handler called.Owing at least one DOM object handler can store at least one customized treatment mode, therefore, it can webpage main body element carries out at least one process, and then different elements in webpage main body element can be adjusted present different conditions.As can be seen here, adopting the method that webpage main body element is processed that the embodiment of the present invention provides, it is possible to the different DOM objects in webpage main body element are respectively processed, the webpage main body element thus presented can realize personalized customization and 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 content that webpage main body element can present by user and carry out the purpose of personalized customization, meeting the preference of different users, the impression improving user is experienced.
It should be noted that what the function of DOM object handler in this flow process and DOM object handles module mentioned above was similar to, because foregoing relates to the framework of browser, therefore it is referred to as DOM object handles module.And this flow process only relates to one parts of DOM object handler, therefore, referred to as module, hereinafter need not repeat no more.
The customized treatment that the DOM object of conversion is configured by the DOM object handler of at least one webpage main body element calling setting is mentioned when implementing referring to Fig. 2, step S204.Preferably, it is possible to from the DOM object of conversion, obtain the background information of the webpage main body element of user setup.And then, the analysis result according to the background information of user setup, calls the customized treatment that the corresponding DOM object handler DOM object to conversion is configured.
Wherein, the background information mentioned in the present embodiment includes polytype, for instance, it is possible to include background image list, it is also possible to include background music list, it is also possible to include background video list, etc..Illustrate for background image list herein.Background image list is made up of multiple image, each width image has carried out coding and has sorted accordingly, and just it shows and calls more convenient.
When background information is background image list, it is possible to store at least piece image in background image list in part DOM object handler.Accordingly, call the customized treatment that the DOM object of conversion is configured by the DOM object handler of at least one webpage main body element of setting, including: this part DOM object handler can be called the background image of the page is modified.
Mentioned above, it is possible to realize the change of background image 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, can also change according to background image list backward, it is also possible to according to background image list circulation change, and 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.
Wherein, for the call operation of DOM object handler, it is necessary to know the address of each DOM object handler, and then call accordingly, if DOM object handler is more and stores address relative distribution, it calls will exist certain difficulty.A kind of preferred method of calling is now provided, in this example, object handles registration table is set, registering the register information of all of DOM object handler in this form, whether called etc. register information herein can include the customization operations, of the storage address of each DOM object handler, each DOM object handler.Accordingly, referring to Fig. 1, whether the browser that webpage main body element is processed that the embodiment of the present invention provides exists the DOM object handler that webpage main body element is processed 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 having at least two event, one is the event ContentReady that this DOM object has triggered when having loaded, and another is the whole HTML event DocumentReady triggered when all having loaded.Owing to the present embodiments relate to that webpage main body element is processed, therefore the event ContentReady triggered when this DOM object has loaded is merely related to, it is possible to call the customized treatment that the DOM object of conversion is configured by the DOM object handler of at least one webpage main body element of setting.Further, during the DocumentReady event that the embodiment of the present invention can also trigger when web page files has loaded, call the customized treatment that the DOM object of conversion is configured by the DOM object handler of at least one webpage main body element of setting.
Embodiment one
The browser being mentioned in the embodiment of the present invention can be multiple, for instance the InternetExplorer(of Microsoft is called for short IE), MozillaFirefox, Chrome, Opera of Google and Apple Safari etc..
The concrete processing method of the text box element now for IE browser, the embodiment of the present invention provided is set forth in and illustrates.
For the particular procedure for each web page element, it may be necessary to realize
IElementBehavior(element behavior)
ImplementingtheIElementBehaviorInterface(performs element behavior interface)
ImplementingtheNotifyMethod(performs Notification Method)
ImplementingtheInitMethod(performs initial method)
ImplementingtheDetachMethod(performs separation method)
IElementBehaviorFactory(element behavior factory behavior)
IElementNamespaceFactory(element NameSpace factor interface)
IElementNamespaceFactoryCallback(element NameSpace callback interface)
After Initialize installation, the client WebBrowser(web browser in IE browser) plug-in unit realizes web page element concrete to process step 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 here is exactly in the detailed description of the invention in IE of the par-ticular processor for specific DOM object, realize IDocHostUIHandler interface to adopt by DOM processor for par-ticular processor is registered in object registry, it is achieved IElementBehaviorFactory and IElementBehavior interface is 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 the BehaviorName of page elements TAG and correspondence to MSHTML.
Note: MSHTML corresponds to core engine, and this step inquires about all of DOM object handler list corresponding to DOM processor.
When step 4, the page load, MSHTML according to BehaviorName provided above, can call the FindBehavior method of IElementBehaviorFactory one by one, client provide the IElementBehavior interface about M_BODY to realize.
Herein, it is preferred that and associate with the corresponding interface IElementBehaviorSite of page offer, 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 object (OBJECT) element, broadcasting MP3 or FLASH.
Note: web page body behavior Notification Method realizes available CBodyIElementBehavior::Notify method in IE.
Wherein it is possible to establishment intervalometer, carousel Background.
Wherein, it is notable that step 4 and step 5 are called corresponding DOM object handler corresponding to DOM processing module and DOM object is processed.
The method of the present embodiment also not only limits IE browser, and for other browsers, its implementation is similar to.
Embodiment two
Present embodiments provide the concrete grammar that webpage main body element is processed.
Before the page loads, obtain the background information of user setup, including background image list, background music list etc..
Further, when loading the page, obtain the background (background) in body element and arrange, be revised as first figure in display background image list.
Then, background music is set in body element.
Finally, js code is set so that the background image of body element changes according to list content.
Embodiment three
Above-described is directly webpage main body element is processed, it is well known that the page elements of browser has multiple, and browser needs each page elements all to be changed and processes, and is then rendered by the page elements after process, just generates the webpage presented.
Fig. 3 illustrates the structural representation of the browser carrying out page elements process according to an embodiment of the invention.Referring to Fig. 3, this browser includes at least one the DOM object handler 310 being arranged on browser side, page parsing device 320 and DOM processor 330.
Wherein, DOM object handler 310 includes at least one, and is set in advance in browser side, and in each DOM object handler 310, storage has the customized treatment of specific DOM object.The quantity of DOM object handler can be 1, it is also possible to is 2, it is also possible to is 3,4,5 or more, and concrete quantity determines according to the quantity of specific DOM object and the quantity of customized treatment.In order to illustrate in Fig. 3, it is set to 3.
When the page obtained is processed, page parsing device 320 loads this acquisition page in browser side, and the page elements obtaining the page is resolved.Considering that the page and page elements can not be made 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.
Referring to Fig. 3, DOM processor 330, it is 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 DOM object processed as current preparation in the DOM object of conversion, calls at least one DOM object handler 310 of setting, the customized treatment that the DOM object selected is configured.
Referring to Fig. 3, this browser also includes tree maker 330, is couple to DOM processor 330.When DOM processor 330 calls DOM object handler 310, DOM object being customized after process terminates, tree maker 330 utilizes the DOM object of the customized treatment through arranging to generate final dom tree, and dom tree is rendered.
And webpage main body element is the one of page elements, therefore, when page elements is webpage main body element, utilizing the device that browser carries out page elements process directly webpage main body element to be processed, the customized treatment mode of the DOM object handler storage of its selection is the customized treatment for webpage main body element.It is to say, 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 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), current DOM object is carried out respective handling.
Adopt browser provided by the invention and corresponding processing method, it is possible to reach following beneficial effect:
In embodiments of the present invention, for each DOM object that webpage main body element parses, arrange its DOM object handles module being customized process at network side, in the acquisition process of the page, utilize the customized treatment that DOM object is configured by the DOM object handles module called.Owing at least one DOM object handles module can store at least one customized treatment mode, therefore, it can webpage main body element carries out at least one process, and then different elements in webpage main body element can be adjusted present different conditions.As can be seen here, adopting the browser that webpage main body element is processed that the embodiment of the present invention provides, it is possible to the different DOM objects in webpage main body element are respectively processed, the webpage main body element thus presented can realize personalized customization and 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 content that webpage main body element can present by user and carry out the purpose of personalized customization, meeting the preference of different users, the impression improving user is experienced.
Not intrinsic to any certain computer, virtual system or miscellaneous equipment relevant in algorithm and the display of this offer.Various general-purpose systems can also with use based on together with this teaching.As described above, the structure constructed required by this kind of system is apparent from.Additionally, the present invention is also not for any certain programmed language.It is understood that, it is possible to utilize various programming language to realize the content of invention described herein, and the description above language-specific done is the preferred forms in order to disclose the present invention.
In description mentioned herein, describe a large amount of detail.It is to be appreciated, however, that embodiments of the invention can be put into practice when not having these details.In some instances, known method, structure and technology it are not shown specifically, in order to do not obscure the understanding of this description.
Similarly, it is to be understood that, one or more in order to what simplify that the disclosure helping understands in each inventive aspect, herein above in the description of the exemplary embodiment of the present invention, each feature of the present invention is grouped together in single embodiment, figure or descriptions thereof sometimes.But, the method for the disclosure should be construed to and reflect an intention that namely the present invention for required protection requires feature more more than the feature being expressly recited in each claim.More precisely, as the following claims reflect, inventive aspect is in that all features less than single embodiment disclosed above.Therefore, it then follows claims of detailed description of the invention are thus expressly incorporated in this detailed description of the invention, wherein each claim itself as the independent embodiment of the present invention.
Those skilled in the art are appreciated that, it is possible to carry out the module in the equipment in embodiment adaptively changing and they being 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 excludes each other, it is possible to adopt any combination that all processes or the unit of all features disclosed in this specification (including adjoint claim, summary and accompanying drawing) and so disclosed any method or equipment are combined.Unless expressly stated otherwise, each feature disclosed in this specification (including adjoint claim, summary and accompanying drawing) can be replaced by the alternative features providing purpose identical, equivalent or similar.
In addition, those skilled in the art it will be appreciated that, although embodiments more described herein include some feature included in other embodiments rather than further feature, but the combination of the feature of different embodiment means to be within the scope of the present invention and form different embodiments.Such as, in the following claims, the one of any of embodiment required for protection can mode use in any combination.
The all parts embodiment of the present invention can realize with hardware, or realizes 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 microprocessor or digital signal processor (DSP) can be used in practice to realize browser according to embodiments of the present invention carries out the some or all functions of the some or all parts in the device of page elements process.The present invention is also implemented as part or all the equipment for performing method as described herein or device program (such as, computer program and computer program).The program of such present invention of realization can store on a computer-readable medium, or can have the form of one or more signal.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 rather than limits the invention to it should be noted above-described embodiment, and those skilled in the art can design alternative embodiment without departing from the scope of the appended claims.In the claims, any reference marks that should not will be located between bracket is configured to limitations on claims.Word " comprises " and does not exclude the presence of the element or step not arranged in the claims.Word "a" or "an" before being positioned at element does not exclude the presence of multiple such element.The present invention by means of including the hardware of some different elements and can realize by means of properly programmed computer.In the unit claim listing some devices, several in these devices can be through same hardware branch and specifically embody.Word first, second and third use do not indicate that any order.Can be title by these word explanations.

Claims (18)

1. browser webpage main body element processed, this browser side is provided with web page background pictorial information, and this browser includes:
The DOM object handles module of at least one webpage main body element, wherein each DOM object handles module is configured to store the user's personalized customized treatment to webpage main body element;
Page parsing module, is configured to load in described browser side obtain the page, and the webpage main body element in the page is resolved, this webpage main body element is converted to DOM object;
DOM processing module, being configured to the DOM object handles module calling at least one webpage main body element of described setting and the DOM object of described conversion carries out the customized treatment of described setting, in this customized treatment, the webpage main body element of current page is configured by the web page background pictorial information according to described setting;
Render processing module, be configured to the dom tree to completing webpage main body element customized treatment and render process.
2. browser according to claim 1, it is characterised in that described DOM processing module is additionally configured to:
Obtaining the background information of the webpage main body element of user setup from the DOM object of described conversion, wherein, described background information includes background image list, and described background image list is made up of multiple image, each width image has carried out coding and has sorted accordingly;
The analysis result of the background information according to described user setup, calls corresponding DOM object handles module and the DOM object of described conversion carries out the customized treatment of described setting.
3. browser according to claim 2, it is characterised 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 additionally configured to call this part DOM object handles module the background image of the page is modified.
4. browser according to claim 3, it is characterised in that the order of described DOM processing module change background image include following one of arbitrarily:
Change according to described background image tab sequential;
Change according to described background image list backward;
According to described background image list circulation change;
Change according to described background image list random order.
5. the browser according to any one of Claims 1-4, it is characterised in that also include acquisition module, is configured to obtain the script process of image change order from browser side;Then,
Described DOM processing module is additionally configured to, according to described script process, call the background image order respective change according to background image list of described webpage main body element.
6. the browser according to any one of Claims 1-4, it is characterised in that also include:
Enquiry module, is configured to inquire about from object handles registration table whether there is the DOM object handles module that described webpage main body element is processed in described browser, 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 additionally configured to the ContentReady event triggered when described webpage main body element has loaded, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handles module calling at least one webpage main body element 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 additionally configured to the DocumentReady event triggered when web page files has loaded, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handles module calling at least one webpage main body element of described setting.
9. the browser according to any one of Claims 1-4, it is characterised in that when described browser is IE browser, described webpage main body element is stored in body element.
10. the method that webpage main body element is processed, it is 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 user's personalized customized treatment to webpage main body element, including:
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 described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting, and in this customized treatment, the webpage main body element of current page is configured by the web page background pictorial information according to described setting;
The dom tree completing webpage main body element customized treatment is rendered process.
11. method according to claim 10, it is characterised in that the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting, including:
Obtaining the background information of the webpage main body element of user setup from the DOM object of described conversion, wherein, described background information includes background image list, and described background image list is made up of multiple image, each width image has carried out coding and has sorted accordingly;
The analysis result of the background information according to described user setup, calls the corresponding DOM object handler DOM object to described conversion and carries out the customized treatment of described setting.
12. method according to claim 11, it is characterised in that when at least piece image stored in part DOM object handler in described background image list,
The DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting, including: call this part DOM object handler and the background image of the page is modified.
13. method according to claim 12, it is characterised in that the change order of described background image include following one of arbitrarily:
Change according to described background image tab sequential;
Change according to described background image list backward;
According to described background image list circulation change;
Change according to described background image list random order.
14. according to the method described in any one of claim 10 to 13, it is characterised in that also include:
The script process of image change order is obtained from browser side;
According to described script process, call the background image order respective change according to background image list of described webpage main body element.
15. according to the method described in any one of claim 10 to 13, it is characterised in that before calling the customized treatment that the DOM object of described conversion is carried out described setting by the DOM object handler of at least one webpage main body element of described setting, including:
Inquire about from object handles registration table in described browser and whether there is the DOM object handler that described webpage main body element is processed, wherein, registration at least one DOM object handler described in described object handles registration table.
16. according to the method described in any one of claim 10 to 13, it is characterized in that, during the ContentReady event triggered when described webpage main body element has loaded, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting.
17. according to the method described in any one of claim 10 to 13, it is characterized in that, during the DocumentReady event triggered when web page files has loaded, the DOM object of described conversion is carried out the customized treatment of described setting by the DOM object handler calling at least one webpage main body element of described setting.
18. according to the method described in any one of claim 10 to 13, 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 for being registered in described object handles registration table by each DOM object handler, described 4th interface and client associate;
Call the DOM object handler of at least one webpage main body element of described setting, including:
Core engine calls behavior querying method by first interface, and inquiry client is about second interface of M_BODY, and provides described 4th interface associated, receives the object instance that client returns;
Described core engine, when loading webpage main body element, calls element behavior Notification Method, the stress state of notice customer terminal webpage element.
CN201210453663.XA 2012-11-13 2012-11-13 The browser that webpage main body element is processed and method Active CN102981844B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210453663.XA CN102981844B (en) 2012-11-13 2012-11-13 The browser that webpage main body element is processed and method

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210453663.XA CN102981844B (en) 2012-11-13 2012-11-13 The browser that webpage main body element is processed and method

Publications (2)

Publication Number Publication Date
CN102981844A CN102981844A (en) 2013-03-20
CN102981844B true CN102981844B (en) 2016-07-13

Family

ID=47855909

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210453663.XA Active CN102981844B (en) 2012-11-13 2012-11-13 The browser that webpage main body element is processed and method

Country Status (1)

Country Link
CN (1) CN102981844B (en)

Families Citing this family (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102981848B (en) * 2012-11-13 2015-12-09 北京奇虎科技有限公司 Webpage main body element process browser and method
US9996512B2 (en) * 2012-11-13 2018-06-12 Beijing Qihoo Technology Company Limited Customized processing of DOM objects
CN106919598A (en) * 2015-12-24 2017-07-04 广州市动景计算机科技有限公司 Webpage content display method and system
US10452748B2 (en) * 2016-06-20 2019-10-22 Microsoft Technology Licensing, Llc Deconstructing and rendering of web page into native application experience
CN106354792B (en) * 2016-08-24 2020-03-17 北京小米移动软件有限公司 Webpage display method and device
CN108089856B (en) * 2016-11-22 2021-06-08 北京国双科技有限公司 Page element monitoring method and device
CN111221505A (en) * 2019-12-31 2020-06-02 上海汇贯实业有限公司 Website webpage design system and method
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
CN1310415A (en) * 2000-02-24 2001-08-29 国际商业机器公司 Custom HTML of service device terminal based on form and a target equipment
WO2008122202A1 (en) * 2007-04-04 2008-10-16 The Hong Kong University Of Science And Technology Custom rendering of webpages on mobile devices
CN102214244A (en) * 2011-07-07 2011-10-12 深圳市万兴软件有限公司 Analytic method and system for docx file information
CN102981848A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Webpage main body element processing browser and method

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1310415A (en) * 2000-02-24 2001-08-29 国际商业机器公司 Custom HTML of service device terminal based on form and a target equipment
WO2008122202A1 (en) * 2007-04-04 2008-10-16 The Hong Kong University Of Science And Technology Custom rendering of webpages on mobile devices
CN102214244A (en) * 2011-07-07 2011-10-12 深圳市万兴软件有限公司 Analytic method and system for docx file information
CN102981848A (en) * 2012-11-13 2013-03-20 北京奇虎科技有限公司 Webpage main body element processing browser and method

Also Published As

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

Similar Documents

Publication Publication Date Title
CN102981844B (en) The browser that webpage main body element is processed and method
CN102981848B (en) Webpage main body element process browser and method
CN102999578B (en) Page elements treatment process and device
CN102999579B (en) Page text frame process browser and page text frame element disposal route
CN102981845B (en) Browser carries out method and the device of page elements process
US20190243866A1 (en) Mobile enablement of existing web sites
EP2916243B1 (en) Method, apparatus, server and system for implementing web application
CN105094786B (en) Method and system based on JavaScript customized web page
US20100223322A1 (en) Server based framework for improving ajax performance
US20150074561A1 (en) Customizable themes for browsers and web content
US9747117B2 (en) System and methods for loading an application and its modules in a client device
CN111639278B (en) Webpage loading method and device
CN103019817B (en) A kind of method and apparatus mutual for the page
CN102915366B (en) A kind of browser loads the method and apparatus of webpage
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
CN105183890B (en) Webpage loading method based on browser and browser device
CN102981847B (en) The browser that page text frame is processed and method
CN105516333A (en) Interactive method and system based on webpage
CN110795650A (en) Webpage opening method and device and computer readable storage medium
CN105447198A (en) Convenient page script importing method and device
CN102929484A (en) Browser skin loading display method and browser skin loading display device
CN105528369A (en) Webpage transcoding method and device and server
CN105630310A (en) Method and device for displaying titles during graph group switching
CN105005596B (en) page display method and device

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

Effective date of registration: 20220809

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.

TR01 Transfer of patent right