Movatterモバイル変換


[0]ホーム

URL:


CN103019715B - The apparatus and method of label are closed in browser - Google Patents

The apparatus and method of label are closed in browser
Download PDF

Info

Publication number
CN103019715B
CN103019715BCN201210535434.2ACN201210535434ACN103019715BCN 103019715 BCN103019715 BCN 103019715BCN 201210535434 ACN201210535434 ACN 201210535434ACN 103019715 BCN103019715 BCN 103019715B
Authority
CN
China
Prior art keywords
tag
label
tab
parent
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
Application number
CN201210535434.2A
Other languages
Chinese (zh)
Other versions
CN103019715A (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 LtdfiledCriticalBeijing Qihoo Technology Co Ltd
Priority to CN201210535434.2ApriorityCriticalpatent/CN103019715B/en
Publication of CN103019715ApublicationCriticalpatent/CN103019715A/en
Application grantedgrantedCritical
Publication of CN103019715BpublicationCriticalpatent/CN103019715B/en
Activelegal-statusCriticalCurrent
Anticipated expirationlegal-statusCritical

Links

Landscapes

Abstract

Translated fromChinese

本发明涉及网络数据通信技术领域,其公开了浏览器中关闭标签的装置和方法,关闭标签的装置包括:父标签判断模块,适于当接收到关闭标签的指示时,判断待关闭的标签是否具有父标签;子标签判断模块,适于在待关闭的标签具有父标签时,判断该父标签是否具有多个子标签;标签关闭模块,适于在父标签具有多个子标签时,完成标签关闭,并将当前呈现的标签切换为查找到的父标签的一个子标签;在父标签仅以待关闭的标签为子标签时,完成标签关闭,并将当前呈现的标签切换为该父标签。本发明能够解决关闭标签后呈现的标签与已关闭的标签间缺少关联性的技术问题,取得了能够自动呈现出与已关闭标签相关联的标签的有益效果。

The invention relates to the technical field of network data communication, which discloses a device and a method for closing a label in a browser. The device for closing a label includes: a parent label judging module, adapted to judge whether the label to be closed is Has a parent tag; the sub-tag judging module is suitable for judging whether the parent tag has multiple sub-tags when the tag to be closed has a parent tag; the tag closing module is suitable for completing tag closing when the parent tag has multiple sub-tags, And switch the currently presented label to a child label of the found parent label; when the parent label only has the label to be closed as a child label, complete label closing, and switch the currently presented label to the parent label. The present invention can solve the technical problem of lack of correlation between the tabs presented after the tabs are closed and the closed tabs, and achieve the beneficial effect of automatically presenting the tabs associated with the closed tabs.

Description

Translated fromChinese
浏览器中关闭标签的装置和方法Apparatus and method for closing tabs in browser

技术领域technical field

本发明涉及网络数据通信技术领域,具体涉及一种浏览器中关闭标签的装置和方法。The invention relates to the technical field of network data communication, in particular to a device and method for closing tags in a browser.

背景技术Background technique

现有技术中,当关闭一个标签后,会切换到该已关闭的标签的一个相邻标签,并呈现该相邻标签。但是,该与已关闭的标签相邻的标签,就标签中网页内容而言与已关闭的标签不一定具有关联。由此,造成关闭标签后呈现的标签与已关闭的标签间缺少关联性,无法自动呈现出已关闭标签的关联标签的问题。In the prior art, when a tab is closed, it will switch to an adjacent tab of the closed tab and present the adjacent tab. However, the label adjacent to the closed label may not necessarily be related to the closed label in terms of the content of the webpage in the label. As a result, there is a problem that the label presented after closing the label lacks correlation with the closed label, and the associated label of the closed label cannot be automatically presented.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的浏览器中关闭标签的装置和方法。In view of the above problems, the present invention is proposed to provide an apparatus and method for closing tabs in a browser that overcomes the above problems or at least partially solves the above problems.

依据本发明的一个方面,提供了一种浏览器中关闭标签的装置,所述装置包括:According to one aspect of the present invention, a device for closing tags in a browser is provided, the device comprising:

父标签判断模块,适于当接收到关闭标签的指示时,判断待关闭的标签是否具有父标签,将判断结果通知给子标签判断模块;The parent tag judging module is suitable for judging whether the tag to be closed has a parent tag when receiving an instruction to close the tag, and notifying the judging result to the sub-tag judging module;

子标签判断模块,适于在判断结果为待关闭的标签具有父标签时,判断该父标签是否具有多个子标签,并将该判断结果通知给标签关闭模块;The sub-tag judging module is suitable for judging whether the parent tag has multiple sub-tags when the judging result is that the tag to be closed has a parent tag, and notifying the tag closing module of the judging result;

标签关闭模块,适于在接收到的子标签判断模块的判断结果为父标签具有多个子标签时,完成标签关闭,并将当前呈现的标签切换为查找到的父标签的一个子标签;在接收到的子标签判断模块的判断结果为父标签仅以待关闭的标签为子标签时,完成标签关闭,并将当前呈现的标签切换为该父标签;The tag closing module is adapted to complete the tag closing when the received sub-tag judging module determines that the parent tag has multiple sub-tags, and switch the currently presented tag to a sub-tag of the found parent tag; When the judging result of the received sub-tag judging module is that the parent tag only uses the tag to be closed as a sub-tag, the tag closing is completed and the currently presented tag is switched to the parent tag;

所述子标签为通过点击所述父标签中链接而生成的用于加载该链接的网页的标签。The sub-label is a label generated by clicking a link in the parent label and used to load the webpage of the link.

可选地,所述装置还包括:位置判断模块,Optionally, the device further includes: a location judgment module,

所述父标签判断模块,还适于将判断结果通知给所述位置判断模块;The parent tag judging module is further adapted to notify the location judging module of the judging result;

所述位置判断模块,适于在判断结果为待关闭的标签不具有父标签时,判断待关闭的标签是否位于浏览器最后,将该判断结果通知给标签关闭模块;The position judging module is suitable for judging whether the tag to be closed is located at the end of the browser when the judging result is that the tag to be closed does not have a parent tag, and notifying the tag closing module of the judgment result;

所述标签关闭模块,还适于在所述位置判断模块的判断结果为待关闭的标签位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之前的上一个标签;在位置判断模块的判断结果为待关闭的标签不是位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之后的下一个标签。The label closing module is also suitable for completing the label closing when the judgment result of the position judgment module is that the label to be closed is at the end of the browser, and switching the currently presented label to the previous label before the closed label; When the judging result of the position judging module is that the tab to be closed is not at the end of the browser, closing the tab is completed, and the currently presented tab is switched to the next tab after the closed tab.

可选地,所述装置还包括:标签数量判断模块,Optionally, the device also includes: a label quantity judgment module,

所述父标签判断模块,具体适于当接收到关闭标签的指示后,指示标签数量判断模块进行浏览器中是否仅包含待关闭的标签的判断,在标签数量判断模块的判断结果为浏览器中不是仅包括待关闭的标签时,判断待关闭的标签是否具有父标签,将判断结果通知给子标签判断模块,在标签数量判断模块的判断结果为浏览器中仅包括待关闭的标签时,结束操作,不进行待关闭的标签是否具有父标签的判断;The parent tag judging module is specifically adapted to instruct the tag quantity judging module to judge whether only labels to be closed are included in the browser after receiving the instruction to close the tag, and the judgment result of the tag quantity judging module is that in the browser When the label to be closed is not included only, determine whether the label to be closed has a parent label, and notify the sub-label judgment module of the judgment result, and when the judgment result of the label quantity judgment module is that only the label to be closed is included in the browser, end operation, without judging whether the tag to be closed has a parent tag;

所述标签数量判断模块还适于将判断结果通知给所述标签关闭模块;The tag quantity judging module is also suitable for notifying the tag closing module of the judging result;

所述标签关闭模块还适于,在接收的所述标签数量判断模块的判断结果为浏览器中仅包括待关闭的标签时,完成标签关闭后生成新标签,并呈现该新标签。The tab closing module is further adapted to, when the received judgment result of the tab quantity judging module is that only tabs to be closed are included in the browser, a new tab is generated after tab closing is completed, and the new tab is presented.

可选地,所述标签关闭模块进一步适于,在完成标签关闭后,使切换到的标签获得浏览器焦点,以在浏览器的显示界面中呈现切换到的标签。Optionally, the tab closing module is further adapted to, after closing the tab, make the switched tab obtain the browser focus, so as to present the switched tab in the display interface of the browser.

根据本发明的另一方面,提供了一种浏览器中关闭标签的方法,所述方法包括:According to another aspect of the present invention, a method for closing tabs in a browser is provided, the method comprising:

当接收到关闭标签的指示时,判断待关闭的标签是否具有父标签,如果具有父标签,则进一步判断该父标签是否具有多个子标签;When an instruction to close a tag is received, it is judged whether the tag to be closed has a parent tag, and if it has a parent tag, it is further judged whether the parent tag has multiple child tags;

如果该父标签具有多个子标签,则完成标签关闭,将当前呈现的标签切换为查找到的该父标签的一个子标签;If the parent tag has multiple sub-tags, close the tag and switch the currently rendered tag to a found sub-tag of the parent tag;

如果该父标签仅以该待关闭的标签为子标签,则完成标签关闭,将当前呈现的标签切换为该父标签;If the parent tag only has the tag to be closed as a child tag, then complete the tag closing and switch the currently rendered tag to the parent tag;

所述子标签为通过点击所述父标签中链接而生成的用于加载该链接的网页的标签。The sub-label is a label generated by clicking a link in the parent label and used to load the webpage of the link.

可选地,所述方法还包括:Optionally, the method also includes:

当待关闭的标签不具有父标签时,判断待关闭的标签是否位于浏览器最后;When the label to be closed does not have a parent label, determine whether the label to be closed is at the end of the browser;

如果位于浏览器最后,则完成标签关闭,将当前呈现的标签切换为关闭的标签之前的上一个标签;If it is at the end of the browser, close the tab and switch the currently rendered tab to the previous tab before the closed tab;

如果不是位于浏览器最后,则完成标签关闭,将当前呈现的标签切换为关闭的标签之后的下一个标签。If it is not at the end of the browser, complete tab closing, switching the currently rendered tab to the next tab after the closed tab.

可选地,在判断待关闭的标签是否具有父标签前还包括:Optionally, before judging whether the tag to be closed has a parent tag:

判断浏览器中是否仅包括待关闭的标签,如果是,则完成标签关闭后生成新标签,并呈现该新标签。Determine whether the browser only includes the tabs to be closed, and if so, generate a new tab after closing the tabs, and present the new tab.

可选地,所述将当前呈现的标签切换为查找到的该父标签的一个子标签进一步包括:Optionally, said switching the currently presented label to a child label of the found parent label further includes:

使切换到的子标签获得浏览器焦点,以在浏览器的显示界面中呈现该子标签;Make the switched-to sub-tab obtain the browser focus, so as to present the sub-tab in the display interface of the browser;

所述将当前呈现的标签切换为该父标签进一步包括:Said switching the currently presented label to the parent label further includes:

使切换到的父标签获得浏览器焦点,以在浏览器的显示界面中呈现该父标签。Make the parent tab to be switched to get the browser focus, so as to present the parent tab in the browser's display interface.

根据本发明的技术方案,可以在关闭标签时,判断待关闭的标签是否具有父标签,如果具有父标签,则进一步判断该父标签是否具有多个子标签。如果该父标签具有多个子标签,则完成标签关闭,将当前呈现的标签切换为查找到的该父标签的一个子标签;如果该父标签仅以该待关闭的标签为子标签,则完成标签关闭,将当前呈现的标签切换为该父标签。由此,使得关闭标签时,在完成标签关闭后,优先切换到与已关闭的标签在内容上具有关联的标签,该标签与已关闭的标签具有相同的父标签或者两者为父子关系,进而解决了关闭标签后呈现的标签与已关闭的标签间缺少关联性的问题;取得了能够自动呈现出与已关闭标签相关联的标签的有益效果。According to the technical solution of the present invention, when closing a tag, it can be judged whether the tag to be closed has a parent tag, and if it has a parent tag, it is further judged whether the parent tag has multiple child tags. If the parent tag has multiple sub-tags, close the tag and switch the currently rendered tag to a sub-tag of the found parent tag; if the parent tag only has the tag to be closed as a child tag, complete the tag Close, switches the currently rendered tab to this parent tab. As a result, when closing a tag, after the tag is closed, it is preferred to switch to the tag that is associated with the closed tag in terms of content, and the tag has the same parent tag as the closed tag or both are parent-child relationships, and then Solve the problem of the lack of correlation between the tabs presented after closing the tabs and the closed tabs; achieve the beneficial effect of automatically presenting the tabs associated with the closed tabs.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。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 structural diagram of a device for adding tags in a browser according to an embodiment of the present invention;

图2示出了根据本发明一个实施例中添加标签后浏览器中的标签排序;Fig. 2 shows the tab sorting in the browser after adding tabs according to one embodiment of the present invention;

图3示出了根据本发明一个实施例的浏览器中关闭标签的装置的结构图;FIG. 3 shows a structural diagram of a device for closing tabs in a browser according to an embodiment of the present invention;

图4示出了根据本发明一个实施例的浏览器中关闭标签的装置的结构图;FIG. 4 shows a structural diagram of a device for closing tabs in a browser according to an embodiment of the present invention;

图5示出了根据本发明一个实施例的浏览器中关闭标签的装置的结构图;Figure 5 shows a structural diagram of a device for closing tabs in a browser according to an embodiment of the present invention;

图6示出了根据本发明一个实施例的浏览器中添加标签的方法的流程图;Fig. 6 shows the flowchart of the method for adding label in the browser according to one embodiment of the present invention;

图7示出了根据本发明一个实施例的浏览器中关闭标签的方法的流程图;以及Fig. 7 shows the flow chart of the method for closing label in the browser according to one embodiment of the present invention; And

图8示出了根据本发明一个实施例的浏览器中关闭标签的方法的流程图。Fig. 8 shows a flowchart of a method for closing a tag in a browser 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.

参见图1,示出了根据本发明一个实施例的添加标签装置的结构图。该添加标签装置100包括:生成模块110、判断模块120和添加模块130。Referring to FIG. 1 , it shows a structural diagram of a labeling device according to an embodiment of the present invention. The labeling device 100 includes: a generating module 110 , a judging module 120 and an adding module 130 .

生成模块110,适于接收生成新标签的指示,根据接收的指示生成新标签。The generation module 110 is adapted to receive an instruction to generate a new label, and generate a new label according to the received instruction.

判断模块120,适于判断浏览器中是否仅包含该生成的新标签,并将判断结果通知给添加模块130。The judging module 120 is adapted to judge whether only the generated new tag is included in the browser, and notify the adding module 130 of the judging result.

添加模块130,适于在判断结果为浏览器中仅包含该生成的新标签时,在浏览器的显示界面中加入该新标签并呈现;在判断结果为浏览器中不是仅包含该生成的新标签时,在浏览器的显示界面中当前呈现的标签之后的下一个位置中插入该新标签,并呈现该新标签。The adding module 130 is suitable for adding and presenting the new label in the display interface of the browser when the judgment result is that the browser only contains the generated new label; when the judgment result is that the browser does not only contain the generated new label When a label is displayed, the new label is inserted in the next position after the currently presented label in the display interface of the browser, and the new label is presented.

本实施例中,浏览器可以为手机浏览器、PC浏览器或PAD浏览器,在此没有特别限制。In this embodiment, the browser may be a mobile phone browser, a PC browser or a PAD browser, and there is no special limitation here.

其中,添加模块130进一步适于使新标签获得浏览器焦点,以在浏览器的显示界面中呈现该新标签。Wherein, the adding module 130 is further adapted to make the new label obtain the focus of the browser, so as to present the new label in the display interface of the browser.

其中,生成模块110进一步适于接收到点击当前呈现的标签中链接的指示后,生成加载该链接的网页的新标签。Wherein, the generation module 110 is further adapted to generate a new label that loads the webpage of the link after receiving an indication of clicking a link in the currently presented label.

其中,生成模块110进一步适于接收到点击浏览器中标签添加按钮的指示后,生成空白或加载预设的网页的新标签。Wherein, the generation module 110 is further adapted to generate a new label that is blank or loads a preset webpage after receiving an instruction to click the label addition button in the browser.

例如,在浏览器中要添加标签A、标签A1、标签A2、标签B、标签B1、标签B2、标签C、标签D、标签D1和标签D2。其中,标签A1和标签A2为标签A的子标签;标签B1和标签B2为标签B的子标签;标签D1和标签D2为标签D的子标签。即标签A1和标签A2通过点击标签A中链接而添加,标签B1和标签B2通过点击标签B中链接而添加,标签D1和标签D2通过点击标签D中链接而添加。For example, label A, label A1, label A2, label B, label B1, label B2, label C, label D, label D1 and label D2 should be added in the browser. Among them, label A1 and label A2 are sublabels of label A; label B1 and label B2 are sublabels of label B; label D1 and label D2 are sublabels of label D. That is, label A1 and label A2 are added by clicking the link in label A, label B1 and label B2 are added by clicking the link in label B, and label D1 and label D2 are added by clicking the link in label D.

该举例中的添加过程如下所示。添加后的标签序列如图2所示。The addition process in this example is as follows. The added tag sequence is shown in Figure 2.

首先,新建标签A。生成模块110接收到生成标签A的指示,根据接收的指示生成标签A。判断模块120判断出浏览器中仅包含标签A,将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中加入标签A,使标签A获得浏览器焦点,以呈现标签A。First, create a new label A. The generating module 110 receives an instruction to generate a label A, and generates a label A according to the received instruction. The judging module 120 judges that only the tag A is included in the browser, and notifies the adding module 130 of the judging result. The adding module 130 adds the label A to the display interface of the browser, so that the label A obtains the focus of the browser, so as to present the label A.

点击标签A中链接,添加标签A1。生成模块110接收点击标签A中链接的指示,生成加载该链接中网页的标签A1。判断模块120判断出浏览器中不是仅包含标签A1,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签A之后的下一个位置中插入标签A1,使标签A1获得浏览器焦点,以呈现标签A1。即在将标签A1加入标签A后,呈现标签A1中网页。Click the link in label A to add label A1. The generating module 110 receives an instruction of clicking the link in the tag A, and generates a tag A1 that loads the webpage in the link. The judging module 120 judges that the browser does not contain only the tag A1, and notifies the adding module 130 of the judging result. The adding module 130 inserts the label A1 in the next position after the currently presented label A in the display interface of the browser, so that the label A1 obtains the focus of the browser to present the label A1. That is, after the tag A1 is added to the tag A, the webpage in the tag A1 is presented.

新建标签B,添加标签B。生成模块110接收点击浏览器中标签添加按钮的指示,生成标签B。标签B可以为空白标签,在标签添加完成后,通过输入网址,加载该网址的网页。或者,生成的标签B中加载预设的网页。判断模块120判断出浏览器中不是仅包含标签B,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签A1之后的下一个位置中插入标签B,使标签B获得浏览器焦点,以呈现标签B。即在将标签B加入标签A1后,呈现标签B中内容。Create a new label B and add label B. The generating module 110 receives an instruction of clicking the label adding button in the browser, and generates label B. Label B can be a blank label. After the label is added, the webpage of the URL is loaded by inputting the URL. Alternatively, a preset web page is loaded in the generated tab B. The judging module 120 judges that the browser does not contain only the tag B, and notifies the adding module 130 of the judging result. The adding module 130 inserts the label B in the next position after the currently presented label A1 in the display interface of the browser, so that the label B obtains the focus of the browser to present the label B. That is, after label B is added to label A1, the content in label B is presented.

点击标签B中链接,添加标签B1。生成模块110接收点击标签B中链接的指示,生成加载该链接中网页的标签B1。判断模块120判断出浏览器中不是仅包含标签B1,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签B之后的下一个位置中插入标签B1,使标签B1获得浏览器焦点,以呈现标签B1。即在将标签B1加入标签B后,呈现标签B1中网页。Click the link in label B to add label B1. The generating module 110 receives an instruction to click on the link in the label B, and generates a label B1 that loads the webpage in the link. The judging module 120 judges that the browser does not contain only the tag B1, and notifies the adding module 130 of the judging result. The adding module 130 inserts the label B1 in the next position after the currently presented label B in the display interface of the browser, so that the label B1 obtains the focus of the browser to present the label B1. That is, after the label B1 is added to the label B, the webpage in the label B1 is presented.

点击标签A,使得标签A获得焦点,呈现标签A。点击标签A中另一链接,添加标签A2。生成模块110接收点击标签A中另一链接的指示,生成加载该链接中网页的标签A2。判断模块120判断出浏览器中不是仅包含标签A2,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签A之后的下一个位置中插入标签A2,使标签A2获得浏览器焦点,以呈现标签A2。即在将标签A2加入标签A和标签A1之间,呈现标签A2中网页。Click on tab A, so that tab A gets the focus, and tab A is presented. Click another link in label A to add label A2. The generating module 110 receives an instruction of clicking another link in the tag A, and generates a tag A2 that loads the webpage in the link. The judging module 120 judges that the browser does not contain only the tag A2, and notifies the adding module 130 of the judging result. The adding module 130 inserts the label A2 in the next position after the currently presented label A in the display interface of the browser, so that the label A2 obtains the focus of the browser, so as to present the label A2. That is, after label A2 is added between label A and label A1, the webpage in label A2 is presented.

新建标签C,添加标签C。生成模块110接收点击浏览器中标签添加按钮的指示,生成标签C。标签C可以为空白标签,在标签添加完成后,通过输入网址,加载该网址的网页。或者,生成的标签C中加载预设的网页。判断模块120判断出浏览器中不是仅包含标签C,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签A2之后的下一个位置中插入标签C,使标签C获得浏览器焦点,以呈现标签C。即在将标签C加入标签A2后,呈现标签C中内容。Create a new label C and add label C. The generation module 110 receives an instruction of clicking the label addition button in the browser, and generates a label C. Label C can be a blank label, and after the label is added, the webpage of the URL is loaded by inputting the URL. Alternatively, a preset web page is loaded in the generated tag C. The judging module 120 judges that the browser does not contain only the tag C, and notifies the adding module 130 of the judging result. The adding module 130 inserts the tag C in the next position after the currently presented tag A2 in the display interface of the browser, so that the tag C obtains the focus of the browser to present the tag C. That is, after label C is added to label A2, the content in label C is presented.

点击标签B,使得标签B获得焦点,呈现标签B。点击标签B中另一链接,添加标签B2。生成模块110接收点击标签B中另一链接的指示,生成加载该链接中网页的标签B2。判断模块120判断出浏览器中不是仅包含标签B2,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签B之后的下一个位置中插入标签B2,使标签B2获得浏览器焦点,以呈现标签B2。即在将标签B2加入标签B之后,呈现标签B2中网页。Click on tab B, so that tab B gets the focus, and tab B is presented. Click another link in label B to add label B2. The generation module 110 receives an instruction of clicking another link in the label B, and generates a label B2 that loads the webpage in the link. The judging module 120 judges that the browser does not contain only the tag B2, and notifies the adding module 130 of the judging result. The adding module 130 inserts the label B2 in the next position after the currently presented label B in the display interface of the browser, so that the label B2 obtains the focus of the browser, so as to present the label B2. That is, after the tag B2 is added to the tag B, the webpage in the tag B2 is presented.

点击标签B1,使得标签B1获得焦点,呈现标签B1。新建标签D,添加标签D。生成模块110接收点击浏览器中标签添加按钮的指示,生成标签D。标签D可以为空白标签,在标签添加完成后,通过输入网址,加载该网址的网页。或者,生成的标签D中加载预设的网页。判断模块120判断出浏览器中不是仅包含标签D,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签B1之后的下一个位置中插入标签D,使标签D获得浏览器焦点,以呈现标签D。即在将标签D加入标签B1后,呈现标签D中内容。Click on the label B1, so that the label B1 gets the focus, and the label B1 is presented. Create a new label D and add label D. The generation module 110 receives an instruction of clicking the label addition button in the browser, and generates a label D. The label D can be a blank label, and after the label is added, the webpage of the website is loaded by inputting the website address. Alternatively, a preset web page is loaded in the generated tag D. The judging module 120 judges that the browser does not contain only the tag D, and notifies the adding module 130 of the judging result. The adding module 130 inserts a label D in the next position after the currently presented label B1 in the display interface of the browser, so that the label D obtains the focus of the browser to present the label D. That is, after label D is added to label B1, the content in label D is presented.

在标签D中一次点击第一链接和第二链接,添加标签D1和标签D2。例如,在标签D中通过按住ctrl键后,点击第一链接和第二链接的方式,实现在标签D中一次点击第一链接和第二链接。生成模块110接收点击标签D中第一链接的指示,生成加载该链接中网页的标签D1;接收点击标签D中第二链接的指示,生成加载该链接中网页的标签D2。判断模块120判断出浏览器中不是仅包含标签D1,浏览器中不是仅包含标签D2,并将判断结果通知给添加模块130。添加模块130在浏览器的显示界面中当前呈现的标签D之后的下一个位置中插入标签D1,在浏览器的显示界面中当前呈现的标签D和添加的标签D1间添加标签D2。标签D2获得浏览器焦点,呈现标签D2。Click the first link and the second link once in label D, add label D1 and label D2. For example, by holding down the ctrl key in label D and clicking on the first link and the second link, the first link and the second link in label D can be clicked once. The generation module 110 receives the instruction of clicking the first link in the label D, and generates a label D1 for loading the webpage in the link; receives the instruction of clicking the second link in the label D, and generates a label D2 for loading the webpage in the link. The judging module 120 judges that the browser does not only contain the tag D1, and the browser does not only contain the tag D2, and notifies the adding module 130 of the judging result. The adding module 130 inserts a tag D1 in the next position after the tag D currently presented in the display interface of the browser, and adds a tag D2 between the tag D currently presented in the browser display interface and the added tag D1. Tab D2 gets the browser focus, and tab D2 is rendered.

本实施例中,在添加标签时,新标签都在当前呈现的标签之后的位置,进而解决了添加前浏览的标签与新添加的标签间距离较远的问题;使得添加前浏览的标签与新添加的标签相邻,取得了在呈现新添加的标签的同时,易于查找出添加前浏览的标签的有益效果。In this embodiment, when adding tags, the new tags are all behind the currently presented tags, thereby solving the problem that the tags browsed before adding are far away from the newly added tags; The added tags are adjacent to each other, and at the same time the newly added tags are presented, the beneficial effect of being easy to find out the tags browsed before adding is achieved.

在一实施例中,生成模块110进一步适于接收到点击当前呈现的标签中链接的指示后,生成加载该链接的网页的新标签。当前呈现的标签为新标签的父标签,新标签为当前呈现的标签的子标签。In an embodiment, the generation module 110 is further adapted to generate a new label that loads the webpage of the link after receiving the indication of clicking the link in the currently presented label. The currently rendered tag is the parent tag of the new tag, and the new tag is the child tag of the currently rendered tag.

添加模块130进一步适于在判断结果为浏览器中不是仅包含所述生成的新标签时,确定浏览器的显示界面中当前呈现的标签为新标签的父标签,通过父标签的子标签添加接口在显示界面中当前呈现的标签之后的下一个位置中插入该新标签并呈现。The adding module 130 is further adapted to determine that the currently presented label in the display interface of the browser is the parent label of the new label when the judged result is that the browser does not only contain the generated new label, and add the interface through the sublabel of the parent label. The new label is inserted and presented in the next position after the currently presented label in the display interface.

在另一实施例中,生成模块110进一步适于接收到点击浏览器中标签添加按钮的指示后,生成空白或加载预设的网页的新标签。In another embodiment, the generation module 110 is further adapted to generate a new label that is blank or loads a preset webpage after receiving an instruction to click the label addition button in the browser.

添加模块130进一步适于在判断结果为浏览器中不是仅包含所述生成的新标签时,获得当前呈现的标签在浏览器显示界面中的排序位置,通过标签容器的标签添加接口在该位置之后的下一个位置中插入该新标签;The adding module 130 is further adapted to obtain the sorting position of the currently presented label in the browser display interface when the judging result is that the browser does not only contain the generated new label, after the position through the label adding interface of the label container Insert the new tag in the next position of the ;

标签容器用于存放浏览器中各个标签。The tab container is used to store each tab in the browser.

举例而言,添加模块130中设置标签类Tab和标签容器类TabContainer。For example, the tab class Tab and the tab container class TabContainer are set in the adding module 130 .

标签类的对象为标签,标签类Tab包括接口:The object of the label class is a label, and the label class Tab includes the interface:

VoidsetParentTab(Tabparent),用于设置父标签的父标签设置接口;VoidsetParentTab(Tabparent), used to set the parent tab setting interface of the parent tab;

TabgetParent(),用于获取父标签的父标签获取接口;TabgetParent(), used to get the parent tag acquisition interface of the parent tag;

VoidaddChildTab(Tabchild),用于添加子标签的子标签添加接口。VoidaddChildTab(Tabchild), the sub-tab adding interface used to add sub-tabs.

标签类包括参量:The label class includes parameters:

ArrayList<Tab>mTabContainer,用于存放浏览器中各个标签的标签容器,ArrayList<Tab>mTabContainer, used to store the tab container of each tab in the browser,

HashMap<intkey,TabmTab>mTabMap,用于映射标签的哈希表,通过键值(key,value)进行标签存储,可以通过key映射到对应的标签。HashMap<intkey,TabmTab>mTabMap, used to map the hash table of the label, stores the label through the key value (key, value), and can map to the corresponding label through the key.

IntmCurrentTabKey,用于记录当前标签的key的当前标签键码,在浏览器中没有标签时,该参量初始值为-1。IntmCurrentTabKey, used to record the current tab key code of the key of the current tab. When there is no tab in the browser, the initial value of this parameter is -1.

标签类包括接口,Tag classes include interfaces,

VoidaddTab(TabmTab),用于在浏览器中添加初始标签的初始标签添加接口;VoidaddTab (TabmTab), the initial tab addition interface used to add initial tabs in the browser;

VoidaddTab(intindex,TabmTab),用于添加初始标签之后的标签的标签添加接口。VoidaddTab(intindex, TabmTab), a tab addition interface for adding tabs after the initial tab.

判断模块120通过mCurrentTabKey判断浏览器中是否仅包含该生成的新标签,当mCurrentTabKey=-1时,浏览器中仅包含该生成的新标签,否则,浏览器中不是仅包含该生成的新标签。The judging module 120 judges whether only the generated new tab is included in the browser through mCurrentTabKey. When mCurrentTabKey=-1, only the generated new tab is included in the browser; otherwise, the browser does not only include the generated new tab.

添加模块130在mCurrentTabKey=-1时,通过标签容器的初始标签添加接口在浏览器的显示界面中加入该新标签并呈现。例如:通过Tabtab=newtab,将新建标签赋值给变量tab。通过addTab(tab)在浏览器的显示界面中加入该新标签并呈现。此外,通过intkey=tab.hashcode(),计算新标签的键码,hashcode()为用于计算键码的接口。通过mTabMap.put(key,tab),将新标签存入哈希表中。通过mCurrentTabkey=key,更新参量mCurrentTabKey。When mCurrentTabKey=-1, the adding module 130 adds and presents the new tag in the display interface of the browser through the initial tag adding interface of the tag container. For example: through Tabtab=newtab, assign the new tab to the variable tab. The new tab is added and presented in the display interface of the browser through addTab(tab). In addition, calculate the key code of the new tab through intkey=tab.hashcode(), and hashcode() is the interface used to calculate the key code. Store the new label in the hash table through mTabMap.put(key, tab). Through mCurrentTabkey=key, update the parameter mCurrentTabKey.

添加模块130在mCurrentTabKey≠-1,并且新标签具有父标签,即接收到点击当前呈现的标签中链接的指示而生成新标签时,通过父标签的子标签添加接口在显示界面中当前呈现的标签之后的下一个位置中插入该新标签并呈现。例如:通过Tabtab=newtab,将新建标签赋值给变量tab。通过TabparrentTab=mTabmap.get(mCurrentTabkey),从哈希表中取出当前呈现的标签,该标签为待添加的新标签的父标签。通过parentTab.addchildTab(tab)在显示界面中当前呈现的标签之后的下一个位置中插入该新标签并呈现,即在显示界面中父标签之后的下一个位置中插入该新标签并呈现。此外,通过intkey=tab.hashcode(),计算新标签的键码。通过mTabMap.put(key,tab),将新标签存入哈希表中。通过mCurrentTabkey=key,更新参量mCurrentTabKey。The adding module 130 is when mCurrentTabKey≠-1, and the new label has a parent label, that is, when a new label is generated by receiving an instruction to click on a link in the currently presented label, the label currently presented in the display interface is added through the sublabel interface of the parent label The new tag is inserted and rendered at the next position after that. For example: through Tabtab=newtab, assign the new tab to the variable tab. Through TabparrentTab=mTabmap.get(mCurrentTabkey), get the currently presented tab from the hash table, which is the parent tab of the new tab to be added. Through parentTab.addchildTab(tab), the new tab is inserted and presented in the next position after the currently presented tab in the display interface, that is, the new tab is inserted and presented in the next position after the parent tab in the display interface. In addition, calculate the key code of the new tab by intkey=tab.hashcode(). Store the new label in the hash table through mTabMap.put(key, tab). Through mCurrentTabkey=key, update the parameter mCurrentTabKey.

添加模块130在mCurrentTabKey≠-1,并且新标签不具有父标签,即接收到点击浏览器中标签添加按钮的指示而生成新标签时,获得当前呈现的标签在浏览器显示界面中的排序位置,通过标签容器的标签添加接口在该位置之后的下一个位置中插入该新标签。例如:通过Tabtab=newtab,将新建标签赋值给变量tab。通过addTab(index,tab)在浏览器的显示界面中加入该新标签并呈现。index为获得浏览器焦点的标签在标签在浏览器显示界面中的排序位置。此外,通过intkey=tab.hashcode(),计算新标签的键码。通过mTabMap.put(key,tab),将新标签存入哈希表中。通过mCurrentTabkey=key,更新参量mCurrentTabKey。Adding module 130 is when mCurrentTabKey≠-1, and new label does not have parent label, promptly receives and clicks the indication of label adding button in browser and generates new label, obtains the sorting position of the label that presents currently in browser display interface, The new label is inserted in the next position after the position through the label adding interface of the label container. For example: through Tabtab=newtab, assign the new tab to the variable tab. The new tab is added and presented in the display interface of the browser through addTab(index, tab). index is the sorting position of the tab that gets the browser focus in the tab display interface of the browser. In addition, calculate the key code of the new tab by intkey=tab.hashcode(). Store the new label in the hash table through mTabMap.put(key, tab). Through mCurrentTabkey=key, update the parameter mCurrentTabKey.

上述举例仅为本发明实施例的一种具体实施方式,本发明不限于此,可以通过多种方式实施。The above example is only a specific implementation manner of the embodiment of the present invention, and the present invention is not limited thereto, and may be implemented in various ways.

参见图3,示出了根据本发明一个实施例的浏览器中关闭标签的装置的结构图。关闭标签的装置200包括:父标签判断模块210、子标签判断模块220和标签关闭模块230。Referring to FIG. 3 , it shows a structural diagram of an apparatus for closing tags in a browser according to an embodiment of the present invention. The device 200 for closing tags includes: a parent tag judging module 210 , a child tag judging module 220 and a tag closing module 230 .

父标签判断模块210,适于当接收到关闭标签的指示时,判断待关闭的标签是否具有父标签,将判断结果通知给子标签判断模块220。The parent tag judging module 210 is adapted to judge whether the tag to be closed has a parent tag when receiving the instruction to close the tag, and notify the child tag judging module 220 of the judging result.

子标签判断模块220,适于在判断结果为待关闭的标签具有父标签时,判断该父标签是否具有多个子标签,并将该判断结果通知给标签关闭模块230。The sub-tag judging module 220 is adapted to judge whether the parent tag has multiple sub-tags when the judging result is that the tag to be closed has a parent tag, and notify the tag closing module 230 of the judging result.

标签关闭模块230,适于在接收到的子标签判断模块220的判断结果为父标签具有多个子标签时,完成标签关闭,并将当前呈现的标签切换为查找到的父标签的一个子标签;在接收到的子标签判断模块220的判断结果为父标签仅以待关闭的标签为子标签时,完成标签关闭,并将当前呈现的标签切换为该父标签。The tag closing module 230 is adapted to complete the tag closing when the received sub-tag judging module 220 determines that the parent tag has multiple sub-tags, and switch the currently presented tag to a sub-tag of the found parent tag; When the received sub-tab judging module 220 determines that the parent tab only has the tab to be closed as a sub-tab, the tab closing is completed, and the currently presented tab is switched to the parent tab.

其中,子标签为通过点击父标签中链接而生成的用于加载该链接的网页的标签。Wherein, the sub-tag is a tag generated by clicking a link in the parent tag for loading the webpage of the link.

进一步地,标签关闭模块230,适于在完成标签关闭后,使切换到的标签获得浏览器焦点,以在浏览器的显示界面中呈现切换到的标签。Further, the tab closing module 230 is adapted to make the switched tab obtain the focus of the browser after closing the tab, so as to present the switched tab in the display interface of the browser.

举例而言,在图2中所示的浏览器标签中,当接收到关闭标签A1的指示时,父标签判断模块210判断出标签A1具有父标签,标签A,并将判断结果通知该子标签判断模块220。子标签判断模块220判断出标签A具有多个子标签,并将判断结果通知给标签关闭模块230。标签关闭模块230,将标签A1关闭后,使标签A的另一个子标签,标签A2,获得浏览器焦点,呈现标签A2。For example, in the browser tab shown in Figure 2, when receiving the instruction to close the label A1, the parent label judging module 210 judges that the label A1 has a parent label, label A, and notifies the child label of the judgment result Judgment module 220 . The sub-tag judgment module 220 judges that the tag A has multiple sub-tags, and notifies the tag closing module 230 of the judgment result. The tab closing module 230, after closing the tab A1, makes another sub-tab of the tab A, tab A2, obtain the focus of the browser, and present the tab A2.

随后,当接收到关闭标签A2的指示时,父标签判断模块210判断出标签A2具有父标签,标签A,并将判断结果通知该子标签判断模块220。子标签判断模块220判断出标签A仅以标签A2为子标签,并将判断结果通知给标签关闭模块230。标签关闭模块230,将标签A2关闭后,使标签A获得浏览器焦点,呈现标签A。Subsequently, when receiving an instruction to close tag A2, the parent tag judging module 210 judges that tag A2 has a parent tag, tag A, and notifies the child tag judging module 220 of the judging result. The subtag judging module 220 judges that tag A only has tag A2 as a subtag, and notifies the tag closing module 230 of the judgment result. The tab closing module 230, after closing the tab A2, makes the tab A obtain the focus of the browser, and presents the tab A.

采用本实施例,关闭标签时,在完成标签关闭后,优先切换到与已关闭的标签在内容上具有关联的标签,该标签与已关闭的标签具有相同的父标签或者两者为父子关系,进而解决了关闭标签后呈现的标签与已关闭的标签间缺少关联性的问题;取得了能够自动呈现出与已关闭标签相关联的标签的有益效果。Using this embodiment, when closing a tag, after the tag is closed, it is preferred to switch to the tag that is associated with the closed tag in content, and the tag has the same parent tag as the closed tag or the two are in a parent-child relationship. Furthermore, the problem of lack of correlation between the tabs presented after the tabs are closed and the closed tabs is solved; the beneficial effect of being able to automatically present the tabs associated with the closed tabs is obtained.

参见图4,示出了根据本发明一个实施例的浏览器中关闭标签的装置的结构图。装置包括:父标签判断模块210、子标签判断模块220、标签关闭模块230和位置判断模块240。Referring to FIG. 4 , it shows a structural diagram of an apparatus for closing tags in a browser according to an embodiment of the present invention. The device includes: a parent tag judging module 210 , a child tag judging module 220 , a tag closing module 230 and a position judging module 240 .

父标签判断模块210,适于当接收到关闭标签的指示时,判断待关闭的标签是否具有父标签,将判断结果通知给子标签判断模块220和位置判断模块240。The parent tag judging module 210 is adapted to judge whether the tag to be closed has a parent tag when receiving the instruction to close the tag, and notify the sub-tag judging module 220 and the position judging module 240 of the judging result.

子标签判断模块220,适于在判断结果为待关闭的标签具有父标签时,判断该父标签是否具有多个子标签,并将该判断结果通知给标签关闭模块230。The sub-tag judging module 220 is adapted to judge whether the parent tag has multiple sub-tags when the judging result is that the tag to be closed has a parent tag, and notify the tag closing module 230 of the judging result.

标签关闭模块230,适于在接收到的子标签判断模块220的判断结果为父标签具有多个子标签时,完成标签关闭,并将当前呈现的标签切换为查找到的父标签的一个子标签;在接收到的子标签判断模块220的判断结果为父标签仅以待关闭的标签为子标签时,完成标签关闭,并将当前呈现的标签切换为该父标签。The tag closing module 230 is adapted to complete the tag closing when the received sub-tag judging module 220 determines that the parent tag has multiple sub-tags, and switch the currently presented tag to a sub-tag of the found parent tag; When the received sub-tab judging module 220 determines that the parent tab only has the tab to be closed as a sub-tab, the tab closing is completed, and the currently presented tab is switched to the parent tab.

位置判断模块240,适于在判断结果为待关闭的标签不具有父标签时,判断待关闭的标签是否位于浏览器最后,将该判断结果通知给标签关闭模块230。The location judging module 240 is adapted to judge whether the tag to be closed is at the end of the browser when the judging result is that the tag to be closed has no parent tag, and notify the tag closing module 230 of the judging result.

标签关闭模块230,还适于在位置判断模块240的判断结果为待关闭的标签位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之前的上一个标签;在位置判断模块240的判断结果为待关闭的标签不是位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之后的下一个标签。Tab closing module 230 is also suitable for when the judgment result of position judging module 240 is that the tab to be closed is at the end of the browser, complete tab closing, and switch the currently presented tab to the previous tab before the closed tab; When the judging result of the judging module 240 is that the tab to be closed is not at the end of the browser, the closing of the tab is completed, and the currently presented tab is switched to the next tab after the closed tab.

本实施例仅为本发明的一种具体实施方式,本发明不限于此。例如,本发明也可以不包括位置判断模块240。父标签判断模块210将判断结果也通知给标签关闭模块230。标签关闭模块230在判断结果为待关闭的标签不具有父标签时,完成标签关闭,并将当前呈现的标签切换为第一个标签,或者最后一个标签,或者任一具有子标签的父标签。因为,当待关闭的标签不具有父标签时,说明浏览器中包含的标签中没有待关闭的标签的关联标签,所以,在此种情况下,本发明对于关闭后呈现的标签没有特别限制。This embodiment is only a specific implementation manner of the present invention, and the present invention is not limited thereto. For example, the present invention may also not include the location judging module 240 . The parent tag judging module 210 also notifies the tag closing module 230 of the judging result. When the tab closing module 230 judges that the tab to be closed does not have a parent tab, it completes tab closing, and switches the currently presented tab to the first tab, or the last tab, or any parent tab with child tabs. Because, when the tag to be closed does not have a parent tag, it means that there is no associated tag of the tag to be closed among the tags included in the browser. Therefore, in this case, the present invention has no special limitation on the tag presented after closing.

参见图5,示出了根据本发明一个实施例的浏览器中关闭标签的装置的结构图。装置包括:标签数量判断模块250、父标签判断模块210、子标签判断模块220、标签关闭模块230和位置判断模块240。Referring to FIG. 5 , it shows a structural diagram of an apparatus for closing tags in a browser according to an embodiment of the present invention. The device includes: a tag quantity judging module 250 , a parent tag judging module 210 , a child tag judging module 220 , a tag closing module 230 and a position judging module 240 .

父标签判断模块210,适于当接收到关闭标签的指示时,指示标签数量判断模块250进行判断。The parent tag judging module 210 is adapted to instruct the tag quantity judging module 250 to make a judgment when receiving an instruction to close a tag.

标签数量判断模块250,适于判断浏览器中是否仅包含待关闭的标签,并将判断结果通知给所述标签关闭模块230,The tag quantity judging module 250 is suitable for judging whether the browser only contains tags to be closed, and notifies the tag closing module 230 of the judgment result,

父标签判断模块210在指示标签数量判断模块250进行判断后,等待标签数量判断模块250的判断结果,在判断结果为浏览器中不是仅包括待关闭的标签时,判断待关闭的标签是否具有父标签,将判断结果通知给子标签判断模块220和位置判断模块240,在判断结果为浏览器中仅包括待关闭的标签时,结束操作,不进行待关闭的标签是否具有父标签的判断。通过该方式,能够避免父标签判断模块210进行不必要的判断,以节约系统资源。Parent label judging module 210 waits for the judgment result of label quantity judging module 250 after instructing label quantity judging module 250 to judge, when judging result is not only including the label to be closed in the browser, judge whether the label to be closed has parent label, the judgment result is notified to the sub-label judgment module 220 and the position judgment module 240, and when the judgment result is that only the label to be closed is included in the browser, the operation is ended, and no judgment is made on whether the label to be closed has a parent label. In this way, it is possible to avoid unnecessary judgment by the parent label judging module 210, so as to save system resources.

标签关闭模块230,适于在接收的标签数量判断模块250的判断结果为浏览器中仅包括待关闭的标签时,完成标签关闭后生成新标签,并呈现该新标签。The tab closing module 230 is adapted to generate a new tab after closing the tabs and present the new tab when the received tab quantity judging module 250 judges that only tabs to be closed are included in the browser.

子标签判断模块220,适于在父标签判断模块210的判断结果为待关闭的标签具有父标签时,判断该父标签是否具有多个子标签,并将该判断结果通知给标签关闭模块230。当父标签判断模块210的判断结果为待关闭的标签不具有父标签时,不进行判断操作。The sub-tag judging module 220 is adapted to judge whether the parent tag has multiple sub-tags when the judging result of the parent tag judging module 210 is that the tag to be closed has a parent tag, and notify the tag closing module 230 of the judging result. When the judging result of the parent tag judging module 210 is that the tag to be closed does not have a parent tag, no judging operation is performed.

标签关闭模块230,还适于在接收到的子标签判断模块220的判断结果为父标签具有多个子标签时,完成标签关闭,并将当前呈现的标签切换为查找到的父标签的一个子标签;在接收到的子标签判断模块220的判断结果为父标签仅以待关闭的标签为子标签时,完成标签关闭,并将当前呈现的标签切换为该父标签。The tag closing module 230 is also adapted to complete the tag closing when the received sub-tag judging module 220 determines that the parent tag has multiple sub-tags, and switch the currently presented tag to a sub-tag of the found parent tag ; When the received judgment result of the sub-label judging module 220 is that the parent label only uses the label to be closed as a child label, complete label closing, and switch the currently presented label to the parent label.

位置判断模块240,适于在父标签判断模块210的判断结果为待关闭的标签不具有父标签时,判断待关闭的标签是否位于浏览器最后,将该判断结果通知给标签关闭模块230。当父标签判断模块210的判断结果为待关闭的标签具有父标签时,不进行判断操作。The position judging module 240 is adapted to judge whether the tag to be closed is at the end of the browser when the judging result of the parent tag judging module 210 is that the tag to be closed has no parent tag, and notify the tag closing module 230 of the judging result. When the judging result of the parent tag judging module 210 is that the tag to be closed has a parent tag, no judging operation is performed.

标签关闭模块230,还适于在位置判断模块240的判断结果为待关闭的标签位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之前的上一个标签;在位置判断模块240的判断结果为待关闭的标签不是位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之后的下一个标签。Tab closing module 230 is also suitable for when the judgment result of position judging module 240 is that the tab to be closed is at the end of the browser, complete tab closing, and switch the currently presented tab to the previous tab before the closed tab; When the judging result of the judging module 240 is that the tab to be closed is not at the end of the browser, the closing of the tab is completed, and the currently presented tab is switched to the next tab after the closed tab.

上述实施例仅为本发明的具体实施方式的示例性说明,本发明不限于此,可以通过多种其他的具体方式实施实现本发明。The above-mentioned embodiments are only illustrative descriptions of the specific implementation manners of the present invention, and the present invention is not limited thereto, and the present invention can be implemented and realized in various other specific manners.

参见图6,示出了根据本发明一个实施例的浏览器中添加标签的方法的流程图。该方法包括如下步骤。Referring to FIG. 6 , it shows a flowchart of a method for adding tags in a browser according to an embodiment of the present invention. The method includes the following steps.

步骤S610,接收生成新标签的指示,根据指示生成新标签。Step S610, receiving an instruction to generate a new label, and generating a new label according to the instruction.

步骤S620,判断浏览器中是否仅包含该新标签,如果是,则执行步骤S630,否则,执行步骤S640。Step S620, judging whether the browser only contains the new tag, if yes, execute step S630, otherwise, execute step S640.

步骤S630,在浏览器的显示界面中加入该新标签,并呈现该新标签。Step S630, adding the new tag in the display interface of the browser, and presenting the new tag.

步骤S640,在浏览器的显示界面中当前呈现的标签之后的下一个位置中插入该新标签,并呈现该新标签。Step S640, inserting the new tag in the next position after the currently presented tag in the display interface of the browser, and presenting the new tag.

其中,步骤S630和步骤S640中呈现该新标签进一步包括:使新标签获得浏览器焦点,以在浏览器的显示界面中呈现该新标签。Wherein, presenting the new label in step S630 and step S640 further includes: making the new label obtain the focus of the browser, so as to present the new label in the display interface of the browser.

其中,步骤S610进一步包括:接收到点击当前呈现的标签中链接的指示后,生成加载该链接的网页的新标签。Wherein, step S610 further includes: after receiving an indication of clicking a link in the currently presented tab, generating a new tab that loads the webpage of the link.

其中,步骤S610进一步包括:接收到点击浏览器中标签添加按钮的指示后,生成空白或加载预设的网页的新标签。Wherein, step S610 further includes: after receiving the instruction of clicking the label adding button in the browser, generating a blank or loading a new label of a preset web page.

例如,在浏览器中要添加标签A、标签A1、标签A2、标签B、标签B1、标签B2、标签C、标签D、标签D1和标签D2。其中,标签A1和标签A2为标签A的子标签;标签B1和标签B2为标签B的子标签;标签D1和标签D2为标签D的子标签。即标签A1和标签A2通过点击标签A中链接而添加,标签B1和标签B2通过点击标签B中链接而添加,标签D1和标签D2通过点击标签D中链接而添加。For example, label A, label A1, label A2, label B, label B1, label B2, label C, label D, label D1 and label D2 should be added in the browser. Among them, label A1 and label A2 are sublabels of label A; label B1 and label B2 are sublabels of label B; label D1 and label D2 are sublabels of label D. That is, label A1 and label A2 are added by clicking the link in label A, label B1 and label B2 are added by clicking the link in label B, and label D1 and label D2 are added by clicking the link in label D.

该举例中的添加过程如下所示。添加后的标签序列如图2所示。The addition process in this example is as follows. The added tag sequence is shown in Figure 2.

首先,新建标签A。接收到生成标签A的指示,根据接收的指示生成标签A。判断出浏览器中仅包含标签A,在浏览器的显示界面中加入标签A,使标签A获得浏览器焦点,以呈现标签A。First, create a new label A. An instruction to generate label A is received, and label A is generated according to the received instruction. It is judged that only label A is included in the browser, and label A is added to the display interface of the browser, so that label A obtains the focus of the browser to present label A.

点击标签A中链接,添加标签A1。接收点击标签A中链接的指示,生成加载该链接中网页的标签A1。判断出浏览器中不是仅包含标签A1,在浏览器的显示界面中当前呈现的标签A之后的下一个位置中插入标签A1,使标签A1获得浏览器焦点,以呈现标签A1。即在将标签A1加入标签A后,呈现标签A1中网页。Click the link in label A to add label A1. An instruction to click on the link in the tag A is received, and a tag A1 that loads the webpage in the link is generated. After judging that the browser does not contain only label A1, insert label A1 into the next position after the currently presented label A in the display interface of the browser, so that label A1 obtains the focus of the browser to present label A1. That is, after the tag A1 is added to the tag A, the webpage in the tag A1 is presented.

新建标签B,添加标签B。接收点击浏览器中标签添加按钮的指示,生成标签B。标签B可以为空白标签,在标签添加完成后,通过输入网址,加载该网址的网页。或者,生成的标签B中加载预设的网页。判断出浏览器中不是仅包含标签B,在浏览器的显示界面中当前呈现的标签A1之后的下一个位置中插入标签B,使标签B获得浏览器焦点,以呈现标签B。即在将标签B加入标签A1后,呈现标签B中内容。Create a new label B and add label B. Receive an instruction to click the Add Tag button in the browser, and generate Tag B. Label B can be a blank label. After the label is added, the webpage of the URL is loaded by inputting the URL. Alternatively, a preset web page is loaded in the generated tab B. If it is determined that the browser does not contain only label B, label B is inserted in the next position after the currently presented label A1 in the display interface of the browser, so that label B obtains the browser focus to present label B. That is, after label B is added to label A1, the content in label B is presented.

点击标签B中链接,添加标签B1。接收点击标签B中链接的指示,生成加载该链接中网页的标签B1。判断出浏览器中不是仅包含标签B1,在浏览器的显示界面中当前呈现的标签B之后的下一个位置中插入标签B1,使标签B1获得浏览器焦点,以呈现标签B1。即在将标签B1加入标签B后,呈现标签B1中网页。Click the link in label B to add label B1. An instruction to click on the link in the label B is received, and a label B1 that loads the webpage in the link is generated. After judging that the browser does not contain only the label B1, insert the label B1 in the next position after the currently presented label B in the display interface of the browser, so that the label B1 obtains the browser focus to present the label B1. That is, after the label B1 is added to the label B, the webpage in the label B1 is presented.

点击标签A,使得标签A获得焦点,呈现标签A。点击标签A中另一链接,添加标签A2。接收点击标签A中另一链接的指示,生成加载该链接中网页的标签A2。判断出浏览器中不是仅包含标签A2,在浏览器的显示界面中当前呈现的标签A之后的下一个位置中插入标签A2,使标签A2获得浏览器焦点,以呈现标签A2。即在将标签A2加入标签A和标签A1之间,呈现标签A2中网页。Click on tab A, so that tab A gets the focus, and tab A is presented. Click another link in label A to add label A2. An instruction to click another link in the tag A is received, and a tag A2 that loads the webpage in the link is generated. After judging that the browser does not contain only label A2, insert label A2 into the next position after the currently presented label A in the display interface of the browser, so that label A2 obtains the browser focus to present label A2. That is, after label A2 is added between label A and label A1, the webpage in label A2 is presented.

新建标签C,添加标签C。接收点击浏览器中标签添加按钮的指示,生成标签C。标签C可以为空白标签,在标签添加完成后,通过输入网址,加载该网址的网页。或者,生成的标签C中加载预设的网页。判断出浏览器中不是仅包含标签C,在浏览器的显示界面中当前呈现的标签A2之后的下一个位置中插入标签C,使标签C获得浏览器焦点,以呈现标签C。即在将标签C加入标签A2后,呈现标签C中内容。Create a new label C and add label C. Receive an instruction to click the tag addition button in the browser, and generate tag C. Label C can be a blank label, and after the label is added, the webpage of the URL is loaded by inputting the URL. Alternatively, a preset web page is loaded in the generated tag C. Determine that the browser does not contain only tag C, and insert tag C in the next position after the currently presented tag A2 in the display interface of the browser, so that tag C obtains the browser focus to present tag C. That is, after label C is added to label A2, the content in label C is presented.

点击标签B,使得标签B获得焦点,呈现标签B。点击标签B中另一链接,添加标签B2。接收点击标签B中另一链接的指示,生成加载该链接中网页的标签B2。判断出浏览器中不是仅包含标签B2,在浏览器的显示界面中当前呈现的标签B之后的下一个位置中插入标签B2,使标签B2获得浏览器焦点,以呈现标签B2。即在将标签B2加入标签B之后,呈现标签B2中网页。Click on tab B, so that tab B gets the focus, and tab B is presented. Click another link in label B to add label B2. An instruction to click on another link in the tag B is received, and a tag B2 that loads the webpage in the link is generated. After judging that the browser does not contain only label B2, insert label B2 into the next position after the currently presented label B in the display interface of the browser, so that label B2 obtains the browser focus to present label B2. That is, after the tag B2 is added to the tag B, the webpage in the tag B2 is presented.

点击标签B1,使得标签B1获得焦点,呈现标签B1。新建标签D,添加标签D。接收点击浏览器中标签添加按钮的指示,生成标签D。标签D可以为空白标签,在标签添加完成后,通过输入网址,加载该网址的网页。或者,生成的标签D中加载预设的网页。判断出浏览器中不是仅包含标签D,在浏览器的显示界面中当前呈现的标签B1之后的下一个位置中插入标签D,使标签D获得浏览器焦点,以呈现标签D。即在将标签D加入标签B1后,呈现标签D中内容。Click on the label B1, so that the label B1 gets the focus, and the label B1 is presented. Create a new label D and add label D. A tag D is generated by receiving an instruction to click the tag add button in the browser. The label D can be a blank label, and after the label is added, the webpage of the website is loaded by inputting the website address. Alternatively, a preset web page is loaded in the generated tag D. If it is determined that the browser does not contain only label D, insert label D into the next position after the currently presented label B1 in the display interface of the browser, so that label D obtains the browser focus to present label D. That is, after label D is added to label B1, the content in label D is presented.

在标签D中一次点击第一链接和第二链接,添加标签D1和标签D2。例如,在标签D中通过按住ctrl键后,点击第一链接和第二链接的方式,实现在标签D中一次点击第一链接和第二链接。接收点击标签D中第一链接的指示,生成加载该链接中网页的标签D1;接收点击标签D中第二链接的指示,生成加载该链接中网页的标签D2。判断出浏览器中不是仅包含标签D1,浏览器中不是仅包含标签D2,在浏览器的显示界面中当前呈现的标签D之后的下一个位置中插入标签D1,在浏览器的显示界面中当前呈现的标签D和添加的标签D1间添加标签D2。标签D2获得浏览器焦点,呈现标签D2。Click the first link and the second link once in label D, add label D1 and label D2. For example, by holding down the ctrl key in label D and clicking on the first link and the second link, the first link and the second link in label D can be clicked once. Receive an instruction to click on the first link in label D, generate a label D1 that loads the webpage in the link; receive an instruction to click the second link in label D, and generate a label D2 that loads the webpage in the link. If it is determined that the browser does not contain only the label D1, and the browser does not contain only the label D2, insert the label D1 in the next position after the currently presented label D in the browser display interface, and insert the label D1 in the browser display interface currently Label D2 is added between the presented label D and the added label D1. Tab D2 gets the browser focus, and tab D2 is rendered.

本实施例中,在添加标签时,新标签都在当前呈现的标签之后的位置,进而解决了添加前浏览的标签与新添加的标签间距离较远的问题;使得添加前浏览的标签与新添加的标签相邻,取得了在呈现新添加的标签的同时,易于查找出添加前浏览的标签的有益效果。In this embodiment, when adding tags, the new tags are all behind the currently presented tags, thereby solving the problem that the tags browsed before adding are far away from the newly added tags; The added tags are adjacent to each other, and at the same time the newly added tags are presented, the beneficial effect of being easy to find out the tags browsed before adding is achieved.

在一实施例中,步骤S610进一步包括:接收到点击当前呈现的标签中链接的指示后,生成加载该链接的网页的新标签。当前呈现的标签为新标签的父标签,新标签为当前呈现的标签的子标签。In one embodiment, step S610 further includes: after receiving an indication of clicking a link in the currently presented tab, generating a new tab that loads the webpage of the link. The currently rendered tag is the parent tag of the new tag, and the new tag is the child tag of the currently rendered tag.

步骤S640进一步包括:在判断结果为浏览器中不是仅包含所述生成的新标签时,确定浏览器的显示界面中当前呈现的标签为新标签的父标签,通过父标签的子标签添加接口在显示界面中当前呈现的标签之后的下一个位置中插入该新标签并呈现。Step S640 further includes: when the judgment result is that the browser does not only contain the generated new label, determine that the label currently presented in the display interface of the browser is the parent label of the new label, and add the child label through the parent label in the interface The new label is inserted and presented at the next position after the currently presented label in the display interface.

在另一实施例中,步骤S610进一步包括:接收到点击浏览器中标签添加按钮的指示后,生成空白或加载预设的网页的新标签。In another embodiment, step S610 further includes: after receiving an instruction to click the label adding button in the browser, generating a new label that is blank or loading a preset web page.

步骤S640进一步包括:在判断结果为浏览器中不是仅包含所述生成的新标签时,获得当前呈现的标签在浏览器显示界面中的排序位置,通过标签容器的标签添加接口在该位置之后的下一个位置中插入该新标签;Step S640 further includes: when the judged result is that the browser does not contain only the generated new tag, obtain the sorting position of the currently presented tag in the browser display interface, and use the tag adding interface of the tag container after the position Insert this new tag in the next position;

标签容器用于存放浏览器中各个标签。The tab container is used to store each tab in the browser.

举例而言,设置标签类Tab和标签容器类TabContainer。For example, set the label class Tab and the label container class TabContainer.

标签类的对象为标签,标签类Tab包括接口:The object of the label class is a label, and the label class Tab includes the interface:

VoidsetParentTab(Tabparent),用于设置父标签的父标签设置接口;VoidsetParentTab(Tabparent), used to set the parent tab setting interface of the parent tab;

TabgetParent(),用于获取父标签的父标签获取接口;TabgetParent(), used to get the parent tag acquisition interface of the parent tag;

VoidaddChildTab(Tabchild),用于添加子标签的子标签添加接口。VoidaddChildTab(Tabchild), the sub-tab adding interface used to add sub-tabs.

标签类包括参量:The label class includes parameters:

ArrayList<Tab>mTabContainer,用于存放浏览器中各个标签的标签容器,ArrayList<Tab>mTabContainer, used to store the tab container of each tab in the browser,

HashMap<intkey,TabmTab>mTabMap,用于映射标签的哈希表,通过键值(key,value)进行标签存储,可以通过key映射到对应的标签。HashMap<intkey,TabmTab>mTabMap, used to map the hash table of the label, stores the label through the key value (key, value), and can map to the corresponding label through the key.

IntmCurrentTabKey,用于记录当前标签的key的当前标签键码,在浏览器中没有标签时,该参量初始值为-1。IntmCurrentTabKey, used to record the current tab key code of the key of the current tab. When there is no tab in the browser, the initial value of this parameter is -1.

标签类包括接口,Tag classes include interfaces,

VoidaddTab(TabmTab),用于在浏览器中添加初始标签的初始标签添加接口;VoidaddTab (TabmTab), the initial tab addition interface used to add initial tabs in the browser;

VoidaddTab(intindex,TabmTab),用于添加初始标签之后的标签的标签添加接口。VoidaddTab(intindex, TabmTab), a tab addition interface for adding tabs after the initial tab.

在步骤S620中,通过mCurrentTabKey判断浏览器中是否仅包含该生成的新标签,当mCurrentTabKey=-1时,浏览器中仅包含该生成的新标签,否则,浏览器中不是仅包含该生成的新标签。In step S620, it is judged by mCurrentTabKey whether only the generated new tab is included in the browser. When mCurrentTabKey=-1, only the generated new tab is included in the browser; otherwise, the browser does not only include the generated new tab. Label.

在步骤S630中,在mCurrentTabKey=-1时,通过标签容器的初始标签添加接口在浏览器的显示界面中加入该新标签并呈现。例如:通过Tabtab=newtab,将新建标签赋值给变量tab。通过addTab(tab)在浏览器的显示界面中加入该新标签并呈现。此外,通过intkey=tab.hashcode(),计算新标签的键码,hashcode()为用于计算键码的接口。通过mTabMap.put(key,tab),将新标签存入哈希表中。通过mCurrentTabkey=key,更新参量mCurrentTabKey。In step S630, when mCurrentTabKey=-1, the new tab is added and presented in the display interface of the browser through the initial tab adding interface of the tab container. For example: through Tabtab=newtab, assign the new tab to the variable tab. The new tab is added and presented in the display interface of the browser through addTab(tab). In addition, calculate the key code of the new tab through intkey=tab.hashcode(), and hashcode() is the interface used to calculate the key code. Store the new label in the hash table through mTabMap.put(key, tab). Through mCurrentTabkey=key, update the parameter mCurrentTabKey.

在步骤S640中,在mCurrentTabKey≠-1,并且新标签具有父标签,即接收到点击当前呈现的标签中链接的指示而生成新标签时,通过父标签的子标签添加接口在显示界面中当前呈现的标签之后的下一个位置中插入该新标签并呈现。例如:通过Tabtab=newtab,将新建标签赋值给变量tab。通过TabparrentTab=mTabmap.get(mCurrentTabkey),从哈希表中取出当前呈现的标签,该标签为待添加的新标签的父标签。通过parentTab.addchildTab(tab)在显示界面中当前呈现的标签之后的下一个位置中插入该新标签并呈现,即在显示界面中父标签之后的下一个位置中插入该新标签并呈现。此外,通过intkey=tab.hashcode(),计算新标签的键码。通过mTabMap.put(key,tab),将新标签存入哈希表中。通过mCurrentTabkey=key,更新参量mCurrentTabKey。In step S640, when mCurrentTabKey≠-1, and the new label has a parent label, that is, when a new label is generated by receiving an instruction to click on a link in the currently presented label, the child label adding interface of the parent label is currently presented in the display interface The new tag is inserted and rendered at the next position after the tag in the . For example: through Tabtab=newtab, assign the new tab to the variable tab. Through TabparrentTab=mTabmap.get(mCurrentTabkey), get the currently presented tab from the hash table, which is the parent tab of the new tab to be added. Through parentTab.addchildTab(tab), the new tab is inserted and presented in the next position after the currently presented tab in the display interface, that is, the new tab is inserted and presented in the next position after the parent tab in the display interface. In addition, calculate the key code of the new tab by intkey=tab.hashcode(). Store the new tab in the hash table through mTabMap.put(key,tab). Through mCurrentTabkey=key, update the parameter mCurrentTabKey.

在步骤S640中,在mCurrentTabKey≠-1,并且新标签不具有父标签,即接收到点击浏览器中标签添加按钮的指示而生成新标签时,获得当前呈现的标签在浏览器显示界面中的排序位置,通过标签容器的标签添加接口在该位置之后的下一个位置中插入该新标签。例如:通过Tabtab=newtab,将新建标签赋值给变量tab。通过addTab(index,tab)在浏览器的显示界面中加入该新标签并呈现。index为获得浏览器焦点的标签在标签在浏览器显示界面中的排序位置。此外,通过intkey=tab.hashcode(),计算新标签的键码。通过mTabMap.put(key,tab),将新标签存入哈希表中。通过mCurrentTabkey=key,更新参量mCurrentTabKey。In step S640, when mCurrentTabKey≠-1, and the new label does not have a parent label, that is, when a new label is generated by receiving an instruction to click the label addition button in the browser, the order of the currently presented labels in the browser display interface is obtained position, insert the new label in the next position after the position through the label adding interface of the label container. For example: through Tabtab=newtab, assign the new tab to the variable tab. The new tab is added and presented in the display interface of the browser through addTab(index, tab). index is the sorting position of the tab that gets the browser focus in the tab display interface of the browser. In addition, calculate the key code of the new tab by intkey=tab.hashcode(). Store the new tab in the hash table through mTabMap.put(key,tab). Through mCurrentTabkey=key, update the parameter mCurrentTabKey.

上述举例仅为本发明实施例的一种具体实施方式,本发明不限于此,可以通过多种方式实施。The above example is only a specific implementation manner of the embodiment of the present invention, and the present invention is not limited thereto, and may be implemented in various ways.

参见图7,示出了根据本发明一个实施例的浏览器中关闭标签的方法的流程图。Referring to FIG. 7 , it shows a flowchart of a method for closing a tag in a browser according to an embodiment of the present invention.

步骤S710,接收到关闭标签的指示。Step S710, receiving an instruction to close the tag.

步骤S720,判断待关闭的标签是否具有父标签,如果具有父标签,则执行步骤S730,否则,执行步骤S760。Step S720, judging whether the tag to be closed has a parent tag, if it has a parent tag, execute step S730, otherwise, execute step S760.

其中,子标签为通过点击父标签中链接而生成的用于加载该链接的网页的标签。如果标签为通过点击另一标签中链接而生成,则该标签具有父标签。Wherein, the sub-tag is a tag generated by clicking on a link in the parent tag for loading the webpage of the link. A label has a parent label if it was generated by clicking a link in another label.

步骤S730,判断该父标签是否具有多个子标签,如果具有,则执行步骤S740,否则,执行步骤S750。Step S730, judging whether the parent tag has multiple sub-tags, if yes, execute step S740, otherwise, execute step S750.

步骤S740,完成标签关闭,将当前呈现的标签切换为查找到的该父标签的一个子标签。In step S740, closing the tab is completed, and the currently presented tab is switched to a child tab of the found parent tab.

进一步地,使切换到的子标签获得浏览器焦点,以在浏览器的显示界面中呈现该子标签。Further, the switched sub-tab obtains the browser focus, so as to present the sub-tab in the display interface of the browser.

步骤S750,完成标签关闭,将当前呈现的标签切换为该父标签。In step S750, the closing of the tab is completed, and the currently presented tab is switched to the parent tab.

进一步地,使切换到的父标签获得浏览器焦点,以在浏览器的显示界面中呈现该父标签。Further, the switched parent label is made to obtain the browser focus, so as to present the parent label in the display interface of the browser.

步骤S760,完成标签关闭。In step S760, closing the label is completed.

进一步地,在步骤S760中可以判断待关闭的标签是否位于浏览器最后,如果位于浏览器最后,则完成标签关闭,将当前呈现的标签切换为关闭的标签之前的上一个标签;如果不是位于浏览器最后,则完成标签关闭,将当前呈现的标签切换为关闭的标签之后的下一个标签。Further, in step S760, it can be judged whether the label to be closed is at the end of the browser, if it is at the end of the browser, the closing of the label is completed, and the currently presented label is switched to the previous label before the closed label; Finally, the tab is closed, and the currently presented tab is switched to the next tab after the closed tab.

此处,仅为步骤S760的一种具体实施方式,本发明不限于此。例如,也可以在判断结果为待关闭的标签不具有父标签时,完成标签关闭,并将当前呈现的标签切换为第一个标签,或者最后一个标签,或者任一具有子标签的父标签。因为,当待关闭的标签不具有父标签时,说明浏览器中包含的标签中没有待关闭的标签的关联标签,所以,在此种情况下,本发明对于关闭后呈现的标签没有特别限制。Here, it is only a specific implementation manner of step S760, and the present invention is not limited thereto. For example, when it is judged that the label to be closed does not have a parent label, closing the label may be completed, and the currently presented label may be switched to the first label, or the last label, or any parent label with child labels. Because, when the tag to be closed does not have a parent tag, it means that there is no associated tag of the tag to be closed among the tags included in the browser. Therefore, in this case, the present invention has no special limitation on the tag presented after closing.

以下对本实施例进行举例说明,在图2中所示的浏览器标签中,当接收到关闭标签A1的指示时,判断出标签A1具有父标签,标签A。然后,判断出标签A具有多个子标签,将标签A1关闭后,使标签A的另一个子标签,标签A2,获得浏览器焦点,呈现标签A2。The present embodiment is described below as an example. In the browser tab shown in FIG. 2 , when an instruction to close the tab A1 is received, it is determined that the tab A1 has a parent tab, tab A. Then, it is determined that tag A has multiple sub-tabs, and after tag A1 is closed, another sub-tab of tag A, tag A2, gets the focus of the browser, and tag A2 is presented.

随后,当接收到关闭标签A2的指示时,判断出标签A2具有父标签,标签A。然后,判断出标签A仅以标签A2为子标签,将标签A2关闭后,使标签A获得浏览器焦点,呈现标签A。Subsequently, when an instruction to close tag A2 is received, it is determined that tag A2 has a parent tag, tag A. Then, it is determined that label A only has label A2 as a sub-label, and after label A2 is closed, label A obtains the browser focus, and label A is presented.

采用本实施例,关闭标签时,在完成标签关闭后,优先切换到与已关闭的标签在内容上具有关联的标签,该标签与已关闭的标签具有相同的父标签或者两者为父子关系,进而解决了关闭标签后呈现的标签与已关闭的标签间缺少关联性的问题;取得了能够自动呈现出与已关闭标签相关联的标签的有益效果。Using this embodiment, when closing a tag, after the tag is closed, it is preferred to switch to the tag that is associated with the closed tag in content, and the tag has the same parent tag as the closed tag or the two are in a parent-child relationship. Furthermore, the problem of lack of correlation between the tabs presented after the tabs are closed and the closed tabs is solved; the beneficial effect of being able to automatically present the tabs associated with the closed tabs is achieved.

参见图8,示出了根据本发明一个实施例的浏览器中关闭标签的方法的流程图。Referring to FIG. 8 , it shows a flowchart of a method for closing a tab in a browser according to an embodiment of the present invention.

步骤S8010,接收到关闭标签的指示。Step S8010, receiving an instruction to close the label.

步骤S8020,判断浏览器中是否仅包括待关闭的标签,如果是,则执行步骤S8030,否则,执行步骤S8040。Step S8020, judging whether the browser only includes tags to be closed, if yes, execute step S8030, otherwise, execute step S8040.

步骤S8030,完成标签关闭后生成新标签,并呈现该新标签。Step S8030, generate a new label after closing the label, and present the new label.

步骤S8040,判断待关闭的标签是否具有父标签,如果具有父标签,则执行步骤S8050,否则,执行步骤S8080。Step S8040, judge whether the tag to be closed has a parent tag, if it has a parent tag, execute step S8050, otherwise, execute step S8080.

其中,子标签为通过点击父标签中链接而生成的用于加载该链接的网页的标签。即如果标签为通过点击另一标签中链接而生成,则该标签具有父标签。Wherein, the sub-tag is a tag generated by clicking on a link in the parent tag for loading the webpage of the link. That is, a label has a parent label if it was generated by clicking a link in another label.

步骤S8050,判断该父标签是否具有多个子标签,如果具有,则执行步骤S8060,否则,执行步骤S8070。Step S8050, judging whether the parent tag has multiple sub-tags, if yes, execute step S8060, otherwise, execute step S8070.

步骤S8060,完成标签关闭,将当前呈现的标签切换为查找到的该父标签的一个子标签。In step S8060, the closing of the tab is completed, and the currently presented tab is switched to a child tab of the found parent tab.

进一步地,使切换到的子标签获得浏览器焦点,以在浏览器的显示界面中呈现该子标签。Further, the switched sub-tab obtains the browser focus, so as to present the sub-tab in the display interface of the browser.

步骤S8070,完成标签关闭,将当前呈现的标签切换为该父标签。In step S8070, closing the tab is completed, and the currently presented tab is switched to the parent tab.

进一步地,使切换到的父标签获得浏览器焦点,以在浏览器的显示界面中呈现该父标签。Further, the switched parent label is made to obtain the browser focus, so as to present the parent label in the display interface of the browser.

步骤S8080,判断待关闭的标签是否位于浏览器最后,如果是,则执行步骤S8090,否则,执行步骤S8100。Step S8080, judging whether the tab to be closed is at the end of the browser, if yes, execute step S8090, otherwise, execute step S8100.

步骤S8090,完成标签关闭,将当前呈现的标签切换为关闭的标签之前的上一个标签。In step S8090, closing the tab is completed, and the currently presented tab is switched to the previous tab before the closed tab.

步骤S8100,完成标签关闭,将当前呈现的标签切换为关闭的标签之后的下一个标签。In step S8100, closing the tab is completed, and the currently presented tab is switched to the next tab after the closed tab.

上述实施例仅为本发明的具体实施方式的示例性说明,本发明不限于此,可以通过多种其他的具体方式实施实现本发明。The above-mentioned embodiments are only illustrative descriptions of the specific implementation manners of the present invention, and the present invention is not limited thereto, and the present invention can be implemented and realized in various other specific manners.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。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.

应该注意的是上述实施例对本发明进行说明而不是对本发明进行限制,并且本领域技术人员在不脱离所附权利要求的范围的情况下可设计出替换实施例。在权利要求中,不应将位于括号之间的任何参考符号构造成对权利要求的限制。单词“包含”不排除存在未列在权利要求中的元件或步骤。位于元件之前的单词“一”或“一个”不排除存在多个这样的元件。本发明可以借助于包括有若干不同元件的硬件以及借助于适当编程的计算机来实现。在列举了若干装置的单元权利要求中,这些装置中的若干个可以是通过同一个硬件项来具体体现。单词第一、第二、以及第三等的使用不表示任何顺序。可将这些单词解释为名称。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.

Claims (6)

Translated fromChinese
1.一种浏览器中关闭标签的装置,所述装置包括:1. A device for closing tabs in a browser, said device comprising:父标签判断模块,适于当接收到关闭标签的指示时,判断待关闭的标签是否具有父标签,将判断结果通知给子标签判断模块;The parent tag judging module is suitable for judging whether the tag to be closed has a parent tag when receiving an instruction to close the tag, and notifying the judging result to the sub-tag judging module;子标签判断模块,适于在判断结果为待关闭的标签具有父标签时,判断该父标签是否具有多个子标签,并将该判断结果通知给标签关闭模块;The sub-tag judging module is suitable for judging whether the parent tag has multiple sub-tags when the judging result is that the tag to be closed has a parent tag, and notifying the tag closing module of the judging result;标签关闭模块,适于在接收到的子标签判断模块的判断结果为父标签具有多个子标签时,完成标签关闭,并将当前呈现的标签切换为查找到的父标签的一个子标签;在接收到的子标签判断模块的判断结果为父标签仅以待关闭的标签为子标签时,完成标签关闭,并将当前呈现的标签切换为该父标签;The tag closing module is adapted to complete the tag closing when the received sub-tag judging module determines that the parent tag has multiple sub-tags, and switch the currently presented tag to a sub-tag of the found parent tag; When the judging result of the received sub-tag judging module is that the parent tag only uses the tag to be closed as a sub-tag, the tag closing is completed and the currently presented tag is switched to the parent tag;所述子标签为通过点击所述父标签中链接而生成的用于加载该链接的网页的标签;The sub-label is a label generated by clicking a link in the parent label for loading the web page of the link;其中,所述装置还包括:位置判断模块,Wherein, the device also includes: a position judgment module,所述父标签判断模块,还适于将判断结果通知给所述位置判断模块;The parent tag judging module is further adapted to notify the location judging module of the judging result;所述位置判断模块,适于在判断结果为待关闭的标签不具有父标签时,判断待关闭的标签是否位于浏览器最后,将该判断结果通知给标签关闭模块;The position judging module is suitable for judging whether the tag to be closed is located at the end of the browser when the judging result is that the tag to be closed does not have a parent tag, and notifying the tag closing module of the judgment result;所述标签关闭模块,还适于在所述位置判断模块的判断结果为待关闭的标签位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之前的上一个标签;在位置判断模块的判断结果为待关闭的标签不是位于浏览器最后时,完成标签关闭,并将当前呈现的标签切换为关闭的标签之后的下一个标签。The label closing module is also suitable for completing the label closing when the judgment result of the position judgment module is that the label to be closed is at the end of the browser, and switching the currently presented label to the previous label before the closed label; When the judging result of the position judging module is that the tab to be closed is not at the end of the browser, closing the tab is completed, and the currently presented tab is switched to the next tab after the closed tab.2.根据权利要求1所述的装置,其中,2. The apparatus of claim 1, wherein,所述装置还包括:标签数量判断模块,The device also includes: a label quantity judgment module,所述父标签判断模块,进一步适于当接收到关闭标签的指示后,指示标签数量判断模块进行浏览器中是否仅包含待关闭的标签的判断,在标签数量判断模块的判断结果为浏览器中不是仅包括待关闭的标签时,判断待关闭的标签是否具有父标签,将判断结果通知给子标签判断模块,在标签数量判断模块的判断结果为浏览器中仅包括待关闭的标签时,结束操作,不进行待关闭的标签是否具有父标签的判断;The parent tag judging module is further adapted to instruct the tag quantity judging module to judge whether only labels to be closed are included in the browser after receiving the instruction to close the tag, and the judging result of the tag quantity judging module is that in the browser When the label to be closed is not included only, determine whether the label to be closed has a parent label, and notify the sub-label judgment module of the judgment result, and when the judgment result of the label quantity judgment module is that only the label to be closed is included in the browser, end operation, without judging whether the tag to be closed has a parent tag;所述标签数量判断模块,还适于将判断结果通知给所述标签关闭模块;The tag quantity judging module is also suitable for notifying the tag closing module of the judging result;所述标签关闭模块,还适于在接收的所述标签数量判断模块的判断结果为浏览器中仅包括待关闭的标签时,完成标签关闭后生成新标签,并呈现该新标签。The tag closing module is further adapted to generate a new tag after closing the tag and present the new tag when the received judgment result of the tag quantity judging module is that the browser only includes tags to be closed.3.根据权利要求1所述的装置,其中,3. The apparatus of claim 1, wherein,所述标签关闭模块,进一步适于在完成标签关闭后,使切换到的标签获得浏览器焦点,以在浏览器的显示界面中呈现切换到的标签。The tab closing module is further adapted to make the switched tab obtain the focus of the browser after closing the tab, so as to present the switched tab in the display interface of the browser.4.一种浏览器中关闭标签的方法,所述方法包括:4. A method for closing tabs in a browser, said method comprising:当接收到关闭标签的指示时,判断待关闭的标签是否具有父标签,如果具有父标签,则进一步判断该父标签是否具有多个子标签;When an instruction to close a tag is received, it is judged whether the tag to be closed has a parent tag, and if it has a parent tag, it is further judged whether the parent tag has multiple child tags;如果该父标签具有多个子标签,则完成标签关闭,将当前呈现的标签切换为查找到的该父标签的一个子标签;If the parent tag has multiple sub-tags, close the tag and switch the currently rendered tag to a found sub-tag of the parent tag;如果该父标签仅以该待关闭的标签为子标签,则完成标签关闭,将当前呈现的标签切换为该父标签;If the parent tag only has the tag to be closed as a child tag, then complete the tag closing and switch the currently rendered tag to the parent tag;所述子标签为通过点击所述父标签中链接而生成的用于加载该链接的网页的标签;The sub-label is a label generated by clicking a link in the parent label for loading the web page of the link;其中,所述方法还包括:Wherein, the method also includes:当待关闭的标签不具有父标签时,判断待关闭的标签是否位于浏览器最后;When the label to be closed does not have a parent label, determine whether the label to be closed is at the end of the browser;如果位于浏览器最后,则完成标签关闭,将当前呈现的标签切换为关闭的标签之前的上一个标签;If it is at the end of the browser, close the tab and switch the currently rendered tab to the previous tab before the closed tab;如果不是位于浏览器最后,则完成标签关闭,将当前呈现的标签切换为关闭的标签之后的下一个标签。If it is not at the end of the browser, complete tab closing, switching the currently rendered tab to the next tab after the closed tab.5.根据权利要求4所述的方法,其中,5. The method of claim 4, wherein,在判断待关闭的标签是否具有父标签前还包括:Before judging whether the tag to be closed has a parent tag, it also includes:判断浏览器中是否仅包括待关闭的标签,如果是,则完成标签关闭后生成新标签,并呈现该新标签。Determine whether the browser only includes the tabs to be closed, and if so, generate a new tab after closing the tabs, and present the new tab.6.根据权利要求4所述的方法,其中,6. The method of claim 4, wherein,所述将当前呈现的标签切换为查找到的该父标签的一个子标签进一步包括:Said switching the currently presented label to a child label of the found parent label further includes:使切换到的子标签获得浏览器焦点,以在浏览器的显示界面中呈现该子标签;Make the switched-to sub-tab obtain the browser focus, so as to present the sub-tab in the display interface of the browser;所述将当前呈现的标签切换为该父标签进一步包括:Said switching the currently presented label to the parent label further includes:使切换到的父标签获得浏览器焦点,以在浏览器的显示界面中呈现该父标签。Make the parent tab to be switched to get the browser focus, so as to present the parent tab in the browser's display interface.
CN201210535434.2A2012-12-122012-12-12The apparatus and method of label are closed in browserActiveCN103019715B (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201210535434.2ACN103019715B (en)2012-12-122012-12-12The apparatus and method of label are closed in browser

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201210535434.2ACN103019715B (en)2012-12-122012-12-12The apparatus and method of label are closed in browser

Publications (2)

Publication NumberPublication Date
CN103019715A CN103019715A (en)2013-04-03
CN103019715Btrue CN103019715B (en)2015-11-25

Family

ID=47968353

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201210535434.2AActiveCN103019715B (en)2012-12-122012-12-12The apparatus and method of label are closed in browser

Country Status (1)

CountryLink
CN (1)CN103019715B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103412873B (en)*2013-07-092017-03-01百度在线网络技术(北京)有限公司A kind of method and apparatus for amplifying Web page module

Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101539912A (en)*2008-03-182009-09-23林福来Method for browsing webpages by tree browser
CN102033943A (en)*2010-12-212011-04-27广州市动景计算机科技有限公司Multiwindow browse method and system based on mobile communication equipment terminal

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
US20040030719A1 (en)*2002-02-132004-02-12Jie WeiWeb page based dynamic book for document presentation and operation

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN101539912A (en)*2008-03-182009-09-23林福来Method for browsing webpages by tree browser
CN102033943A (en)*2010-12-212011-04-27广州市动景计算机科技有限公司Multiwindow browse method and system based on mobile communication equipment terminal

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
值得一用Firefox2_0秘籍一箩筐;小老虎;《电脑爱好者》;20070831(第8期);40*

Also Published As

Publication numberPublication date
CN103019715A (en)2013-04-03

Similar Documents

PublicationPublication DateTitle
CN103678566A (en)Method, server and system for providing mobile terminal fault problem solution
TWI484416B (en)Dynamic tag generating apparatus and dynamic tag generating method thereof for use in display arratatus
CN102915366B (en)A kind of browser loads the method and apparatus of webpage
CN103135879B (en)Display packing, display device and electronic equipment
WO2016173436A1 (en)Information presentation method and apparatus
CN103049313B (en)For label stopping device and the method for browser
CN103686809A (en) Method, mobile terminal and system for providing solutions to mobile terminal failure problems
CN103020191A (en)Device and method for displaying file
CN102902788B (en)Browsing device net page label automatic grouping system and method
CN105677658A (en)Page display method and device
CN103023972B (en) A method and device for managing files
CN102855061A (en)Mailbox interface interaction method and device based on multi-label window
CN106155708A (en)A kind of dynamic load and the method and system of renewal content of pages
TWI519980B (en)Method and device for displaying web page and computer-readable storage medium
CN103049507A (en)Label adding device and method for browser
CN105653585A (en)Method and device for switching webpages in browser labels
CN104715067A (en)Method, device and system for making key words on web page and browser client
Kulkarni et al.Automatically adapting web pages to heterogeneous devices
CN104484104A (en)Page display method and page display device
CN103019715B (en)The apparatus and method of label are closed in browser
CN103853845A (en)Dynamic analytic method of complex form
CN105389393A (en)Method and device for adjusting browser display information in browser recommendation list
CN103218424B (en)Webpage display process and device
CN103412935A (en)Method and system for automatically identifying and recommending hyperlink markup type
CN103472977B (en)Method and device for activating next label page when label page is closed

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
C14Grant of patent or utility model
GR01Patent grant
TR01Transfer of patent right
TR01Transfer of patent right

Effective date of registration:20220727

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.


[8]ページ先頭

©2009-2025 Movatter.jp