CN102981847B - The browser that page text frame is processed and method - Google Patents
The browser that page text frame is processed and method Download PDFInfo
- Publication number
- CN102981847B CN102981847B CN201210454662.7A CN201210454662A CN102981847B CN 102981847 B CN102981847 B CN 102981847B CN 201210454662 A CN201210454662 A CN 201210454662A CN 102981847 B CN102981847 B CN 102981847B
- Authority
- CN
- China
- Prior art keywords
- text box
- box element
- dom object
- processing
- browser
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Landscapes
- Document Processing Apparatus (AREA)
- Information Transfer Between Computers (AREA)
Abstract
Description
技术领域technical field
本发明涉及网络应用领域,具体涉及一种对页面文本框进行处理的浏览器以及利用浏览器进行页面文本框进行处理的方法。The invention relates to the field of network applications, in particular to a browser for processing a page text box and a method for processing the page text box by using the browser.
背景技术Background technique
随着国际互联网的快速发展,基于国际互联网的应用和信息也呈现出爆发性的增长。网络浏览器为互联网用户提供了一种访问网络信息和使用网络应用的方式,该方式适用性强,越多越多的用户已经习惯于通过网络浏览器来获取各种信息和使用各种应用。网络信息和应用供应商提供以诸如HTML(超文本标记语言,HypertextMarkupLanguage)之类格式的语言编写的网页,网络浏览器在用户处呈现这些网页,从而使得网络浏览器的用户可以获取相关信息。随着网络技术的快速发展,由网络浏览器呈现的内容也越来越丰富,因此网络浏览器的呈现功能也越来越强大和重要。目前常见的网页浏览器有微软公司的InternetExplorer、MozillaFirefox、谷歌公司的Chrome、Opera以及苹果公司的Safari等等。With the rapid development of the Internet, Internet-based applications and information also show explosive growth. A web browser provides Internet users with a way to access network information and use network applications. This method has strong applicability, and more and more users have become accustomed to obtaining various information and using various applications through a web browser. Web information and application providers provide web pages written in a language such as HTML (Hypertext Markup Language), and web browsers present these web pages at users, so that users of web browsers can obtain relevant information. With the rapid development of network technology, the content presented by the web browser is becoming more and more abundant, so the presentation function of the web browser is becoming more and more powerful and important. Currently common web browsers include Microsoft's Internet Explorer, Mozilla Firefox, Google's Chrome, Opera, Apple's Safari, and the like.
在相关技术中,网络浏览器利用渲染引擎(RenderingEngine)来解释网页中的内容(如HTML、JavaScript)并渲染(显示)网页。渲染引擎决定了浏览器如何显示网页的内容以及页面的格式信息。不同的渲染引擎对网页编写语法的解释也有不同,因此同一网页在不同渲染引擎的浏览器里的渲染(显示)效果也可能不同。In related technologies, a web browser utilizes a rendering engine (Rendering Engine) to interpret content (such as HTML, JavaScript) in a web page and render (display) the web page. The rendering engine determines how the browser displays the content of the web page and the formatting information of the page. Different rendering engines interpret web page writing syntax differently, so the rendering (display) effect of the same web page in browsers with different rendering engines may also be different.
目前网页浏览器的渲染引擎通过将HTML中的各个元素以及js代码转换成DOM模型来进行渲染。在进行转换时,整个HTML文档被构建DOM树,HTML中的各元素被转换成DOM树中的对象,而对象之间的关系被构造为节点和子节点之间的关系来构造,通过使用有关对象的方法,可以对这些对象进行寻址和操作。DOM模型已经具有很多公共的规范和定义。At present, the rendering engine of the web browser performs rendering by converting each element in HTML and js code into a DOM model. When converting, the entire HTML document is constructed as a DOM tree, each element in the HTML is converted into an object in the DOM tree, and the relationship between objects is constructed as the relationship between nodes and sub-nodes, by using related objects methods for addressing and manipulating these objects. The DOM model already has many common specifications and definitions.
当网页浏览器处理HTML页面时,浏览器中的渲染引擎对HTML页面语言进行分析,将其处理为DOM模型,随后利用DOM模型来构造用于在浏览器中显示页面的内部结构。DOMAPI还向js代码提供了监控或者修改网页的接口。When a web browser processes an HTML page, the rendering engine in the browser analyzes the language of the HTML page, processes it into a DOM model, and then utilizes the DOM model to construct an internal structure for displaying the page in the browser. DOMAPI also provides an interface for monitoring or modifying web pages to js code.
渲染引擎引入了基于事件的机制来处理DOM对象。每个DOM对象具有相关联的多个事件,并且这些事件可以被触发。例如,渲染引擎分析网页中的JS代码,并且将相应JS代码和事件相关联,从而使得到特定事件被触发时,执行相应的JS代码。The rendering engine introduces an event-based mechanism to handle DOM objects. Each DOM object has a number of events associated with it, and these events can be fired. For example, the rendering engine analyzes the JS code in the webpage, and associates the corresponding JS code with an event, so that when a specific event is triggered, the corresponding JS code is executed.
然而,在目前的网页浏览器中,渲染引擎通常仅仅根据HTML网页中的JS代码来控制相应DOM对象,因此,用户使用浏览器时很难对DOM对象,即网页中的各个元素进行定制渲染。However, in current web browsers, the rendering engine usually only controls the corresponding DOM objects according to the JS code in the HTML webpage. Therefore, it is difficult for the user to perform custom rendering on the DOM objects, that is, each element in the webpage, when using the browser.
文本框(textarea)是网页中适合输入大量文字的元素,目前很多网络应用提供商都利用textarea元素来为用户提供输入个人简介、评论等接口。随着用户互动的增多,textarea的应用也越来越广泛。现有的网页浏览器在显示文本区域输入框(textarea)时,在javascript代码和css等控制下,可以规定textarea的列数和栏数,textarea中输入的文字大小、字体以及位置等信息。但是,在文本区域输入框中的文字的显示方式是一致的,难以为不同的文字规定不同的字体,也难以在文本框中输入类似于表格、图像以及音频等多媒体信息。因此,目前需要对textarea的呈现和处理方式进行改进,以便提供更丰富的输入和呈现方式。A text area (textarea) is an element suitable for entering a large amount of text in a web page. Currently, many network application providers use the textarea element to provide users with interfaces for inputting personal profiles and comments. With the increase of user interaction, the application of textarea is becoming more and more extensive. When an existing web browser displays a textarea input box (textarea), under the control of javascript code and css, the number of columns and columns of the textarea, the size, font and position of the text entered in the textarea can be specified. However, the display modes of the characters in the text area input boxes are consistent, and it is difficult to specify different fonts for different characters, and it is also difficult to input multimedia information such as tables, images, and audio in the text boxes. Therefore, it is currently necessary to improve the rendering and processing methods of the textarea in order to provide richer input and rendering methods.
发明内容Contents of the invention
鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的对页面文本框进行处理的浏览器和相应的浏览器对页面文本框进行处理的方法。In view of the above problems, the present invention is proposed to provide a browser for processing page text boxes and a corresponding browser method for processing page text boxes, which overcome the above problems or at least partially solve the above problems.
依据本发明的一个方面,提供了一种对页面文本框进行处理的浏览器,包括:至少一个文本框元素的DOM对象处理模块,设置在浏览器侧,其中每个对象处理模块配置为存储有文本框元素的定制处理;转换模块,配置为在浏览器侧加载获取页面,并对获取页面中的文本框元素进行解析,将该文本框元素转换为DOM对象;定制处理模块,配置为调用设置的至少一个文本框元素的DOM对象处理模块对转换的DOM对象中的至少一个文本框元素进行设置的定制处理;显示模块,配置为将定制处理结果显示在获取页面中的文本框元素上。According to one aspect of the present invention, there is provided a browser for processing page text boxes, including: at least one DOM object processing module of a text box element, which is arranged on the browser side, wherein each object processing module is configured to store Custom processing of text box elements; the conversion module is configured to load the acquisition page on the browser side, and parse the text box elements in the acquisition page, and convert the text box elements into DOM objects; the custom processing module is configured to call settings The DOM object processing module of at least one text box element performs custom processing on at least one text box element in the converted DOM object; the display module is configured to display the custom processing result on the text box element in the acquisition page.
可选地,定制处理模块还配置为从转换DOM对象中获取文本框元素在浏览器页面上的位置信息;根据位置信息,在文本框元素上生成重叠的块级层;在块级层上,调用设置的至少一个文本框元素的DOM对象处理模块对转换的DOM对象中的至少一个文本框元素进行设置的定制处理。Optionally, the custom processing module is also configured to obtain the position information of the text box element on the browser page from the converted DOM object; according to the position information, an overlapping block-level layer is generated on the text box element; on the block-level layer, calling the DOM object processing module of the at least one set text box element to perform custom processing of setting the at least one text box element in the converted DOM object.
可选地,显示模块还配置为将定制处理结果显示在位于获取页面的文本框元素上的块级层上。Optionally, the display module is further configured to display the customized processing result on a block-level layer located on the text box element of the acquisition page.
可选地,块级层包括div层时,显示模块还配置为获取文本框元素经定制处理后生成的内容信息;对内容信息进行解码,并将解码后的内容信息显示在div层上。Optionally, when the block-level layer includes a div layer, the display module is further configured to acquire content information generated by text box elements after customization; decode the content information, and display the decoded content information on the div layer.
可选地,上述浏览器还包括:查询模块,配置为从对象处理注册表中查询浏览器中是否存在对文本框元素进行处理的DOM对象处理模块,其中,对象处理注册表中登记至少一个DOM对象处理模块。Optionally, the above browser further includes: a query module configured to query from the object processing registry whether there is a DOM object processing module that processes the text box element in the browser, wherein at least one DOM object processing module is registered in the object processing registry Object processing module.
可选地,至少一个DOM对象处理模块中存储有规定对文本框元素加载完成时触发的事件ContentReady进行处理的处理方式。Optionally, at least one DOM object processing module stores a processing method for processing the event ContentReady triggered when the loading of the text box element is completed.
可选地,处理方式包括下列至少之一:为文本框元素中不同的文字设置不同的字体;在文本框元素中输入表格;在文本框元素中输入图像;在文本框元素中输入多媒体信息。Optionally, the processing method includes at least one of the following: setting different fonts for different characters in the text box element; inputting a table in the text box element; inputting an image in the text box element; inputting multimedia information in the text box element.
可选地,多媒体信息包括音频和/或视频。Optionally, the multimedia information includes audio and/or video.
可选地,块级层包括div层时,定制处理模块还配置为调用文本框元素的innerText属性;调用设置的至少一个文本框元素的DOM对象处理模块对innerText属性进行重定义;将文本框元素的重定义后的innerHTML属性返回至div层。Optionally, when the block-level layer includes a div layer, the custom processing module is also configured to call the innerText property of the text box element; call the set DOM object processing module of at least one text box element to redefine the innerText property; the text box element The redefined innerHTML property is returned to the div layer.
可选地,重定义操作包括:onblur或onSubmit的处理方式。Optionally, the redefinition operation includes: onblur or onSubmit processing.
依据本发明的另一个方面,提供了一种浏览器处理页面文本框元素的方法,在浏览器侧设置至少一个文本框元素的DOM对象处理器,其中每个对象处理器存储有文本框元素的定制处理,该方法包括:在浏览器侧加载获取页面,并对获取页面中的文本框元素进行解析,将该文本框元素转换为DOM对象;调用设置的至少一个文本框元素的DOM对象处理器对转换的DOM对象中的至少一个文本框元素进行设置的定制处理;将定制处理结果显示在获取页面中的文本框元素上。According to another aspect of the present invention, a kind of browser processing method of page text box element is provided, the DOM object processor of at least one text box element is set on the browser side, wherein each object processor is stored with the text box element Customized processing, the method includes: loading the acquired page on the browser side, parsing the text box element in the acquired page, and converting the text box element into a DOM object; calling the set DOM object processor of at least one text box element Perform custom processing for setting at least one text box element in the transformed DOM object; display the custom processing result on the text box element in the acquisition page.
可选地,调用设置的至少一个文本框元素的DOM对象处理器对转换的DOM对象中的至少一个文本框元素进行设置的定制处理,包括:从转换DOM对象中获取文本框元素在浏览器页面上的位置信息;根据位置信息,在文本框元素上生成重叠的块级层;在块级层上,调用设置的至少一个文本框元素的DOM对象处理器对转换的DOM对象中的至少一个文本框元素进行设置的定制处理。Optionally, call the DOM object processor of the at least one text box element that is set to perform custom processing for setting at least one text box element in the converted DOM object, including: obtaining the text box element from the converted DOM object on the browser page on the position information; according to the position information, generate an overlapping block-level layer on the text box element; on the block-level layer, call the set DOM object processor of at least one text box element to convert at least one text in the DOM object Box elements to set custom handling.
可选地,将定制处理结果显示在获取页面中的文本框元素上,包括:将定制处理结果显示在位于获取页面的文本框元素上的块级层上。Optionally, displaying the customized processing result on the text box element in the acquisition page includes: displaying the customized processing result on a block-level layer located on the text box element in the acquisition page.
可选地,块级层包括div层时,将定制处理结果显示在获取页面中的文本框元素上,包括:获取文本框元素经定制处理后生成的内容信息;对内容信息进行解码,并将解码后的内容信息显示在div层上。Optionally, when the block-level layer includes a div layer, displaying the customized processing result on the text box element in the acquisition page includes: acquiring the content information generated by the text box element after the customized processing; decoding the content information, and The decoded content information is displayed on the div layer.
可选地,调用设置的至少一个文本框元素的DOM对象处理器对转换的DOM对象中的至少一个文本框元素进行设置的定制处理之前,包括:从对象处理注册表中查询浏览器中是否存在对文本框元素进行处理的DOM对象处理器,其中,对象处理注册表中登记至少一个DOM对象处理器。Optionally, before calling the set DOM object processor of at least one text box element to perform custom processing on at least one text box element in the converted DOM object, it includes: querying from the object processing registry whether there is A DOM object processor for processing text box elements, wherein at least one DOM object processor is registered in the object processing registry.
可选地,至少一个DOM对象处理器中存储有规定对文本框元素加载完成时触发的事件ContentReady进行处理的处理方式。Optionally, at least one DOM object processor stores a processing method for processing the event ContentReady triggered when the loading of the text box element is completed.
可选地,处理方式包括下列至少之一:为文本框元素中不同的文字设置不同的字体;在文本框元素中输入表格;在文本框元素中输入图像;在文本框元素中输入多媒体信息。Optionally, the processing method includes at least one of the following: setting different fonts for different characters in the text box element; inputting a table in the text box element; inputting an image in the text box element; inputting multimedia information in the text box element.
可选地,多媒体信息包括音频和/或视频。Optionally, the multimedia information includes audio and/or video.
可选地,块级层包括div层时,调用设置的至少一个文本框元素的DOM对象处理器对转换的DOM对象中的至少一个文本框元素进行设置的定制处理,包括:调用文本框元素的innerText属性;调用设置的至少一个文本框元素的DOM对象处理器对innerText属性进行重定义;将文本框元素的重定义后的innerHTML属性返回至div层。Optionally, when the block-level layer includes a div layer, calling the set DOM object processor of at least one text box element to perform custom processing for setting at least one text box element in the converted DOM object includes: calling the text box element innerText attribute; call the DOM object processor of at least one set text box element to redefine the innerText attribute; return the redefined innerHTML attribute of the text box element to the div layer.
可选地,重定义操作包括:onblur或onSubmit的处理方式。Optionally, the redefinition operation includes: onblur or onSubmit processing.
可选地,浏览器为IE浏览器时,浏览器所在的客户端在WebBrowser插件设置第一接口IElementBehaviorFactory、第二接口IElementBehavior以及第三接口IDocHostUIHandler,其中,第一接口和第二接口用于调用各DOM对象处理器,第三接口用于将各DOM对象处理器注册到对象处理注册表中;调用设置的至少一个文本框元素的DOM对象处理器,包括:内核引擎根据浏览器所在的客户端提供的行为名称BehaviorName,通过第二接口调用与第一接口连接的设置的至少一个文本框元素的DOM对象处理器;以及内核引擎根据客户端提供的页面元素标识TAG加载对应的页面元素时,调用元素行为通知方法,通知客户端页面元素的加载状态。Optionally, when the browser is an IE browser, the client where the browser is located sets the first interface IElementBehaviorFactory, the second interface IElementBehavior and the third interface IDocHostUIHandler in the WebBrowser plug-in, wherein the first interface and the second interface are used to call each DOM object processor, the third interface is used to register each DOM object processor in the object processing registry; call the DOM object processor of at least one text box element, including: the kernel engine provides according to the client where the browser is located The behavior name BehaviorName, calls the DOM object processor of at least one text box element connected to the first interface through the second interface; and when the kernel engine loads the corresponding page element according to the page element identifier TAG provided by the client, call the element Behavior notification method, which notifies the client of the loading status of page elements.
可选地,内核引擎调用设置的至少一个文本框元素的DOM对象处理器,包括:内核引擎与获取页面提供的第四接口IElementBehaviorSite关联,通过第四接口确定文本框元素已有定制处理时,调用对应的DOM对象处理器。Optionally, the kernel engine calls the DOM object processor of at least one text box element set, including: the kernel engine is associated with the fourth interface IElementBehaviorSite provided by the acquisition page, and when it is determined through the fourth interface that the text box element has been customized, call The corresponding DOM object handler.
在本发明实施例中,对于文本框元素解析出的每个DOM对象,在网络侧设置对其进行定制处理的DOM对象处理模块,在页面的获取过程中,利用调用的DOM对象处理模块对DOM对象进行设置的定制处理。由于至少一个DOM对象处理模块可以存储至少一种定制处理方式,因此,可以对文本框元素进行至少一种处理,进而可以调整文本框元素中不同元素呈现不同状态。由此可见,采用本发明实施例提供的对页面文本框进行处理的浏览器,能够对文本框元素中的不同DOM对象分别进行处理,由此呈现的文本框元素可以实现个性化定制处理,例如,可以为不同的文字规定不同的字体,呈现不同的颜色,再例如,在文本框元素中输入类似于表格、图像以及音视频等多媒体信息。保证了文本框元素并非是根据网络应用和信息提供商所要求的固定方式,进而实现了用户能够对文本框元素呈现的内容进行个性化定制的目的,满足不同的用户的偏好,提高用户的感受体验。In the embodiment of the present invention, for each DOM object analyzed by the text box element, a DOM object processing module for customizing it is provided on the network side, and in the process of obtaining the page, the DOM object processing module is used to process the DOM Object for custom handling of settings. Since at least one DOM object processing module can store at least one custom processing method, at least one processing can be performed on the text box element, and then different elements in the text box element can be adjusted to present different states. It can be seen that, using the browser for processing the page text box provided by the embodiment of the present invention, different DOM objects in the text box element can be processed separately, and the text box element presented thus can realize personalized customization processing, for example , different fonts and different colors can be specified for different characters, and for example, multimedia information such as tables, images, audio and video, etc. can be input in the text box element. It ensures that the text box elements are not fixed according to the requirements of network applications and information providers, thereby realizing the purpose that users can customize the content presented by the text box elements, satisfying different user preferences, and improving user experience experience.
上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。The above description is only an overview of the technical solution of the present invention. In order to better understand the technical means of the present invention, it can be implemented according to the contents of the description, and in order to make the above and other purposes, features and advantages of the present invention more obvious and understandable , the specific embodiments of the present invention are enumerated below.
附图说明Description of drawings
通过阅读下文优选实施方式的详细描述,各种其他的优点和益处对于本领域普通技术人员将变得清楚明了。附图仅用于示出优选实施方式的目的,而并不认为是对本发明的限制。而且在整个附图中,用相同的参考符号表示相同的部件。在附图中:Various other advantages and benefits will become apparent to those of ordinary skill in the art upon reading the following detailed description of the preferred embodiment. The drawings are only for the purpose of illustrating a preferred embodiment and are not to be considered as limiting the invention. Also throughout the drawings, the same reference numerals are used to designate the same components. In the attached picture:
图1示出了根据本发明一个实施例的对页面文本框进行处理的浏览器的结构示意图;Fig. 1 shows a schematic structural diagram of a browser for processing a page text box according to an embodiment of the present invention;
图2示出了根据本发明一个实施例的浏览器处理页面文本框元素的方法的处理流程图;Fig. 2 shows a processing flowchart of a method for a browser to process a page text box element according to an embodiment of the present invention;
图3示出了根据本发明一个实施例的在块级层上进行定制处理的处理流程图;以及FIG. 3 shows a process flow diagram of customizing at a block level according to an embodiment of the present invention; and
图4示出了根据本发明一个实施例的对页面文本框进行处理的浏览器的结构示意图。Fig. 4 shows a schematic structural diagram of a browser for processing a page text box according to an embodiment of the present invention.
具体实施方式Detailed ways
下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。Exemplary embodiments of the present disclosure will be described in more detail below with reference to the accompanying drawings. Although exemplary embodiments of the present disclosure are shown in the drawings, it should be understood that the present disclosure may be embodied in various forms and should not be limited by the embodiments set forth herein. Rather, these embodiments are provided for more thorough understanding of the present disclosure and to fully convey the scope of the present disclosure to those skilled in the art.
相关技术中提及,在文本区域输入框中的文字的显示方式是一致的,难以为不同的文字规定不同的字体,也难以在文本框中输入类似于表格、图像以及音频等多媒体信息。因此,目前需要对textarea的呈现和处理方式进行改进,以便提供更丰富的输入和呈现方式。It is mentioned in the related art that the display methods of the text in the input box of the text area are consistent, it is difficult to specify different fonts for different text, and it is also difficult to input multimedia information such as tables, images and audio in the text box. Therefore, it is currently necessary to improve the rendering and processing methods of the textarea in order to provide richer input and rendering methods.
由于文本框元素是呈现在浏览器中,因此,本发明实施例提供了一种能够对页面文本框进行处理的浏览器,利用该浏览器对文本框元素的呈现和处理方式进行改进。在本例中,改变对文本框元素的处理方式,为文本框元素提供DOM对象处理模块,每个对象处理模块中存储有其对应的文本框元素的定制处理。实施时,可以不同的定制处理方式对文本框元素进行处理,实现文本框元素丰富的输入和呈现方式。Since the text box element is presented in the browser, the embodiment of the present invention provides a browser capable of processing the page text box, and the browser is used to improve the presentation and processing of the text box element. In this example, the processing method of the text box element is changed, and a DOM object processing module is provided for the text box element, and each object processing module stores the customized processing of its corresponding text box element. During implementation, the text box element can be processed in different customized processing ways to realize rich input and presentation modes of the text box element.
图1示出了根据本发明一个实施例的对页面文本框进行处理的浏览器的结构示意图。该浏览器包括至少一个文本框元素的DOM对象处理模块110、转换模块120、定制处理模块130以及显示模块140。Fig. 1 shows a schematic structural diagram of a browser for processing page text boxes according to an embodiment of the present invention. The browser includes a DOM object processing module 110 for at least one text box element, a conversion module 120 , a customization processing module 130 and a display module 140 .
其中,DOM对象处理模块110包括至少一个,且预先设置在浏览器侧,在每个DOM对象处理模块110中存储有文本框元素的定制处理。DOM对象处理模块的数量可以是1个,也可以是2个,也可以是3个、4个、5个或更多,具体的数量根据特定DOM对象的数量以及定制处理的数量决定。图1中为了示意,将其设置为3个。Wherein, the DOM object processing module 110 includes at least one, and is preset on the browser side, and each DOM object processing module 110 stores the customized processing of the text box element. The number of DOM object processing modules can be 1, 2, 3, 4, 5 or more, and the specific number is determined according to the number of specific DOM objects and the number of customized processing. In Fig. 1, for the sake of illustration, it is set to three.
在对获取的一个页面进行处理时,转换模块120首先在浏览器侧加载获取页面。考虑到页面以及页面元素并不能够直接进行处理,因此,转换模块120对获取页面中的文本框元素进行解析,将该文本框元素转换为DOM对象,以供后续的定制处理模块130进行处理。When processing an acquired page, the conversion module 120 first loads the acquired page on the browser side. Considering that pages and page elements cannot be processed directly, the conversion module 120 parses the text box elements in the acquired page, and converts the text box elements into DOM objects for subsequent processing by the customization processing module 130 .
参见图1,定制处理模块130耦接到转换模块120和在浏览器预设置的至少一个文本框元素的DOM对象处理模块110。当对文本框元素的解析及转换操作结束后,转换模块120会调用设置的至少一个文本框元素的DOM对象处理模块130对转换的DOM对象中的至少一个文本框元素进行设置的定制处理。Referring to FIG. 1 , the customization processing module 130 is coupled to the conversion module 120 and the DOM object processing module 110 of at least one text box element preset in the browser. After the parsing and conversion operations on the text box elements are completed, the conversion module 120 will call the DOM object processing module 130 of at least one text box element to perform custom processing for setting at least one text box element in the converted DOM object.
其中,显示模块140耦接到定制处理模块130。在定制处理模块130的定制处理操作结束后,显示模块140将定制处理结果显示在获取页面中的文本框元素上。Wherein, the display module 140 is coupled to the customization processing module 130 . After the customization processing operation of the customization processing module 130 is completed, the display module 140 displays the customization processing result on the text box element in the acquisition page.
在本发明实施例中,对于文本框元素解析出的每个DOM对象,在网络侧设置对其进行定制处理的DOM对象处理模块,在页面的获取过程中,利用调用的DOM对象处理模块对DOM对象进行设置的定制处理。由于至少一个DOM对象处理模块可以存储至少一种定制处理方式,因此,可以对文本框元素进行至少一种处理,进而可以调整文本框元素中不同元素呈现不同状态。由此可见,采用本发明实施例提供的对页面文本框进行处理的浏览器,能够对文本框元素中的不同DOM对象分别进行处理,由此呈现的文本框元素可以实现个性化定制处理,例如,可以为不同的文字规定不同的字体,呈现不同的颜色,再例如,在文本框元素中输入类似于表格、图像以及音视频等多媒体信息。保证了文本框元素并非是根据网络应用和信息提供商所要求的固定方式,进而实现了用户能够对文本框元素呈现的内容进行个性化定制的目的,满足不同的用户的偏好,提高用户的感受体验。In the embodiment of the present invention, for each DOM object analyzed by the text box element, a DOM object processing module for customizing it is provided on the network side, and in the process of obtaining the page, the DOM object processing module is used to process the DOM Object for custom handling of settings. Since at least one DOM object processing module can store at least one custom processing method, at least one processing can be performed on the text box element, and then different elements in the text box element can be adjusted to present different states. It can be seen that, using the browser for processing the page text box provided by the embodiment of the present invention, different DOM objects in the text box element can be processed separately, and the text box element presented thus can realize personalized customization processing, for example , different fonts and different colors can be specified for different characters, and for example, multimedia information such as tables, images, audio and video, etc. can be input in the text box element. It ensures that the text box elements are not fixed according to the requirements of network applications and information providers, thereby realizing the purpose that users can customize the content presented by the text box elements, satisfying different user preferences, and improving user experience experience.
上文提及,定制处理模块130能够调用至少一个文本框元素的DOM对象处理模块110。优选的,定制处理模块130首先从转换的DOM对象中获取文本框元素在浏览器页面上的位置信息。进一步,定制处理模块130能够根据获取的位置信息,在文本框元素上生成重叠的块级层。随后,在重叠的块级层上,定制处理模块130调用设置的至少一个文本框元素的DOM对象处理模块110对转换的DOM对象中的至少一个文本框元素进行设置的定制处理。设置重叠的块级层后,对文本框元素的定制处理均在该块级层上执行,而并非在文本框元素自身上执行,既保护了文本框元素自身的原始性和真实性,又能够对文本框元素进行相应处理,使其呈现效果能够满足用户的个性化定制。As mentioned above, the customization processing module 130 can call the DOM object processing module 110 of at least one text box element. Preferably, the customization processing module 130 first obtains the position information of the text box element on the browser page from the converted DOM object. Further, the customization processing module 130 can generate overlapping block-level layers on the text box element according to the acquired position information. Subsequently, on the overlapping block-level layer, the customization processing module 130 invokes the DOM object processing module 110 of the set at least one text box element to perform customization processing on setting the at least one text box element in the converted DOM object. After the overlapping block-level layer is set, the customization processing of the text box element is performed on the block-level layer instead of the text box element itself, which not only protects the originality and authenticity of the text box element itself, but also can Corresponding processing is performed on the text box element so that its rendering effect can meet the personalized customization of the user.
定制处理模块130在重叠的块级层上对文本框元素进行定制处理时,显示模块140可以将定制处理结果显示在位于获取页面的文本框元素上的块级层上。When the customization processing module 130 performs customization processing on the text box element on the overlapping block-level layer, the display module 140 may display the customization processing result on the block-level layer on the text box element of the acquired page.
优选的,本发明实施例提供的块级层包括div层时,显示模块140从定制处理模块130中获取文本框元素经定制处理后生成的内容信息,并对内容信息进行解码,将解码后的内容信息显示在div层上。Preferably, when the block-level layer provided by the embodiment of the present invention includes a div layer, the display module 140 obtains the content information generated by the text box element after customization processing from the customization processing module 130, and decodes the content information, and decodes the decoded Content information is displayed on the div layer.
其中,对于DOM对象处理模块110的调用操作,定制处理模块130需要知道每个DOM对象处理模块110的地址,进而进行相应的调用,若DOM对象处理模块较多且存储地址相对分散的情况下,定制处理模块130的调用就会存在一定的难度。现提供一种优选的调用方式,本例中,设置对象处理注册表,在该表格中登记所有的DOM对象处理模块的登记信息,此处的登记信息可以包括各DOM对象处理模块的存储地址、每个DOM对象处理模块的定制操作、是否正在被调用等等。相应的,参见图1,本发明实施例提供的对页面文本框进行处理的浏览器还包括查询模块160。该查询模块160与定制处理模块130耦合,从对象处理注册表中查询浏览器中是否存在对文本框元素进行处理的DOM对象处理模块。查询结束后,查询模块160将查询结果通知定制处理模块130,而定制处理模块130会根据查询结果调用相应的DOM对象处理模块110。Among them, for the call operation of the DOM object processing module 110, the custom processing module 130 needs to know the address of each DOM object processing module 110, and then make a corresponding call. If there are many DOM object processing modules and the storage addresses are relatively dispersed, There will be certain difficulty in invoking the custom processing module 130 . A kind of preferred calling mode is provided now, in this example, object processing registry is set, register the registration information of all DOM object processing modules in this form, the registration information here can comprise the storage address of each DOM object processing module, Each DOM object handles the module's custom actions, whether it is being called, etc. Correspondingly, referring to FIG. 1 , the browser for processing page text boxes provided by the embodiment of the present invention further includes a query module 160 . The query module 160 is coupled with the customization processing module 130, and queries whether there is a DOM object processing module for processing text box elements in the browser from the object processing registry. After the query is completed, the query module 160 notifies the customization processing module 130 of the query result, and the customization processing module 130 calls the corresponding DOM object processing module 110 according to the query result.
对于每个DOM对象,都存在有至少两个事件,一个是该DOM对象已经加载完成时触发的事件ContentReady,另一个是整个HTML都已经加载完成时触发的事件DocumentReady。由于本发明实施例仅仅是对文本框元素进行处理,因此仅仅涉及该DOM对象已经加载完成时触发的事件ContentReady。优选的,本发明实施例提供的至少一个DOM对象处理模块中存储有规定对文本框元素加载完成时触发的事件ContentReady进行处理的处理方式。For each DOM object, there are at least two events, one is the event ContentReady that is triggered when the DOM object has been loaded, and the other is the event DocumentReady that is triggered when the entire HTML has been loaded. Since the embodiment of the present invention only processes the text box element, it only involves the event ContentReady triggered when the DOM object has been loaded. Preferably, at least one DOM object processing module provided by the embodiment of the present invention stores a processing method for processing the event ContentReady triggered when the loading of the text box element is completed.
每个DOM对象处理模块中存储有对文本框元素的不同定制处理方式,此处存储的处理方式可以是能够对文本框元素进行处理的任意处理方式,例如,该处理方式可以是字体方面的,也可以是图像方面的等等。优选的,该处理方式可以是为文本框元素中不同的文字设置不同的字体、颜色、阴影、文本块等,还可以在文本框元素中输入表格,还可以在文本框元素中输入图像,还可以在文本框元素中输入多媒体信息。其中,多媒体信息包括音频和/或视频。本例中提供的处理方式可以单一使用,也可以以其中多项组合使用。且本例中提供的处理方式是一种例举,并不限于本例提供的处理试,能够实现对文本框元素进行的处理方式均可。Different custom processing methods for text box elements are stored in each DOM object processing module. The processing methods stored here can be any processing methods that can process text box elements. For example, the processing methods can be in terms of fonts, It can also be in terms of images and so on. Preferably, the processing method can be to set different fonts, colors, shadows, text blocks, etc. for different characters in the text box element, and it is also possible to input a table in the text box element, or to input an image in the text box element, or to Multimedia information can be entered in the text box element. Wherein, the multimedia information includes audio and/or video. The processing methods provided in this example can be used singly or in combination. Moreover, the processing method provided in this example is an example, and is not limited to the processing method provided in this example, and any processing method that can realize the processing of the text box element may be used.
现以一个具体实施例对设置的重叠的块级层包括div层时的情况进行详细阐述和说明。Now, a specific embodiment will be used to elaborate and illustrate the situation when the set overlapping block-level layers include a div layer.
对于textarea,在网页浏览器的渲染引擎中包括针对textarea的特定处理器(即DOM对象处理模块),该特定处理器中至少规定了对DOM对象已经加载完成时触发的事件ContentReady进行处理的处理方法。For the textarea, the rendering engine of the web browser includes a specific processor for the textarea (that is, the DOM object processing module), which at least specifies the processing method for processing the event ContentReady that is triggered when the DOM object has been loaded. .
实施时,首先由定制处理模块130获取textarea的位置信息。然后,定制处理模块130在textarea的区域上重叠一个div层,设置div层的各种属性,由于div层叠加在textarea上,因此,div层事先接收交互事件,并进行处理。进一步,显示模块140获取textarea中的内容,对textarea的内容进行解码,并将其显示在div层上。During implementation, the location information of the textarea is first obtained by the customization processing module 130 . Then, the customized processing module 130 overlaps a div layer on the textarea area, and sets various attributes of the div layer. Since the div layer is superimposed on the textarea, the div layer receives and processes the interaction events in advance. Further, the display module 140 acquires the content in the textarea, decodes the content of the textarea, and displays it on the div layer.
优选的,定制处理模块130调用文本框元素的innerText属性,调用设置的至少一个文本框元素的DOM对象处理模块110对innerText属性进行重定义,将文本框元素的重定义后的innerHTML属性返回至div层。其中,本例中的重定义操作包括:onblur或onSubmit的处理方式。Preferably, the customization processing module 130 calls the innerText attribute of the text box element, calls the DOM object processing module 110 of at least one text box element set to redefine the innerText attribute, and returns the redefined innerHTML attribute of the text box element to div layer. Wherein, the redefinition operation in this example includes: the processing method of onblur or onSubmit.
上述的对页面文本框进行处理的浏览器的各部分构架是根据其功能提供的,实际构架并不仅限于上述各部分,还可以包括其他部分、模块、器件等。The above-mentioned frameworks of various parts of the browser for processing page text boxes are provided according to their functions, and the actual framework is not limited to the above-mentioned parts, but may also include other parts, modules, devices, and the like.
图2示出了根据本发明一个实施例的浏览器处理页面文本框元素的方法的处理流程图。本例中,在浏览器侧设置至少一个文本框元素的DOM对象处理器,其中每个对象处理器存储有文本框元素的定制处理。该方法包括步骤S202至步骤S206。FIG. 2 shows a processing flowchart of a method for a browser to process a page text box element according to an embodiment of the present invention. In this example, at least one DOM object handler of the text box element is set on the browser side, wherein each object handler stores custom processing of the text box element. The method includes step S202 to step S206.
步骤S202、在浏览器侧加载获取页面,并对获取页面中的文本框元素进行解析,将该文本框元素转换为DOM对象。Step S202, loading the acquired page on the browser side, and analyzing the text box element in the acquired page, and converting the text box element into a DOM object.
步骤S204、调用浏览器侧预设置的至少一个文本框元素的DOM对象处理器,对步骤S202转换的DOM对象中的至少一个文本框元素进行设置的定制处理。Step S204, call the DOM object processor of at least one text box element preset on the browser side, and perform customization processing on setting at least one text box element in the DOM object converted in step S202.
步骤S206、将步骤S204的定制处理结果显示在获取页面中的文本框元素上。Step S206, displaying the customized processing result of step S204 on the text box element in the acquisition page.
在本发明实施例中,对于文本框元素解析出的每个DOM对象,在网络侧设置对其进行定制处理的DOM对象处理器,在页面的获取过程中,利用调用的DOM对象处理器对DOM对象进行设置的定制处理。由于至少一个DOM对象处理器可以存储至少一种定制处理方式,因此,可以对文本框元素进行至少一种处理,进而可以调整文本框元素中不同元素呈现不同状态。由此可见,采用本发明实施例提供的浏览器对页面文本框进行处理的方法,能够对文本框元素中的不同DOM对象分别进行处理,由此呈现的文本框元素可以实现个性化定制处理,例如,可以为不同的文字规定不同的字体,呈现不同的颜色,再例如,在文本框元素中输入类似于表格、图像以及音视频等多媒体信息。保证了文本框元素并非是根据网络应用和信息提供商所要求的固定方式,进而实现了用户能够对文本框元素呈现的内容进行个性化定制的目的,满足不同的用户的偏好,提高用户的感受体验。In the embodiment of the present invention, for each DOM object analyzed by the text box element, a DOM object processor for customizing it is set on the network side, and in the process of obtaining the page, the DOM object processor is used to process the DOM Object for custom handling of settings. Since at least one DOM object processor can store at least one custom processing method, at least one processing can be performed on the text box element, and then different elements in the text box element can be adjusted to present different states. It can be seen that, using the method for processing the page text box by the browser provided in the embodiment of the present invention, different DOM objects in the text box element can be processed separately, and the text box element presented thus can realize personalized customization processing, For example, different fonts and different colors can be specified for different characters, and for example, multimedia information such as tables, images, audio and video, etc. can be input in text box elements. It ensures that the text box elements are not fixed according to the requirements of network applications and information providers, thereby realizing the purpose that users can customize the content presented by the text box elements, satisfying different user preferences, and improving user experience experience.
本流程中的DOM对象处理器与前文所提及的DOM对象处理模块的功能是相类似的,因前文涉及浏览器的架构,因此将其称为DOM对象处理模块。而本流程中仅涉及DOM对象处理器一个部件,因此,无须将其称之为模块,后文不再赘述。The function of the DOM object processor in this process is similar to that of the DOM object processing module mentioned above. Because the above mentioned browser architecture, it is called the DOM object processing module. However, only one component of the DOM object processor is involved in this process, so it is not necessary to call it a module, and details will not be described later.
参见图2,步骤S204在实施时提及调用设置的至少一个文本框元素的DOM对象处理器对转换的DOM对象中的至少一个文本框元素进行设置的定制处理。一种优选的实施例是在文本框元素上设置重叠的块级层,在块级层上进行相应处理。图3示出了根据本发明一个实施例的在块级层上进行定制处理的处理流程图。该处理流程包括步骤S302至步骤S306。Referring to FIG. 2 , step S204 refers to calling the DOM object processor of the set at least one text box element to set at least one text box element in the converted DOM object during implementation. A preferred embodiment is to set an overlapping block-level layer on the text box element, and perform corresponding processing on the block-level layer. Fig. 3 shows a process flowchart of customizing at the block level according to an embodiment of the present invention. The processing flow includes step S302 to step S306.
步骤S302、从转换DOM中获取文本框元素在浏览器页面上的位置信息。Step S302, acquiring the position information of the text box element on the browser page from the transformed DOM.
步骤S304、根据步骤S302获取的位置信息,在文本框元素上生成重叠的块级层。Step S304. According to the position information acquired in step S302, an overlapping block-level layer is generated on the text box element.
步骤S306、在步骤S304生成的块级层上,调用设置的至少一个文本框元素的DOM对象处理器对转换的DOM对象中的至少一个文本框元素进行设置的定制处理。Step S306, on the block-level layer generated in step S304, call the DOM object processor of the set at least one text box element to perform custom processing for setting the at least one text box element in the converted DOM object.
在块级层上进行定制处理后,相应的,必然可以将定制处理结果显示在位于获取页面的文本框元素上的块级层上。After the customization processing is performed on the block-level layer, correspondingly, the customization processing result must be displayed on the block-level layer located on the text box element of the acquisition page.
块级层可以是能够设置在文本框元素上的、且可以实现对文本框元素进行处理的任意层。当块级层为div层时,为将定制处理结果显示在获取页面中的文本框元素上,首先获取文本框元素经定制处理后生成的内容信息。在内容信息获取结束后,对内容信息进行解码,并将解码后的内容信息显示在div层上。The block-level layer can be any layer that can be set on the text box element and can implement processing on the text box element. When the block-level layer is a div layer, in order to display the customized processing result on the text box element in the acquisition page, firstly, obtain the content information generated by the customized processing of the text box element. After the content information is acquired, the content information is decoded, and the decoded content information is displayed on the div layer.
其中,对于DOM对象处理器的调用操作,需要知道每个DOM对象处理器的地址,进而进行相应的调用,若DOM对象处理器较多且存储地址相对分散的情况下,其调用就会存在一定的难度。现提供一种优选的调用方式,本例中,设置对象处理注册表,在该表格中登记所有的DOM对象处理器的登记信息,此处的登记信息可以包括各DOM对象处理器的存储地址、每个DOM对象处理器的定制操作、是否正在被调用等等。相应的,在执行步骤S204的调用操作之前可以从对象处理注册表中查询浏览器中是否存在对文本框元素进行处理的DOM对象处理器,进而根据查询结果进行调用。Among them, for the call operation of the DOM object processor, it is necessary to know the address of each DOM object processor, and then make the corresponding call. difficulty. Now provide a kind of optimal invoking mode, in this example, set the object processing registry, register the registration information of all DOM object processors in this form, the registration information here can comprise the memory address of each DOM object processor, Custom actions for each DOM object handler, whether it is being called, etc. Correspondingly, before performing the call operation in step S204, it may be queried from the object processing registry whether there is a DOM object processor for processing the text box element in the browser, and then call according to the query result.
对于每个DOM对象,都存在有至少两个事件,一个是该DOM对象已经加载完成时触发的事件ContentReady,另一个是整个HTML都已经加载完成时触发的事件DocumentReady。由于本发明实施例仅仅是对文本框元素进行处理,因此仅仅涉及该DOM对象已经加载完成时触发的事件ContentReady。优选的,本发明实施例提供的至少一个DOM对象处理器中存储有规定对文本框元素加载完成时触发的事件ContentReady进行处理的处理方式。For each DOM object, there are at least two events, one is the event ContentReady that is triggered when the DOM object has been loaded, and the other is the event DocumentReady that is triggered when the entire HTML has been loaded. Since the embodiment of the present invention only processes the text box element, it only involves the event ContentReady triggered when the DOM object has been loaded. Preferably, at least one DOM object processor provided by the embodiment of the present invention stores a processing method for processing the event ContentReady triggered when the loading of the text box element is completed.
每个DOM对象处理器中存储有对文本框元素的不同定制处理方式,此处存储的处理方式可以是能够对文本框元素进行处理的任意处理方式,例如,该处理方式可以是字体方面的,也可以是图像方面的等等。优选的,该处理方式可以是为文本框元素中不同的文字设置不同的字体、颜色、阴影、文本块等,还可以在文本框元素中输入表格,还可以在文本框元素中输入图像,还可以在文本框元素中输入多媒体信息。其中,多媒体信息包括音频和/或视频。本例中提供的处理方式可以单一使用,也可以以其中多项组合使用。且本例中提供的处理方式是一种例举,并不限于本例提供的处理试,能够实现对文本框元素进行的处理方式均可。Each DOM object processor stores different customized processing methods for text box elements. The processing methods stored here can be any processing methods that can process text box elements. For example, the processing methods can be in terms of fonts, It can also be in terms of images and so on. Preferably, the processing method can be to set different fonts, colors, shadows, text blocks, etc. for different characters in the text box element, and it is also possible to input a table in the text box element, or to input an image in the text box element, or to Multimedia information can be entered in the text box element. Wherein, the multimedia information includes audio and/or video. The processing methods provided in this example can be used singly or in combination. Moreover, the processing method provided in this example is an example, and is not limited to the processing method provided in this example, and any processing method that can realize the processing of the text box element may be used.
优选的,步骤S204中涉及的调用操作具体包括:调用文本框元素的innerText属性,调用设置的至少一个文本框元素的DOM对象处理模块110对innerText属性进行重定义,将文本框元素的重定义后的innerHTML属性返回至div层。其中,本例中的重定义操作包括:onblur或onSubmit的处理方式。Preferably, the calling operation involved in step S204 specifically includes: calling the innerText attribute of the text box element, calling the set DOM object processing module 110 of at least one text box element to redefine the innerText attribute, and redefining the text box element The innerHTML property is returned to the div layer. Wherein, the redefinition operation in this example includes: the processing method of onblur or onSubmit.
实施例一Embodiment one
本发明实施例中提及到的浏览器可以为多种,例如微软公司的InternetExplorer(简称IE)、MozillaFirefox、谷歌公司的Chrome、Opera以及苹果公司的Safari等等。The browsers mentioned in the embodiment of the present invention may be various, such as Microsoft's Internet Explorer (IE for short), Mozilla Firefox, Google's Chrome, Opera, Apple's Safari, and the like.
现以IE浏览器为例对本发明实施例提供的文本框元素的具体处理方法进行详细地阐述和说明。Now, taking IE browser as an example, the specific processing method of the text box element provided by the embodiment of the present invention will be elaborated and illustrated in detail.
对于针对每个网页元素的特定处理,可能需要实现For specific processing on a per page element basis, it may be necessary to implement
IElementBehavior(元素行为)IElementBehavior (element behavior)
ImplementingtheIElementBehaviorInterface(执行元素行为接口)ImplementingtheIElementBehaviorInterface (implementing the element behavior interface)
ImplementingtheNotifyMethod(执行通知方法)ImplementingtheNotifyMethod (implementing the notification method)
ImplementingtheInitMethod(执行初始化方法)ImplementingtheInitMethod (execute the initialization method)
ImplementingtheDetachMethod(执行分离方法)ImplementingtheDetachMethod (implementing the detach method)
IElementBehaviorFactory(元素行为工厂行为)IElementBehaviorFactory (element behavior factory behavior)
IElementNamespaceFactory(元素命名空间工厂接口)IElementNamespaceFactory (element namespace factory interface)
IElementNamespaceFactoryCallback(元素命名空间回调接口)IElementNamespaceFactoryCallback (element namespace callback interface)
初始化设置后,IE浏览器中的客户端WebBrowser(网络浏览器)插件实现网页元素的具体处理步骤如下:After the initialization settings, the specific processing steps of the client WebBrowser (web browser) plug-in in the IE browser to realize the web page elements are as follows:
步骤1、客户端WebBrowser插件实现IElementBehaviorFactory接口和IElementBehavior接口。Step 1. The client WebBrowser plug-in implements the IElementBehaviorFactory interface and the IElementBehavior interface.
步骤2、客户端WebBrowser插件实现IDocHostUIHandler接口。Step 2. The client WebBrowser plug-in implements the IDocHostUIHandler interface.
注:这里的WebBrowser插件就是在针对特定DOM对象的特定处理器在IE中的具体实施方式,实现IDocHostUIHandler接口用于把特定处理器注册到对象注册表中由DOM处理器采用,实现IElementBehaviorFactory和IElementBehavior接口用于说明具体的定制处理实现。Note: The WebBrowser plug-in here is the specific implementation of a specific processor for a specific DOM object in IE. It implements the IDocHostUIHandler interface to register a specific processor in the object registry and is used by the DOM processor to implement the IElementBehaviorFactory and IElementBehavior interfaces. Used to illustrate specific custom processing implementations.
步骤3、页面创建时,MSHTML会调用IDocHostUIHandler的GetHostInfo方法,客户端程序向MSHTML提供页面元素TAG及对应的BehaviorNameStep 3. When the page is created, MSHTML will call the GetHostInfo method of IDocHostUIHandler, and the client program will provide MSHTML with the page element TAG and the corresponding BehaviorName
注:MSHTML对应于内核引擎,这个步骤对应于DOM处理器查询所有的DOM对象处理器列表。Note: MSHTML corresponds to the kernel engine, and this step corresponds to the DOM processor querying the list of all DOM object processors.
步骤4、页面加载时,MSHTML会根据以上提供的BehaviorName,逐个调用IElementBehaviorFactory的FindBehavior方法,由客户端提供IElementBehavior接口实现。Step 4. When the page is loaded, MSHTML will call the FindBehavior method of IElementBehaviorFactory one by one according to the BehaviorName provided above, and the client will provide the IElementBehavior interface for implementation.
此处,优选的,并与页面提供的对应接口IElementBehaviorSite关联,以确定是否定制行为。Here, it is preferred and associated with the corresponding interface IElementBehaviorSite provided by the page to determine whether to customize the behavior.
步骤5、若客户端提供了IElementBehavior实现,MSHTML在加载对应TAG的页面元素时,调用元素行为通知方法,通知客户端页面元素的加载状态。Step 5. If the client provides the implementation of IElementBehavior, when MSHTML loads the page element corresponding to the TAG, it calls the element behavior notification method to notify the client of the loading status of the page element.
注:元素行为通知方法在IE中实现可利用IElementBehavior::Notify。Note: The element behavior notification method can be implemented in IE by using IElementBehavior::Notify.
其中,值得注意的是,步骤4和步骤5对应于定制处理模块调用相应的DOM对象处理器对DOM对象进行处理。Wherein, it is worth noting that step 4 and step 5 correspond to the custom processing module invoking a corresponding DOM object handler to process the DOM object.
本实施例的方法并不仅限IE浏览器,对于其他浏览器,其实现方式是相类似的。The method in this embodiment is not limited to the IE browser, and the implementation methods for other browsers are similar.
实施例二Embodiment two
对于textarea(文本框)页面单元,为用户提供了在网页中输入大量文字的输入框,但是在当前的网页呈现方式下,用户仅仅可以textarea中输入简单的文字,而无法输入预订格式的文字、图像等内容。而通过在浏览器处提供对textarea的定制渲染,可以使得在textarea中输入更加丰富的内容。For the textarea (text box) page unit, an input box for inputting a large amount of text in the web page is provided for the user, but in the current web page rendering mode, the user can only enter simple text in the textarea, but cannot enter text in a predetermined format, images etc. By providing customized rendering of the textarea at the browser, richer content can be entered in the textarea.
本例中对于文本框元素的具体操作提供相应的说明。In this example, corresponding instructions are provided for the specific operation of the text box element.
1、首先,进行事件定义,在IDocHostUIHandler的GetHostInfo方法中,对浏览器的结构和标识进行自定义。在文本框元素上设置一个div层,利用pCSSBuffer指针调度,将涉及文本框元素的操作均牵引在div层上执行。1. First, define the event, and customize the structure and logo of the browser in the GetHostInfo method of IDocHostUIHandler. Set a div layer on the text box element, and use the pCSSBuffer pointer scheduling to pull and execute operations involving the text box element on the div layer.
2、IElementBehaviorFactory的FindBehavior方法中,返回IElementBehavior的实现对象CTextAreaElementBehavior,并保存MSHTML提供的IElementBehaviorSite对象指针。2. In the FindBehavior method of IElementBehaviorFactory, return the implementation object CTextAreaElementBehavior of IElementBehavior, and save the IElementBehaviorSite object pointer provided by MSHTML.
3、MSHTML调用文本框元素行为通知(CTextAreaElementBehavior::Notify)方法时,对涉及文本框元素的操作进行实施。3. When MSHTML calls the text box element behavior notification (CTextAreaElementBehavior::Notify) method, it implements the operations related to the text box element.
在加载对应TAG的文本框元素时,调用元素行为通知方法,通知客户端文本框元素的加载状态。在div层对文本框元素中的内容进行处理,该处理涉及调整文本框元素内容的宽度、高度、播放效果等。When loading the text box element corresponding to TAG, call the element behavior notification method to notify the client of the loading status of the text box element. The content in the text box element is processed at the div layer, and the processing involves adjusting the width, height, playback effect, etc. of the content of the text box element.
页面提交TEXAREA的内容时,会调用textArea的innerText属性,重定义该属性,返回编码过的div的innerHTML。When the page submits the content of TEXAREA, it will call the innerText property of textArea, redefine this property, and return the innerHTML of the encoded div.
在div层处理结束后,将文本框元素的内容和div层的处理效果重叠,将重叠后的效果呈现给用户。After the processing of the div layer is completed, the content of the text box element and the processing effect of the div layer are overlapped, and the overlapping effect is presented to the user.
使用本发明实施例能够实现利用浏览器进行文本框元素进行处理的方法,实现用户的个性化定制,提高用户的感受体验。Using the embodiment of the present invention can realize the method of using the browser to process the text box elements, realize the personalized customization of the user, and improve the experience of the user.
实施例三Embodiment three
上文描述的是直接对文本框元素进行处理,众所周知,浏览器的页面元素有多种,浏览器需要对每个页面元素均进行转换及处理,然后将处理后的页面元素进行渲染,才生成呈现的网页。The above description is to directly process the text box elements. As we all know, there are many kinds of page elements in the browser. The browser needs to convert and process each page element, and then render the processed page elements to generate The rendered web page.
图2示出了根据本发明一个实施例的进行页面元素处理的浏览器的结构示意图。参见图4,该浏览器包括设置在浏览器侧的至少一个DOM对象处理器410,页面解析器420以及DOM处理器430。Fig. 2 shows a schematic structural diagram of a browser for processing page elements according to an embodiment of the present invention. Referring to FIG. 4 , the browser includes at least one DOM object processor 410 , a page parser 420 and a DOM processor 430 arranged on the browser side.
其中,DOM对象处理器410包括至少一个,且预先设置在浏览器侧,在每个DOM对象处理器410中存储有特定DOM对象的定制处理。DOM对象处理器的数量可以是1个,也可以是2个,也可以是3个、4个、5个或更多,具体的数量根据特定DOM对象的数量以及定制处理的数量决定。图4中为了示意,将其设置为3个。Wherein, there is at least one DOM object processor 410, which is preset on the browser side, and each DOM object processor 410 stores customized processing of a specific DOM object. The number of DOM object processors can be 1, 2, 3, 4, 5 or more, and the specific number is determined according to the number of specific DOM objects and the number of customized processing. In Fig. 4, for the sake of illustration, it is set to three.
在对获取的一个页面进行处理时,页面解析器420在浏览器侧加载该获取页面,并对获取页面的页面元素进行解析。考虑到页面以及页面元素并不能够直接进行处理,因此,页面解析器420在解析过程中将各页面元素转换为DOM对象,以供后续DOM处理器430处理。When processing an acquired page, the page parser 420 loads the acquired page on the browser side, and parses the page elements of the acquired page. Considering that pages and page elements cannot be processed directly, the page parser 420 converts each page element into a DOM object during the parsing process for subsequent DOM processor 430 to process.
参见图4,DOM处理器430,耦接到页面解析器420和至少一个DOM对象处理器410。当页面解析器420解析结束后,启动DOM处理器430。DOM处理器430在转换的DOM对象中选择至少一个作为当前准备处理的DOM对象,调用设置的至少一个DOM对象处理器410,对选择出的DOM对象进行设置的定制处理。Referring to FIG. 4 , the DOM processor 430 is coupled to the page parser 420 and at least one DOM object processor 410 . After the parsing by the page parser 420 is completed, the DOM processor 430 is started. The DOM processor 430 selects at least one of the converted DOM objects as a DOM object currently ready to be processed, calls the set at least one DOM object processor 410, and performs customized processing on the selected DOM object.
参见图4,该浏览器还包括树生成器440,耦接到DOM处理器430。当DOM处理器430调用DOM对象处理器410,对DOM对象进行定制处理结束后,树生成器440利用经过设置的定制处理的DOM对象生成最终的DOM树,并对DOM树进行渲染。Referring to FIG. 4 , the browser further includes a tree builder 440 coupled to the DOM processor 430 . When the DOM processor 430 invokes the DOM object processor 410, and after the customization process on the DOM object is completed, the tree generator 440 generates a final DOM tree by using the set customized DOM object, and renders the DOM tree.
而文本框元素是页面元素的一种,因此,当页面元素为文本框元素时,利用浏览器进行页面元素处理的装置可以直接对文本框元素进行处理,其选择的DOM对象处理器存储的定制处理方式是针对文本框元素的定制处理即可。也就是说,本例中,参见图4,其选择的DOM对象处理器410应该是文本框元素的DOM对象处理器410。其他各部件的功能维持不变。The text box element is a kind of page element, therefore, when the page element is a text box element, the device for processing the page element by using the browser can directly process the text box element, and the customized DOM object processor stored by it selects The processing method is customized processing for the text box element. That is to say, in this example, referring to FIG. 4 , the selected DOM object handler 410 should be the DOM object handler 410 of the text box element. The functions of other components remain unchanged.
本例中,页面解析器420与在前的实施例中的转换模块120的功能相类似,均是将相应的元素转换为DOM对象。而DOM处理器430与在前的实施例中的定制处理模块130的功能相类似,调用相应的DOM对象处理模块(或DOM对象处理器),对当前DOM对象进行相应处理。In this example, the function of the page parser 420 is similar to that of the conversion module 120 in the previous embodiment, and both convert corresponding elements into DOM objects. The function of the DOM processor 430 is similar to that of the custom processing module 130 in the previous embodiment, calling the corresponding DOM object processing module (or DOM object processor) to process the current DOM object accordingly.
采用本发明提供的浏览器和相应的处理方法,能够达到如下有益效果:By adopting the browser provided by the present invention and the corresponding processing method, the following beneficial effects can be achieved:
在本发明实施例中,对于文本框元素解析出的每个DOM对象,在网络侧设置对其进行定制处理的DOM对象处理模块,在页面的获取过程中,利用调用的DOM对象处理模块对DOM对象进行设置的定制处理。由于至少一个DOM对象处理模块可以存储至少一种定制处理方式,因此,可以对文本框元素进行至少一种处理,进而可以调整文本框元素中不同元素呈现不同状态。由此可见,采用本发明实施例提供的对页面文本框进行处理的浏览器,能够对文本框元素中的不同DOM对象分别进行处理,由此呈现的文本框元素可以实现个性化定制处理,例如,可以为不同的文字规定不同的字体,呈现不同的颜色,再例如,在文本框元素中输入类似于表格、图像以及音视频等多媒体信息。本发明实施例为传统的textarea提供了改进的呈现和处理方式,增加了页面的交互性能,保证了文本框元素并非是根据网络应用和信息提供商所要求的固定方式,进而实现了用户能够对文本框元素呈现的内容进行个性化定制的目的,满足不同的用户的偏好,提高用户的感受体验。In the embodiment of the present invention, for each DOM object analyzed by the text box element, a DOM object processing module for customizing it is provided on the network side, and in the process of obtaining the page, the DOM object processing module is used to process the DOM Object for custom handling of settings. Since at least one DOM object processing module can store at least one custom processing method, at least one processing can be performed on the text box element, and then different elements in the text box element can be adjusted to present different states. It can be seen that, using the browser for processing the page text box provided by the embodiment of the present invention, different DOM objects in the text box element can be processed separately, and the text box element presented thus can realize personalized customization processing, for example , different fonts and different colors can be specified for different characters, and for example, multimedia information such as tables, images, audio and video, etc. can be input in the text box element. The embodiment of the present invention provides an improved presentation and processing method for the traditional textarea, increases the interactive performance of the page, and ensures that the text box elements are not fixed according to the requirements of network applications and information providers, thereby enabling users to The purpose of personalizing the content presented by the text box element is to meet the preferences of different users and improve the user experience.
在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。The algorithms and displays presented herein are not inherently related to any particular computer, virtual system, or other device. Various generic systems can also be used with the teachings based on this. The structure required to construct such a system is apparent from the above description. Furthermore, the present invention is not specific to any particular programming language. It should be understood that various programming languages can be used to implement the content of the present invention described herein, and the above description of specific languages is for disclosing the best mode of the present invention.
在此处所提供的说明书中,说明了大量具体细节。然而,能够理解,本发明的实施例可以在没有这些具体细节的情况下实践。在一些实例中,并未详细示出公知的方法、结构和技术,以便不模糊对本说明书的理解。In the description provided herein, numerous specific details are set forth. However, it is understood that embodiments of the invention may be practiced without these specific details. In some instances, well-known methods, structures and techniques have not been shown in detail in order not to obscure the understanding of this description.
类似地,应当理解,为了精简本公开并帮助理解各个发明方面中的一个或多个,在上面对本发明的示例性实施例的描述中,本发明的各个特征有时被一起分组到单个实施例、图、或者对其的描述中。然而,并不应将该公开的方法解释成反映如下意图:即所要求保护的本发明要求比在每个权利要求中所明确记载的特征更多的特征。更确切地说,如下面的权利要求书所反映的那样,发明方面在于少于前面公开的单个实施例的所有特征。因此,遵循具体实施方式的权利要求书由此明确地并入该具体实施方式,其中每个权利要求本身都作为本发明的单独实施例。Similarly, it should be appreciated that in the foregoing description of exemplary embodiments of the invention, in order to streamline this disclosure and to facilitate an understanding of one or more of the various inventive aspects, various features of the invention are sometimes grouped together in a single embodiment, figure, or its description. This method of disclosure, however, is not to be interpreted as reflecting an intention that the claimed invention requires more features than are expressly recited in each claim. Rather, as the following claims reflect, inventive aspects lie in less than all features of a single foregoing disclosed embodiment. Thus, the claims following the Detailed Description are hereby expressly incorporated into this Detailed Description, with each claim standing on its own as a separate embodiment of this invention.
本领域那些技术人员可以理解,可以对实施例中的设备中的模块进行自适应性地改变并且把它们设置在与该实施例不同的一个或多个设备中。可以把实施例中的模块或单元或组件组合成一个模块或单元或组件,以及此外可以把它们分成多个子模块或子单元或子组件。除了这样的特征和/或过程或者单元中的至少一些是相互排斥之外,可以采用任何组合对本说明书(包括伴随的权利要求、摘要和附图)中公开的所有特征以及如此公开的任何方法或者设备的所有过程或单元进行组合。除非另外明确陈述,本说明书(包括伴随的权利要求、摘要和附图)中公开的每个特征可以由提供相同、等同或相似目的的替代特征来代替。Those skilled in the art can understand that the modules in the device in the embodiment can be adaptively changed and arranged in one or more devices different from the embodiment. Modules or units or components in the embodiments may be combined into one module or unit or component, and furthermore may be divided into a plurality of sub-modules or sub-units or sub-assemblies. All features disclosed in this specification (including accompanying claims, abstract and drawings), as well as any method or method so disclosed, may be used in any combination, except that at least some of such features and/or processes or units are mutually exclusive. All processes or units of equipment are combined. Each feature disclosed in this specification (including accompanying claims, abstract and drawings) may be replaced by alternative features serving the same, equivalent or similar purpose, unless expressly stated otherwise.
此外,本领域的技术人员能够理解,尽管在此所述的一些实施例包括其它实施例中所包括的某些特征而不是其它特征,但是不同实施例的特征的组合意味着处于本发明的范围之内并且形成不同的实施例。例如,在下面的权利要求书中,所要求保护的实施例的任意之一都可以以任意的组合方式来使用。Furthermore, those skilled in the art will understand that although some embodiments described herein include some features included in other embodiments but not others, combinations of features from different embodiments are meant to be within the scope of the invention. and form different embodiments. For example, in the following claims, any of the claimed embodiments may be used in any combination.
本发明的各个部件实施例可以以硬件实现,或者以在一个或者多个处理器上运行的软件模块实现,或者以它们的组合实现。本领域的技术人员应当理解,可以在实践中使用微处理器或者数字信号处理器(DSP)来实现根据本发明实施例的浏览器中的一些或者全部部件的一些或者全部功能。本发明还可以实现为用于执行这里所描述的方法的一部分或者全部的设备或者装置程序(例如,计算机程序和计算机程序产品)。这样的实现本发明的程序可以存储在计算机可读介质上,或者可以具有一个或者多个信号的形式。这样的信号可以从因特网网站上下载得到,或者在载体信号上提供,或者以任何其他形式提供。The various component embodiments of the present invention may be implemented in hardware, or in software modules running on one or more processors, or in a combination thereof. Those skilled in the art should understand that a microprocessor or a digital signal processor (DSP) may be used in practice to implement some or all functions of some or all components in the browser according to the embodiments of the present invention. The present invention can also be implemented as an apparatus or an apparatus program (for example, a computer program and a computer program product) for performing a part or all of the methods described herein. Such a program for realizing the present invention may be stored on a computer-readable medium, or may be in the form of one or more signals. Such a signal may be downloaded from an Internet site, or provided on a carrier signal, or provided in any other form.
应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。It should be noted that the above-mentioned embodiments illustrate rather than limit the invention, and that those skilled in the art will be able to design alternative embodiments without departing from the scope of the appended claims. In the claims, any reference signs placed between parentheses shall not be construed as limiting the claim. The word "comprising" does not exclude the presence of elements or steps not listed in a claim. The word "a" or "an" preceding an element does not exclude the presence of a plurality of such elements. The invention can be implemented by means of hardware comprising several distinct elements, and by means of a suitably programmed computer. In a unit claim enumerating several means, several of these means can be embodied by one and the same item of hardware. The use of the words first, second, and third, etc. does not indicate any order. These words can be interpreted as names.
本文公开了A1、一种对页面文本框进行处理的浏览器,包括:至少一个文本框元素的DOM对象处理模块,设置在浏览器侧,其中每个对象处理模块配置为存储有文本框元素的定制处理;转换模块,配置为在浏览器侧加载获取页面,并对获取页面中的文本框元素进行解析,将该文本框元素转换为DOM对象;定制处理模块,配置为调用所述设置的至少一个文本框元素的DOM对象处理模块对所述转换的DOM对象中的至少一个文本框元素进行所述设置的定制处理;显示模块,配置为将所述定制处理结果显示在获取页面中的文本框元素上。A2、根据A1所述的浏览器,其特征在于,所述定制处理模块还配置为从所述的转换DOM对象中获取文本框元素在浏览器页面上的位置信息;根据所述位置信息,在所述文本框元素上生成重叠的块级层;在所述块级层上,调用所述设置的至少一个文本框元素的DOM对象处理模块对所述转换的DOM对象中的至少一个文本框元素进行所述设置的定制处理。A3、根据A2所述的浏览器,其特征在于,所述显示模块还配置为将所述定制处理结果显示在位于获取页面的文本框元素上的所述块级层上。A4、根据A2或A3所述的浏览器,其特征在于,所述块级层包括div层时,所述显示模块还配置为获取所述文本框元素经定制处理后生成的内容信息;对所述内容信息进行解码,并将解码后的内容信息显示在div层上。A5、根据A1至A4任一项所述的浏览器,其特征在于,还包括:查询模块,配置为从对象处理注册表中查询所述浏览器中是否存在对所述文本框元素进行处理的DOM对象处理模块,其中,所述对象处理注册表中登记所述至少一个DOM对象处理模块。A6、根据A1至A5任一项所述的浏览器,其特征在于,所述至少一个DOM对象处理模块中存储有规定对所述文本框元素加载完成时触发的事件ContentReady进行处理的处理方式。A7、根据A6所述的浏览器,其特征在于,所述处理方式包括下列至少之一:为所述文本框元素中不同的文字设置不同的字体;在所述文本框元素中输入表格;在所述文本框元素中输入图像;在所述文本框元素中输入多媒体信息。A8、根据A7所述的浏览器,其特征在于,所述多媒体信息包括音频和/或视频。A9、根据A1至A8任一项所述的浏览器,其特征在于,所述块级层包括div层时,所述定制处理模块还配置为调用所述文本框元素的innerText属性;调用所述设置的至少一个文本框元素的DOM对象处理模块对所述innerText属性进行重定义;将所述文本框元素的重定义后的innerHTML属性返回至所述div层。A10、根据A9所述的浏览器,其特征在于,所述重定义操作包括:onblur或onSubmit的处理方式。This paper discloses A1, a browser for processing text boxes on a page, including: at least one DOM object processing module of a text box element, which is set on the browser side, wherein each object processing module is configured to store a text box element Customized processing; conversion module, configured to load the acquired page on the browser side, and parse the text box element in the acquired page, and convert the text box element into a DOM object; customized processing module, configured to call at least the set The DOM object processing module of a text box element performs the custom processing of the settings on at least one text box element in the converted DOM object; the display module is configured to display the custom processing result in the text box in the acquisition page element. A2, according to the browser described in A1, it is characterized in that, the customization processing module is also configured to obtain the position information of the text box element on the browser page from the converted DOM object; according to the position information, in Generate an overlapping block-level layer on the text box element; on the block-level layer, call the DOM object processing module of the at least one text box element set to perform at least one text box element in the converted DOM object Perform custom processing of the settings. A3. The browser according to A2, wherein the display module is further configured to display the customized processing result on the block-level layer located on the text box element of the acquisition page. A4, according to the browser described in A2 or A3, it is characterized in that, when the block-level layer includes a div layer, the display module is also configured to obtain the content information generated after the text box element is customized; The above content information is decoded, and the decoded content information is displayed on the div layer. A5. The browser according to any one of A1 to A4 is characterized in that it also includes: a query module configured to query from the object processing registry whether there is an object processing the text box element in the browser. The DOM object processing module, wherein the at least one DOM object processing module is registered in the object processing registry. A6. The browser according to any one of A1 to A5, wherein the at least one DOM object processing module stores a processing method for processing the event ContentReady triggered when the loading of the text box element is completed. A7, according to the browser described in A6, it is characterized in that the processing method includes at least one of the following: setting different fonts for different characters in the text box element; inputting a form in the text box element; An image is input into the text box element; multimedia information is input into the text box element. A8. The browser according to A7, wherein the multimedia information includes audio and/or video. A9. The browser according to any one of A1 to A8, wherein when the block-level layer includes a div layer, the custom processing module is also configured to call the innerText attribute of the text box element; call the The set DOM object processing module of at least one text box element redefines the innerText property; returns the redefined innerHTML property of the text box element to the div layer. A10. The browser according to A9, wherein the redefinition operation includes: onblur or onSubmit processing.
本文公开了B11、一种浏览器处理页面文本框元素的方法,在浏览器侧设置至少一个文本框元素的DOM对象处理器,其中每个对象处理器存储有文本框元素的定制处理,该方法包括:在浏览器侧加载获取页面,并对获取页面中的文本框元素进行解析,将该文本框元素转换为DOM对象;调用所述设置的至少一个文本框元素的DOM对象处理器对所述转换的DOM对象中的至少一个文本框元素进行所述设置的定制处理;将所述定制处理结果显示在获取页面中的文本框元素上。B12、根据B11所述的方法,其特征在于,调用所述设置的至少一个文本框元素的DOM对象处理器对所述转换的DOM对象中的至少一个文本框元素进行所述设置的定制处理,包括:从所述的转换DOM中获取文本框元素在浏览器页面上的位置信息;根据所述位置信息,在所述文本框元素上生成重叠的块级层;在所述块级层上,调用所述设置的至少一个文本框元素的DOM对象处理器对所述转换的DOM对象中的至少一个文本框元素进行所述设置的定制处理。B13、根据B11所述的方法,其特征在于,将所述定制处理结果显示在获取页面中的文本框元素上,包括:将所述定制处理结果显示在位于获取页面的文本框元素上的所述块级层上。B14、根据B12或B13所述的方法,其特征在于,所述块级层包括div层时,将所述定制处理结果显示在获取页面中的文本框元素上,包括:获取所述文本框元素经定制处理后生成的内容信息;对所述内容信息进行解码,并将解码后的内容信息显示在div层上。B15、根据B11至B14任一项所述的方法,其特征在于,调用所述设置的至少一个文本框元素的DOM对象处理器对所述转换的DOM对象中的至少一个文本框元素进行所述设置的定制处理之前,包括:从对象处理注册表中查询所述浏览器中是否存在对所述文本框元素进行处理的DOM对象处理器,其中,所述对象处理注册表中登记所述至少一个DOM对象处理器。B16、根据B11至B15任一项所述的方法,其特征在于,所述至少一个DOM对象处理器中存储有规定对所述文本框元素加载完成时触发的事件ContentReady进行处理的处理方式。B17、根据B16所述的方法,其特征在于,所述处理方式包括下列至少之一:为所述文本框元素中不同的文字设置不同的字体;在所述文本框元素中输入表格;在所述文本框元素中输入图像;在所述文本框元素中输入多媒体信息。B18、根据B17所述的方法,其特征在于,所述多媒体信息包括音频和/或视频。B19、根据B17至B18任一项所述的方法,其特征在于,所述块级层包括div层时,调用所述设置的至少一个文本框元素的DOM对象处理器对所述转换的DOM对象中的至少一个文本框元素进行所述设置的定制处理,包括:调用所述文本框元素的innerText属性;调用所述设置的至少一个文本框元素的DOM对象处理器对所述innerText属性进行重定义;将所述文本框元素的重定义后的innerHTML属性返回至所述div层。B20、根据B19所述的方法,其特征在于,所述重定义操作包括:onblur或onSubmit的处理方式。B21、根据B11至B20任一项所述的方法,其特征在于,所述浏览器为IE浏览器时,所述浏览器所在的客户端在WebBrowser插件设置第一接口IElementBehaviorFactory、第二接口IElementBehavior以及第三接口IDocHostUIHandler,其中,所述第一接口和所述第二接口用于调用各DOM对象处理器,所述第三接口用于将各DOM对象处理器注册到所述对象处理注册表中;调用所述设置的至少一个文本框元素的DOM对象处理器,包括:内核引擎根据所述浏览器所在的客户端提供的行为名称BehaviorName,通过所述第二接口调用与所述第一接口连接的所述设置的至少一个文本框元素的DOM对象处理器;以及所述内核引擎根据所述客户端提供的页面元素标识TAG加载对应的页面元素时,调用元素行为通知方法,通知所述客户端页面元素的加载状态。B22、根据B21所述的方法,其特征在于,所述内核引擎调用所述设置的至少一个文本框元素的DOM对象处理器,包括:所述内核引擎与所述获取页面提供的第四接口IElementBehaviorSite关联,通过所述第四接口确定所述文本框元素已有定制处理时,调用对应的DOM对象处理器。This paper discloses B11, a method for a browser to process text box elements on a page, setting at least one DOM object processor of a text box element on the browser side, wherein each object processor stores custom processing of a text box element, the method Including: loading the acquisition page on the browser side, and parsing the text box element in the acquisition page, converting the text box element into a DOM object; calling the DOM object processor of at least one text box element set to perform the described At least one text box element in the transformed DOM object is subjected to the customization processing of the setting; and the customization processing result is displayed on the text box element in the acquisition page. B12, according to the described method of B11, it is characterized in that, call the DOM object handler of at least one text box element of described setting to carry out the custom processing of described setting to at least one text box element in the DOM object of described conversion, Including: obtaining the position information of the text box element on the browser page from the converted DOM; according to the position information, generating an overlapping block-level layer on the text box element; on the block-level layer, Invoking the DOM object processor of the at least one text box element of the setting to perform customization processing of the setting on the at least one text box element in the converted DOM object. B13. The method according to B11, wherein displaying the customized processing result on the text box element in the acquisition page includes: displaying the customized processing result on all text box elements located on the acquisition page on the block level. B14, according to the described method of B12 or B13, it is characterized in that, when described block-level layer comprises div layer, described customization processing result is displayed on the text box element in obtaining page, comprises: obtaining described text box element The content information generated after customization processing; the content information is decoded, and the decoded content information is displayed on the div layer. B15, according to the method described in any one of B11 to B14, it is characterized in that, call the DOM object processor of at least one text box element of described setting to carry out described at least one text box element in the DOM object of described conversion Before the customized processing of the settings, it includes: querying from the object processing registry whether there is a DOM object handler for processing the text box element in the browser, wherein the at least one object handler is registered in the object processing registry DOM object handler. B16. The method according to any one of B11 to B15, wherein the at least one DOM object processor stores a processing method for processing the event ContentReady triggered when the loading of the text box element is completed. B17. The method according to B16, wherein the processing method includes at least one of the following: different fonts are set for different characters in the text box element; input forms are entered in the text box element; input image in the text box element; input multimedia information in the text box element. B18. The method according to B17, wherein the multimedia information includes audio and/or video. B19, according to the method described in any one of B17 to B18, it is characterized in that, when the block-level layer includes a div layer, the DOM object processor of the at least one text box element that is set is called to convert the DOM object Performing the custom processing of the settings on at least one text box element, including: calling the innerText property of the text box element; calling the DOM object processor of at least one text box element of the setting to redefine the innerText property ; Return the redefined innerHTML property of the text box element to the div layer. B20. The method according to B19, wherein the redefinition operation includes: onblur or onSubmit processing. B21, according to the method described in any one of B11 to B20, it is characterized in that, when the browser is an IE browser, the client where the browser is located is provided with the first interface IElementBehaviorFactory, the second interface IElementBehavior and the WebBrowser plug-in The third interface IDocHostUIHandler, wherein the first interface and the second interface are used to call each DOM object handler, and the third interface is used to register each DOM object handler in the object processing registry; Calling the DOM object processor of at least one text box element of the setting includes: the kernel engine calls the BehaviorName connected to the first interface through the second interface according to the behavior name BehaviorName provided by the client where the browser is located The DOM object processor of at least one text box element of the setting; and when the kernel engine loads the corresponding page element according to the page element identifier TAG provided by the client, call the element behavior notification method to notify the client page The loading state of the element. B22, according to the method described in B21, it is characterized in that, the DOM object handler of at least one text box element of described setting is called by the kernel engine, comprising: the fourth interface IElementBehaviorSite provided by the kernel engine and the acquisition page Association, calling the corresponding DOM object handler when it is determined through the fourth interface that the text box element has been customized.
Claims (20)
Priority Applications (3)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210454662.7A CN102981847B (en) | 2012-11-13 | 2012-11-13 | The browser that page text frame is processed and method |
| US14/442,227 US9996512B2 (en) | 2012-11-13 | 2013-09-18 | Customized processing of DOM objects |
| PCT/CN2013/083706 WO2014075509A1 (en) | 2012-11-13 | 2013-09-18 | Method and device for browser to process page element |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201210454662.7A CN102981847B (en) | 2012-11-13 | 2012-11-13 | The browser that page text frame is processed and method |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN102981847A CN102981847A (en) | 2013-03-20 |
| CN102981847B true CN102981847B (en) | 2015-11-25 |
Family
ID=47855912
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201210454662.7A Active CN102981847B (en) | 2012-11-13 | 2012-11-13 | The browser that page text frame is processed and method |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN102981847B (en) |
Families Citing this family (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN102999579B (en) * | 2012-11-13 | 2015-11-25 | 北京奇虎科技有限公司 | Page text frame process browser and page text frame element disposal route |
| WO2014075509A1 (en) * | 2012-11-13 | 2014-05-22 | 北京奇虎科技有限公司 | Method and device for browser to process page element |
| CN105354338A (en) * | 2015-12-09 | 2016-02-24 | 浪潮电子信息产业股份有限公司 | find command searching method in Linux system |
| CN107515702B (en) * | 2016-06-16 | 2020-10-27 | 苏宁易购集团股份有限公司 | Page interaction method and device |
| CN108073386B (en) * | 2016-11-10 | 2021-08-13 | 北京国双科技有限公司 | Text box optimization method and device |
Citations (4)
| 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 |
| CN102214244A (en) * | 2011-07-07 | 2011-10-12 | 深圳市万兴软件有限公司 | Analytic method and system for docx file information |
| CN102663056A (en) * | 2012-03-29 | 2012-09-12 | 奇智软件(北京)有限公司 | A method and device for displaying picture elements |
| CN102999579A (en) * | 2012-11-13 | 2013-03-27 | 北京奇虎科技有限公司 | Browser for processing page textbox, and method for processing page textbox element |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US7444345B2 (en) * | 2005-02-15 | 2008-10-28 | International Business Machines Corporation | Hierarchical inherited XML DOM |
-
2012
- 2012-11-13 CN CN201210454662.7A patent/CN102981847B/en active Active
Patent Citations (4)
| 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 |
| CN102214244A (en) * | 2011-07-07 | 2011-10-12 | 深圳市万兴软件有限公司 | Analytic method and system for docx file information |
| CN102663056A (en) * | 2012-03-29 | 2012-09-12 | 奇智软件(北京)有限公司 | A method and device for displaying picture elements |
| CN102999579A (en) * | 2012-11-13 | 2013-03-27 | 北京奇虎科技有限公司 | Browser for processing page textbox, and method for processing page textbox element |
Non-Patent Citations (1)
| Title |
|---|
| 《基于DOM的网页信息抽取方法》;潘超 等;《硅谷》;20101031;第2010年卷(第20期);第172页、第190页 * |
Also Published As
| Publication number | Publication date |
|---|---|
| CN102981847A (en) | 2013-03-20 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| CN102999579B (en) | Page text frame process browser and page text frame element disposal route | |
| CN102999578B (en) | Page elements treatment process and device | |
| CN102981848B (en) | Webpage main body element process browser and method | |
| CN102981844B (en) | Browser and method for processing webpage main elements | |
| CN102981845B (en) | Browser carries out method and the device of page elements process | |
| US8990289B2 (en) | Server based framework for improving Ajax performance | |
| JP5290487B2 (en) | System and method for digital document processing | |
| CN102981847B (en) | The browser that page text frame is processed and method | |
| CN105094804A (en) | Method and apparatus for adding animation to page | |
| CN103019817B (en) | A kind of method and apparatus mutual for the page | |
| CN104933142A (en) | Animation display method and device | |
| US9996512B2 (en) | Customized processing of DOM objects | |
| CN103559097B (en) | The method of interprocess communication, device and browser in a kind of browser | |
| CN102981846B (en) | The method that Password Input frame element is processed and browser | |
| CN104065896B (en) | The method and apparatus that audio/video information is shown are carried out in a kind of browser | |
| JP2012022695A (en) | Method for digital document processing | |
| CN103500210A (en) | Method, device and browser for carrying out webpage loading | |
| JP2014524623A (en) | Template file processing method and apparatus | |
| CN103019538A (en) | Method and system for implementing application interface in terminal | |
| CN102999336A (en) | Application interface realizing method and application interface realizing system | |
| CN102902576B (en) | Method, server and system for rendering webpages | |
| CN103530329A (en) | Method and device for performing webpage loading and browsers | |
| CN103631630A (en) | Dynamic skin loading method for browser and browser device | |
| WO2019134237A1 (en) | Multi-page switching method, device, terminal apparatus, and storage medium | |
| CN104063247B (en) | The call method and system of a kind of application program |
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: 20220725 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 |