Movatterモバイル変換


[0]ホーム

URL:


CN105653585A - Method and device for switching webpages in browser labels - Google Patents

Method and device for switching webpages in browser labels
Download PDF

Info

Publication number
CN105653585A
CN105653585ACN201510967029.1ACN201510967029ACN105653585ACN 105653585 ACN105653585 ACN 105653585ACN 201510967029 ACN201510967029 ACN 201510967029ACN 105653585 ACN105653585 ACN 105653585A
Authority
CN
China
Prior art keywords
webpage
view
identification information
webpage view
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.)
Pending
Application number
CN201510967029.1A
Other languages
Chinese (zh)
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
Qizhi Software Beijing 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 CN201510967029.1ApriorityCriticalpatent/CN105653585A/en
Publication of CN105653585ApublicationCriticalpatent/CN105653585A/en
Pendinglegal-statusCriticalCurrent

Links

Classifications

Landscapes

Abstract

Translated fromChinese

本发明涉及互联网技术领域,具体涉及一种浏览器标签内网页的切换方法及装置,包括:接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,切换请求包含第二网页与第一网页之间的载入顺序关系信息;根据第二网页与第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与第二网页对应的第二网页视图实例,其中,网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;根据查找到的第二网页视图实例,将标签当前显示的页面由第一网页切换到第二网页。根据本发明的一种浏览器标签内网页的切换方法及装置,提高了网页之间的切换效率。

The present invention relates to the technical field of the Internet, in particular to a method and device for switching webpages in a browser tab, comprising: receiving switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab request, the switching request includes the loading sequence relationship information between the second webpage and the first webpage; according to the loading sequence relationship information between the second webpage and the first webpage, the webpage view label management class in the browser label Search for the second webpage view instance corresponding to the second webpage, wherein, the webpage view label management class includes multiple webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages; For the found second web page view instance, switch the page currently displayed by the label from the first web page to the second web page. According to the method and device for switching webpages in browser tabs of the present invention, the efficiency of switching between webpages is improved.

Description

Translated fromChinese
一种浏览器标签内网页的切换方法及装置Method and device for switching web pages in browser tabs

技术领域technical field

本发明涉及互联网技术领域,具体涉及一种浏览器标签内网页的切换方法及装置。The invention relates to the technical field of the Internet, in particular to a method and device for switching webpages in browser tabs.

背景技术Background technique

浏览器中不同的标签相当于不同的窗口,不同标签间可以互相切换,同样,在同一个标签内请求的不同网页也可以通过前进键或者后退键进行切换。具体的,在浏览器标签内提供网页视图(WebView),现有技术在处理前进和后退之间的网页切换时,存在切换效率低的问题。Different tabs in the browser are equivalent to different windows, and different tabs can be switched between each other. Similarly, different web pages requested in the same tab can also be switched by pressing the forward key or the back key. Specifically, a webpage view (WebView) is provided in a browser tab. When the prior art handles webpage switching between forward and backward, there is a problem of low switching efficiency.

发明内容Contents of the invention

鉴于上述问题,提出了本发明以便提供一种克服上述问题或者至少部分地解决上述问题的浏览器标签内网页的显示方法及装置。In view of the above problems, the present invention is proposed to provide a method and device for displaying webpages in browser tabs that overcome the above problems or at least partially solve the above problems.

依据本发明的一个方面,提供了一种浏览器标签内网页的切换方法,包括:According to one aspect of the present invention, a method for switching webpages in browser tabs is provided, including:

接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息;receiving a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, the switching request including the loading sequence between the second webpage and the first webpage relationship information;

根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;According to the loading sequence relationship information between the second webpage and the first webpage, search for a second webpage view instance corresponding to the second webpage in the webpage view label management class in the browser label, wherein , the webpage view label management class includes a plurality of webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages;

根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。Switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.

可选的,在所述在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例之前,所述方法还包括:Optionally, before searching for the second webpage view instance corresponding to the second webpage in the webpage view tag management class in the browser tag, the method further includes:

预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内。Prepackaging the webpage view label management class containing the webpage view instance into the browser label.

可选的,所述预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内,包括:Optionally, the pre-encapsulation of the webpage view label management class containing the webpage view instance into the browser label includes:

在所述浏览器标签内的所述网页视图标签管理类中维护网页视图对象列表和网页视图标识信息列表;Maintaining a webpage view object list and a webpage view identification information list in the webpage view tag management class in the browser tag;

其中,所述网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,所述网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息的集合,所述网页视图对象和所述网页标识信息一一对应,所述网页标识信息中包含有对应网页载入的顺序信息。Wherein, the webpage view object list includes a collection of webpage view objects corresponding to all webpage view instances, the webpage view identification information list includes a collection of webpage identification information corresponding to all webpage view instances, and the webpage view objects and all There is a one-to-one correspondence between the webpage identification information, and the webpage identification information includes the sequence information of the corresponding webpage loading.

可选的,所述根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,包括:Optionally, according to the loading sequence relationship information between the second webpage and the first webpage, search for the first webpage corresponding to the second webpage in the webpage view tag management class in the browser tag. Two web view instances, including:

根据所述载入顺序关系信息和与所述第一网页对应的第一网页标识信息,在所述网页标识信息列表中查找与所述第二网页对应的第二网页标识信息;Searching for the second web page identification information corresponding to the second web page in the web page identification information list according to the loading sequence relationship information and the first web page identification information corresponding to the first web page;

基于所述第二网页标识信息,在所述网页视图对象列表中查找与所述第二网页对应的第二网页视图对象。Searching for a second webpage view object corresponding to the second webpage in the webpage view object list based on the second webpage identification information.

可选的,所述网页标识信息包括网页载入序号和网页地址。Optionally, the webpage identification information includes a webpage loading sequence number and a webpage address.

可选的,所述载入顺序关系信息包括网页前进关系信息和网页后退关系信息。Optionally, the loading sequence relationship information includes webpage forward relationship information and webpage backward relationship information.

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

接收在所述浏览器标签内首次加载的第三网页的加载请求;receiving a loading request of a third webpage loaded for the first time in the browser tab;

在加载所述第三网页的同时生成与所述第三网页对应的第三网页视图实例,并将所述第三网页视图实例添加到所述网页视图标签管理类中。A third webpage view instance corresponding to the third webpage is generated while the third webpage is loaded, and the third webpage view instance is added to the webpage view label management class.

可选的,在所述将所述第三网页视图实例添加到所述网页视图标签管理类中之前,所述方法还包括:Optionally, before adding the third webpage view instance to the webpage view label management class, the method further includes:

判断所述网页视图标签管理类中包含的网页视图实例的数量是否大于等于预设阈值;Judging whether the number of web view instances contained in the web view tag management class is greater than or equal to a preset threshold;

当所述网页视图实例的数量大于等于所述预设阈值时,删除所述网页视图标签管理类中最先添加的网页视图实例。When the number of webpage view instances is greater than or equal to the preset threshold, delete the first added webpage view instance in the webpage view label management class.

依据本发明的另一方面,提供了一种浏览器标签内网页的切换装置,包括:According to another aspect of the present invention, there is provided a switching device for web pages in browser tabs, including:

第一接收模块,用于接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息;The first receiving module is configured to receive a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, and the switching request includes the second webpage and the first webpage load order relationship information between web pages;

查找模块,用于根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;A search module, configured to search for the second webpage corresponding to the second webpage in the webpage view label management class in the browser tag according to the loading order relationship information between the second webpage and the first webpage. A webpage view instance, wherein the webpage view label management class includes a plurality of webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages;

切换模块,用于根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。A switching module, configured to switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.

可选的,所述装置还包括:Optionally, the device also includes:

封装模块,用于预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内。An encapsulation module, configured to pre-encapsulate the webpage view label management class containing the webpage view instance into the browser label.

可选的,所述封装模块包括:Optionally, the packaging module includes:

列表维护单元,用于在所述浏览器标签内的所述网页视图标签管理类中维护网页视图对象列表和网页视图标识信息列表;A list maintenance unit, configured to maintain a webpage view object list and a webpage view identification information list in the webpage view tag management class in the browser tag;

其中,所述网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,所述网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息的集合,所述网页视图对象和所述网页标识信息一一对应,所述网页标识信息中包含有对应网页载入的顺序信息。Wherein, the webpage view object list includes a collection of webpage view objects corresponding to all webpage view instances, the webpage view identification information list includes a collection of webpage identification information corresponding to all webpage view instances, and the webpage view objects and all There is a one-to-one correspondence between the webpage identification information, and the webpage identification information includes the sequence information of the corresponding webpage loading.

可选的,所述第一查找模块包括:Optionally, the first search module includes:

第一查找单元,用于根据所述载入顺序关系信息和与所述第一网页对应的第一网页标识信息,在所述网页标识信息列表中查找与所述第二网页对应的第二网页标识信息;A first search unit, configured to search for a second web page corresponding to the second web page in the list of web page identification information according to the loading sequence relationship information and the first web page identification information corresponding to the first web page identification information;

第二查找单元,用于基于所述第二网页标识信息,在所述网页视图对象列表中查找与所述第二网页对应的第二网页视图对象。A second searching unit, configured to search the webpage view object list for a second webpage view object corresponding to the second webpage based on the second webpage identification information.

可选的,所述网页标识信息包括网页载入序号和网页地址。Optionally, the webpage identification information includes a webpage loading sequence number and a webpage address.

可选的,所述载入顺序关系信息包括网页前进关系信息和网页后退关系信息。Optionally, the loading sequence relationship information includes webpage forward relationship information and webpage backward relationship information.

可选的,所述装置还包括:Optionally, the device also includes:

第二接收模块,用于接收在所述浏览器标签内首次加载的第三网页的加载请求;The second receiving module is used to receive the loading request of the third webpage loaded for the first time in the browser tag;

添加模块,用于在加载所述第三网页的同时生成与所述第三网页对应的第三网页视图实例,并将所述第三网页视图实例添加到所述网页视图标签管理类中。An adding module, configured to generate a third webpage view instance corresponding to the third webpage while loading the third webpage, and add the third webpage view instance to the webpage view label management class.

可选的,所述装置还包括:Optionally, the device also includes:

判断模块,用于判断所述网页视图标签管理类中包含的网页视图实例的数量是否大于等于预设阈值;A judging module, configured to judge whether the number of webpage view instances contained in the webpage view label management class is greater than or equal to a preset threshold;

删除模块,用于当所述网页视图实例的数量大于等于所述预设阈值时,删除所述网页视图标签管理类中最先添加的网页视图实例。A deletion module, configured to delete the first added webpage view instance in the webpage view label management class when the number of the webpage view instances is greater than or equal to the preset threshold.

根据本发明的一种浏览器标签内网页的切换方法及装置,通过网页视图标签管理类对浏览器标签内载入过的网页所对应的网页视图实例进行缓存,同一浏览器标签内包含多个网页视图实例,不同的网页视图实例对应不同的网页,通过切换网页视图实例实现对网页的切换,避免了利用一个网页视图实例通过不断更新该网页视图实例中的显示内容以实现网页切换所存在的切换效率低的问题,不同网页通过不同网页视图实例显示,不仅提高了切换效率,还有利于对网页之间的切换添加切换效果,提高了网页切换的扩展性。According to a method and device for switching webpages in a browser tab of the present invention, the webpage view instances corresponding to the webpages loaded in the browser tab are cached through the webpage view label management class, and the same browser tab contains multiple Webpage view instances, different webpage view instances correspond to different webpages, and the switching of webpages is realized by switching webpage view instances, which avoids the problem of using a webpage view instance to continuously update the display content in the webpage view instance to realize webpage switching For the problem of low switching efficiency, different webpages are displayed through different webpage view instances, which not only improves the switching efficiency, but also helps to add switching effects to the switching between webpages, and improves the scalability of webpage switching.

上述说明仅是本发明技术方案的概述,为了能够更清楚了解本发明的技术手段,而可依照说明书的内容予以实施,并且为了让本发明的上述和其它目的、特征和优点能够更明显易懂,以下特举本发明的具体实施方式。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 parts. In the attached picture:

图1示出了根据本发明一个实施例的一种浏览器标签内网页的切换方法的流程图;Fig. 1 shows a flow chart of a method for switching webpages in a browser tab according to an embodiment of the present invention;

图2示出了根据本发明一个实施例的一种浏览器标签内网页的切换装置的结构图。Fig. 2 shows a structural diagram of an apparatus for switching webpages in browser tabs according to an embodiment of the present invention.

具体实施方式detailed description

下面将参照附图更详细地描述本公开的示例性实施例。虽然附图中显示了本公开的示例性实施例,然而应当理解,可以以各种形式实现本公开而不应被这里阐述的实施例所限制。相反,提供这些实施例是为了能够更透彻地理解本公开,并且能够将本公开的范围完整的传达给本领域的技术人员。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是本发明一个实施例中一种浏览器标签内网页的切换方法的流程图,该方法应用于浏览器中,具体的,该方法包括以下步骤:Fig. 1 is a flow chart of a method for switching webpages in a browser tab in an embodiment of the present invention, the method is applied in a browser, specifically, the method includes the following steps:

S101:接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息。S101: Receive a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, where the switching request includes loading between the second webpage and the first webpage Enter sequence relationship information.

S102:根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系。S102: According to the loading sequence relationship information between the second webpage and the first webpage, search for a second webpage view instance corresponding to the second webpage in the webpage view label management class in the browser tag , wherein, the webpage view label management class includes multiple webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages.

S103:根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。S103: Switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.

具体来讲,在本申请中,浏览器标签内预先封装包含网页视图实例的网页视图标签管理类(WebViewTab)。网页视图标签管理类中维护有网页视图对象列表(mCachedPages)和网页视图标识信息列表(mPageHistoryStack),网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息(WebPageInfo)的集合,例如:Specifically, in this application, a web view tab management class (WebViewTab) including a web view instance is pre-encapsulated in the browser tag. The webpage view label management class maintains a webpage view object list (mCachedPages) and a webpage view identification information list (mPageHistoryStack). The webpage view object list includes the collection of webpage view objects corresponding to all webpage view instances, and the webpage view identification information list includes all A collection of webpage identification information (WebPageInfo) corresponding to the webpage view instance, for example:

privateArrayList<IWebView>mCachedPages=null;privateArrayList<IWebView>mCachedPages=null;

privateArrayList<WebPageInfo>mPageHistoryStack=newArrayList<WebPageInfo>();privateArrayList<WebPageInfo>mPageHistoryStack=newArrayList<WebPageInfo>();

网页视图标签管理类中缓存了多个网页视图实例,一个网页视图实例对应一个网页视图对象和一个网页视图标识信息,网页视图对象列表中的网页视图对象和网页标识信息列表中的网页标识信息一一对应,例如,网页视图对象列表中的第一网页视图对象对应网页标识信息列表中的第一网页标识信息,网页视图对象列表中的第二网页视图对象对应网页标识信息列表中的第二网页标识信息。进一步,网页标识信息中包含有对应网页载入的顺序信息,通过网页标识信息能够确定出与该网页标识信息对应的网页在浏览器标签内的载入顺序。具体的,网页标识信息包括网页载入序号(Page_id),网页载入序号为网页载入的顺序信息,用于表征网页的载入顺序,进而根据各网页的网页载入序号能够确定出网页与网页之间的载入顺序关系信息。Multiple web view instances are cached in the web view tag management class. A web view instance corresponds to a web view object and a web view identification information. The web view object in the web view object list and the web page identification information in the web page identification information list One-to-one correspondence, for example, the first webpage view object in the webpage view object list corresponds to the first webpage identification information in the webpage identification information list, and the second webpage view object in the webpage view object list corresponds to the second webpage in the webpage identification information list Identification information. Further, the webpage identification information includes the order information of loading the corresponding webpage, and the loading order of the webpage corresponding to the webpage identification information in the browser tab can be determined through the webpage identification information. Specifically, the webpage identification information includes a webpage loading sequence number (Page_id), and the webpage loading sequence number is the sequence information of webpage loading, which is used to represent the loading sequence of the webpages, and then according to the webpage loading sequence numbers of each webpage, the relationship between the webpage and the webpage can be determined. Load order relationship information between web pages.

例如,当网页的载入顺序从前到后依次对应网页载入序号从小到大时,第一网页对应的网页载入序号为2号,第二网页对应的网页载入序号为3号,则表明第一网页是在第二网页之前载入的网页,且第一网页是第二网页前一个载入的网页,第一网页和第二网页之间的载入顺序关系为:在该浏览器标签内先载入了第一网页,之后载入了第二网页。同时,网页标识信息中还包含有网页地址(URL),在具体实施过程中,将网页载入序号和网页地址封装到网页标识信息中,其源码如下:For example, when the loading order of the webpages corresponds to the loading sequence number of the webpages from the front to the back, and the loading sequence number of the webpage corresponding to the first webpage is No. 2, and the loading sequence number of the webpage corresponding to the second webpage is No. 3, it means that The first webpage is the webpage loaded before the second webpage, and the first webpage is the webpage loaded before the second webpage, the loading sequence relationship between the first webpage and the second webpage is: in the browser tab The first webpage is loaded first, and then the second webpage is loaded. At the same time, the webpage identification information also includes the webpage address (URL). In the specific implementation process, the webpage loading sequence number and the webpage address are encapsulated into the webpage identification information. The source code is as follows:

publicWebPageInfo(intPage_id,Stringinit_url){publicWebPageInfo(intPage_id, Stringinit_url){

pageId=Page_id;pageId = Page_id;

initUrl=init_url;initUrl = init_url;

}}

进一步,当利用封装有网页视图标签管理类的浏览器标签接收用于切换网页的切换请求时,在S101中,载入顺序关系信息包括网页前进关系信息和网页后退关系信息,当载入顺序关系信息为网页前进关系信息时,表明第一网页和第二网页之间载入的顺序关系为先载入了第一网页后载入了第二网页,当载入顺序关系信息为网页后退关系信息时,表明第一网页和第二网页之间载入的顺序关系为先载入了第二网页后载入了第一网页。Further, when using the browser label encapsulated with the webpage view label management class to receive a switching request for switching webpages, in S101, the loading sequence relationship information includes webpage forward relationship information and webpage backward relationship information, when the loading sequence relationship When the information is webpage forward relationship information, it indicates that the loading sequence relationship between the first webpage and the second webpage is that the first webpage is loaded first and then the second webpage is loaded; when the loading sequence relationship information is webpage backward relationship information , it indicates that the loading sequence relationship between the first webpage and the second webpage is that the second webpage is loaded first and then the first webpage is loaded.

接着,在S102中,根据网页之间的载入顺序关系信息能够在网页视图标签管理类中确定出待切换的网页所对应的网页视图实例。具体的,根据第一网页视图实例,以及第二网页与第一网页之间的载入顺序关系信息,在网页视图标签管理类中查找第二网页视图实例。在具体实施过程中,第一网页在网页视图标签管理类中对应有第一网页标识信息,第二网页在网页视图标签管理类中对应有第二网页标识信息,根据第一网页标识信息,以及第二网页与第一网页之间的载入顺序关系,能够在网页标识信息列表中查找出第二网页标识信息,从而,根据第二网页标识信息,能够在网页视图对象列表中查找到第二网页视图对象。其中,网页载入的顺序信息可以通过网页载入序号进行实现。Next, in S102, the webpage view instance corresponding to the webpage to be switched can be determined in the webpage view tag management class according to the loading order relationship information between the webpages. Specifically, according to the first webpage view instance and the loading sequence relationship information between the second webpage and the first webpage, the second webpage view instance is searched in the webpage view tag management class. In the specific implementation process, the first webpage corresponds to the first webpage identification information in the webpage view tag management class, and the second webpage corresponds to the second webpage identification information in the webpage view tag management class, according to the first webpage identification information, and The loading sequence relationship between the second webpage and the first webpage can find the second webpage identification information in the webpage identification information list, thus, according to the second webpage identification information, the second webpage view object list can be found. Web view object. Wherein, the sequence information of webpage loading can be realized by the sequence number of webpage loading.

例如,当第一网页的网页载入序号为2,切换请求所包含的载入顺序关系信息表明由第一网页切换到第二网页是执行的网页后退,则待切换的第二网页的网页载入序号为1,从而,在具体实施过程中,根据第一网页视图实例能够确定出第一网页的网页载入序号为2,由于是网页后退,因此确定出第二网页的网页载入序号应为1,根据网页载入序号1查找到对应的第二网页视图对象,第二网页视图对象对应着待切换的第二网页。在执行网页后退切换时,代码实现如下:For example, when the webpage loading sequence number of the first webpage is 2, the loading order relation information contained in the switching request indicates that switching from the first webpage to the second webpage is the execution of the webpage backward, then the webpage loading of the second webpage to be switched The entry sequence number is 1, thus, in the specific implementation process, according to the first webpage view example, it can be determined that the webpage loading sequence number of the first webpage is 2, and since the webpage is backward, it is determined that the webpage loading sequence number of the second webpage should be If it is 1, the corresponding second webpage view object is found according to the webpage loading sequence number 1, and the second webpage view object corresponds to the second webpage to be switched. When performing webpage back switching, the code is implemented as follows:

finalinttargetPageIndex=getPageIndex(mCurrentWebPage)–1finalinttargetPageIndex = getPageIndex(mCurrentWebPage) – 1

以及as well as

finalWebPageInfowpi=mPageHistoryStack–get(targetPageIndex);finalWebPageInfowpi = mPageHistoryStack - get(targetPageIndex);

IWebViewbackwardPage=getBackwardPage();IWebViewbackwardPage = getBackwardPage();

同理,当第一网页的网页载入序号为2,切换请求所包含的载入顺序关系信息表明第一网页切换到第二网页是执行的网页前进,则待切换的第二网页的网页载入序号为3,根据网页载入序号3能够查找到对应的第二网页视图对象。In the same way, when the webpage loading sequence number of the first webpage is 2, the loading sequence relationship information contained in the switching request indicates that the switching from the first webpage to the second webpage is the progress of the executed webpage, and the webpage of the second webpage to be switched is loaded. The loading sequence number is 3, and the corresponding second webpage view object can be found according to the loading sequence number 3 of the webpage.

在完成S102后,在S103的执行过程中,根据查找到的第二网页视图实例,通过将第二网页视图实例对应的第二网页视图对象显示到浏览器标签的前台,能够实现第一网页到第二网页的切换。After completing S102, in the execution process of S103, according to the second webpage view instance found, by displaying the second webpage view object corresponding to the second webpage view instance to the foreground of the browser label, the first webpage can be realized Switching of the second web page.

进一步,在本申请中,所述方法还包括:Further, in the present application, the method also includes:

接收在浏览器标签内首次加载的第三网页的加载请求。A load request is received for a third webpage that is first loaded in the browser tab.

在加载第三网页的同时生成与第三网页对应的第三网页视图实例,并将第三网页视图实例添加到网页视图标签管理类中。When the third webpage is loaded, a third webpage view instance corresponding to the third webpage is generated, and the third webpage view instance is added to the webpage view tag management class.

在具体实施过程中,当第三网页为首次加载的网页时,浏览器标签在加载第三网页的同时,将生成的与第三网页对应的第三网页视图实例添加到网页视图标签管理类中,以实现对第三网页视图实例的缓存。In the specific implementation process, when the third webpage is the webpage loaded for the first time, the browser label will add the generated third webpage view instance corresponding to the third webpage to the webpage view label management class while loading the third webpage , to implement caching of the third webpage view instance.

在一种优选的实施方式中,为避免网页视图实例占用浏览器过多的缓存空间,在将首次加载的第三网页所对应的第三网页视图实例添加到网页视图标签管理类之前,首先判断网页视图标签管理类中包含的网页视图实例的数量是否大于等于预设阈值,当网页视图标签管理类中的网页视图实例的数量大于等于预设阈值时,删除网页视图标签管理类中最先添加的网页视图实例,否则,直接将第三网页视图实例添加到网页视图标签管理类中。具体代码实现如下:In a preferred embodiment, in order to prevent the webpage view instance from occupying too much cache space of the browser, before adding the third webpage view instance corresponding to the first loaded third webpage to the webpage view tag management class, first determine Whether the number of web view instances contained in the web view tag management class is greater than or equal to the preset threshold, when the number of web view instances in the web view tag management class is greater than or equal to the preset threshold, delete the first added in the web view tag management class Otherwise, directly add the third web view instance to the web view label management class. The specific code is implemented as follows:

if(mCachedPages.size()>=mCachedPageCountif(mCachedPages.size()>=mCachedPageCount

&&destroyCandidatePage!=null){&&destroyCandidatePage! =null){

removePage(destroyCandidatePage,true);removePage(destroyCandidatePage, true);

}}

chosenPage=getNewWebView(mContext,type);chosenPage = getNewWebView(mContext, type);

addPage(chosenPage);addPage(chosenPage);

另外,网页视图管理类中还封装有用于将所有网页视图对象和所有网页视图标识信息清除的清除所有历史记录(clearAllHistory)方法。In addition, the webpage view management class also encapsulates a clear all history record (clearAllHistory) method for clearing all webpage view objects and all webpage view identification information.

在本申请中,需要说明的是,在一种特殊情况下,若切换请求为网页后退请求,但是,第一网页的网页载入顺序为首位,第二网页为空,即,第一网页已经是第一页,浏览器标签内没有可以后退的网页时,则浏览器标签不做网页切换,同理,当第一网页的网页载入顺序为尾位,第二网页为空,即,第一网页是最末尾一页,浏览器标签内没有可以前进的网页时,则浏览器标签不做网页切换。在另一种特殊情况下,若第二网页对应的第二网页视图对象被意外清空,则,对第二网页视图对象重新实例,并将对应的第二网页视图实例添加到网页视图管理类中的对应位置处。In this application, it should be noted that, in a special case, if the switching request is a webpage back request, however, the webpage loading order of the first webpage is the first, and the second webpage is empty, that is, the first webpage has been It is the first page, and if there is no web page that can be backed up in the browser tab, the browser tab will not switch pages. Similarly, when the loading order of the first web page is the last, the second web page is empty, that is, the first page A webpage is the last page, and when there is no webpage that can be advanced in the browser tab, the browser tab does not switch the webpage. In another special case, if the second webpage view object corresponding to the second webpage is accidentally emptied, re-instance the second webpage view object and add the corresponding second webpage view instance to the webpage view management class at the corresponding position.

本申请通过网页视图标签管理类对浏览器标签内载入过的网页所对应的网页视图实例进行缓存,加载一个网页对应缓存一个网页视图实例,同一浏览器标签内包含多个网页视图实例,不同的网页视图实例对应不同的网页,通过切换网页视图实例实现对网页的切换,避免了利用一个网页视图实例通过不断更新该网页视图实例中的显示内容以实现网页切换所存在的切换效率低的问题,利用一个网页视图实例对多个网页进行切换时,每切换一次网页就需要重新进行一次渲染,切换效率低。本申请不同网页通过不同网页视图实例显示,不仅提高了切换效率,还有利于对网页之间的切换添加切换效果,提高了网页切换的扩展性。This application caches the webpage view instances corresponding to the webpages loaded in the browser tab through the webpage view tag management class. Loading a webpage corresponds to caching a webpage view instance. The same browser tab contains multiple webpage view instances, different The webpage view instance corresponds to different webpages, and the webpage switching is realized by switching the webpage view instance, which avoids the problem of low switching efficiency of using a webpage view instance to continuously update the display content in the webpage view instance to achieve webpage switching , when using one webpage view instance to switch multiple webpages, it needs to re-render every time a webpage is switched, and the switching efficiency is low. Different webpages of the application are displayed through different webpage view examples, which not only improves switching efficiency, but also facilitates adding switching effects to switching between webpages, and improves the extensibility of webpage switching.

基于与上述方法相同的技术构思,本发明还提供一种浏览器标签内网页的切换装置,如图2所示,包括:Based on the same technical concept as the above-mentioned method, the present invention also provides a switching device for web pages in the browser tab, as shown in Figure 2, comprising:

第一接收模块201,用于接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息;The first receiving module 201 is configured to receive a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, the switching request includes the second webpage and the second webpage Loading sequence relationship information between web pages;

查找模块202,用于根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;The search module 202 is configured to search for the first webpage corresponding to the second webpage in the webpage view tag management class in the browser tag according to the loading order relationship information between the second webpage and the first webpage. Two webpage view instances, wherein the webpage view label management class includes a plurality of webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages;

切换模块203,用于根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。The switching module 203 is configured to switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.

可选的,所述装置还包括:Optionally, the device also includes:

封装模块,用于预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内。An encapsulation module, configured to pre-encapsulate the webpage view label management class containing the webpage view instance into the browser label.

可选的,所述封装模块包括:Optionally, the packaging module includes:

列表维护单元,用于在所述浏览器标签内的所述网页视图标签管理类中维护网页视图对象列表和网页视图标识信息列表;A list maintenance unit, configured to maintain a webpage view object list and a webpage view identification information list in the webpage view tag management class in the browser tag;

其中,所述网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,所述网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息的集合,所述网页视图对象和所述网页标识信息一一对应,所述网页标识信息中包含有对应网页载入的顺序信息。Wherein, the webpage view object list includes a collection of webpage view objects corresponding to all webpage view instances, the webpage view identification information list includes a collection of webpage identification information corresponding to all webpage view instances, and the webpage view objects and all There is a one-to-one correspondence between the webpage identification information, and the webpage identification information includes the sequence information of the corresponding webpage loading.

可选的,所述第一查找模块包括:Optionally, the first search module includes:

第一查找单元,用于根据所述载入顺序关系信息和与所述第一网页对应的第一网页标识信息,在所述网页标识信息列表中查找与所述第二网页对应的第二网页标识信息;A first search unit, configured to search for a second web page corresponding to the second web page in the list of web page identification information according to the loading sequence relationship information and the first web page identification information corresponding to the first web page identification information;

第二查找单元,用于基于所述第二网页标识信息,在所述网页视图对象列表中查找与所述第二网页对应的第二网页视图对象。A second searching unit, configured to search the webpage view object list for a second webpage view object corresponding to the second webpage based on the second webpage identification information.

可选的,所述网页标识信息包括网页载入序号和网页地址。Optionally, the webpage identification information includes a webpage loading sequence number and a webpage address.

可选的,所述载入顺序关系信息包括网页前进关系信息和网页后退关系信息。Optionally, the loading sequence relationship information includes webpage forward relationship information and webpage backward relationship information.

可选的,所述装置还包括:Optionally, the device also includes:

第二接收模块,用于接收在所述浏览器标签内首次加载的第三网页的加载请求;The second receiving module is used to receive the loading request of the third webpage loaded for the first time in the browser tag;

添加模块,用于在加载所述第三网页的同时生成与所述第三网页对应的第三网页视图实例,并将所述第三网页视图实例添加到所述网页视图标签管理类中。An adding module, configured to generate a third webpage view instance corresponding to the third webpage while loading the third webpage, and add the third webpage view instance to the webpage view label management class.

可选的,所述装置还包括:Optionally, the device also includes:

判断模块,用于判断所述网页视图标签管理类中包含的网页视图实例的数量是否大于等于预设阈值;A judging module, configured to judge whether the number of webpage view instances contained in the webpage view label management class is greater than or equal to a preset threshold;

删除模块,用于当所述网页视图实例的数量大于等于所述预设阈值时,删除所述网页视图标签管理类中最先添加的网页视图实例。A deletion module, configured to delete the first added webpage view instance in the webpage view label management class when the number of the webpage view instances is greater than or equal to the preset threshold.

总之,根据本发明的一种浏览器标签内网页的切换方法及装置,通过网页视图标签管理类对浏览器标签内载入过的网页所对应的网页视图实例进行缓存,加载一个网页对应缓存一个网页视图实例,同一浏览器标签内包含多个网页视图实例,不同的网页视图实例对应不同的网页,通过切换网页视图实例实现对网页的切换,避免了利用一个网页视图实例通过不断更新该网页视图实例中的显示内容以实现网页切换所存在的切换效率低的问题,不同网页通过不同网页视图实例显示,不仅提高了切换效率,还有利于对网页之间的切换添加切换效果,提高了网页切换的扩展性。In short, according to a method and device for switching webpages in a browser tab of the present invention, the webpage view instances corresponding to the webpages loaded in the browser tab are cached through the webpage view label management class, and one webpage loaded corresponds to one Webpage view instance, the same browser tab contains multiple webpage view instances, different webpage view instances correspond to different webpages, and the switching of webpages is realized by switching webpage view instances, which avoids using a webpage view instance to continuously update the webpage view The display content in the example realizes the problem of low switching efficiency in switching between webpages. Different webpages are displayed through different webpage view instances, which not only improves the switching efficiency, but also helps to add switching effects to the switching between webpages, improving the speed of webpage switching. scalability.

在此提供的算法和显示不与任何特定计算机、虚拟系统或者其它设备固有相关。各种通用系统也可以与基于在此的示教一起使用。根据上面的描述,构造这类系统所要求的结构是显而易见的。此外,本发明也不针对任何特定编程语言。应当明白,可以利用各种编程语言实现在此描述的本发明的内容,并且上面对特定语言所做的描述是为了披露本发明的最佳实施方式。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) and 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. It should be understood by those skilled in the art that a microprocessor or a digital signal processor (DSP) can be used in practice to realize some or all of some or all of the components in the device for switching webpages in browser tabs according to embodiments of the present invention Features. 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、一种浏览器标签内网页的切换方法,包括:The invention discloses, A1, a method for switching webpages in a browser tab, comprising:

接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息;receiving a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, the switching request including the loading sequence between the second webpage and the first webpage relationship information;

根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;According to the loading sequence relationship information between the second webpage and the first webpage, search for a second webpage view instance corresponding to the second webpage in the webpage view label management class in the browser label, wherein , the webpage view label management class includes a plurality of webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages;

根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。Switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.

A2、根据A1所述的方法,其特征在于,在所述在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例之前,所述方法还包括:A2, according to the method described in A1, it is characterized in that, before the second web view instance corresponding to the second web page is searched in the web view tag management class in the browser tag, the method also includes :

预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内。Prepackaging the webpage view label management class containing the webpage view instance into the browser label.

A3、根据A2所述的方法,其特征在于,所述预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内,包括:A3, according to the method described in A2, it is characterized in that, said pre-encapsulating said webpage view label management class containing said webpage view instance into said browser label, including:

在所述浏览器标签内的所述网页视图标签管理类中维护网页视图对象列表和网页视图标识信息列表;Maintaining a webpage view object list and a webpage view identification information list in the webpage view tag management class in the browser tag;

其中,所述网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,所述网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息的集合,所述网页视图对象和所述网页标识信息一一对应,所述网页标识信息中包含有对应网页载入的顺序信息。Wherein, the webpage view object list includes a collection of webpage view objects corresponding to all webpage view instances, the webpage view identification information list includes a collection of webpage identification information corresponding to all webpage view instances, and the webpage view objects and all There is a one-to-one correspondence between the webpage identification information, and the webpage identification information includes the sequence information of the corresponding webpage loading.

A4、根据A3所述的方法,其特征在于,所述根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,包括:A4, according to the method described in A3, it is characterized in that, according to the loading sequence relationship information between the second webpage and the first webpage, search in the webpage view label management class in the browser label The second web page view instance corresponding to the second web page includes:

根据所述载入顺序关系信息和与所述第一网页对应的第一网页标识信息,在所述网页标识信息列表中查找与所述第二网页对应的第二网页标识信息;Searching for the second web page identification information corresponding to the second web page in the web page identification information list according to the loading sequence relationship information and the first web page identification information corresponding to the first web page;

基于所述第二网页标识信息,在所述网页视图对象列表中查找与所述第二网页对应的第二网页视图对象。Searching for a second webpage view object corresponding to the second webpage in the webpage view object list based on the second webpage identification information.

A5、根据3所述的方法,其特征在于,所述网页标识信息包括网页载入序号和网页地址。A5. The method according to 3, wherein the webpage identification information includes a webpage loading sequence number and a webpage address.

A6、根据A1所述的方法,其特征在于,所述载入顺序关系信息包括网页前进关系信息和网页后退关系信息。A6. The method according to A1, wherein the loading order relationship information includes webpage forward relationship information and webpage backward relationship information.

A7、根据A1所述的方法,其特征在于,所述方法还包括:A7, according to the method described in A1, it is characterized in that, described method also comprises:

接收在所述浏览器标签内首次加载的第三网页的加载请求;receiving a loading request of a third webpage loaded for the first time in the browser tab;

在加载所述第三网页的同时生成与所述第三网页对应的第三网页视图实例,并将所述第三网页视图实例添加到所述网页视图标签管理类中。A third webpage view instance corresponding to the third webpage is generated while the third webpage is loaded, and the third webpage view instance is added to the webpage view tag management class.

A8、根据A1所述的方法,其特征在于,在所述将所述第三网页视图实例添加到所述网页视图标签管理类中之前,所述方法还包括:A8, according to the method described in A1, it is characterized in that, before the described third webpage view instance is added in the described webpage view label management class, described method also comprises:

判断所述网页视图标签管理类中包含的网页视图实例的数量是否大于等于预设阈值;Judging whether the number of web view instances contained in the web view tag management class is greater than or equal to a preset threshold;

当所述网页视图实例的数量大于等于所述预设阈值时,删除所述网页视图标签管理类中最先添加的网页视图实例。When the number of webpage view instances is greater than or equal to the preset threshold, delete the first added webpage view instance in the webpage view label management class.

B9、一种浏览器标签内网页的切换装置,其特征在于,包括:B9, a switching device for a webpage in a browser tab, is characterized in that, comprising:

第一接收模块,用于接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息;The first receiving module is configured to receive a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, and the switching request includes the second webpage and the first webpage load order relationship information between web pages;

查找模块,用于根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;A search module, configured to search for the second webpage corresponding to the second webpage in the webpage view label management class in the browser tag according to the loading order relationship information between the second webpage and the first webpage. A webpage view instance, wherein the webpage view label management class includes a plurality of webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages;

切换模块,用于根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。A switching module, configured to switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.

B10、根据B9所述的装置,其特征在于,所述装置还包括:B10, according to the device described in B9, it is characterized in that, described device also comprises:

封装模块,用于预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内。An encapsulation module, configured to pre-encapsulate the webpage view label management class containing the webpage view instance into the browser label.

B11、根据B10所述的装置,其特征在于,所述封装模块包括:B11, according to the device described in B10, it is characterized in that, described packaging module comprises:

列表维护单元,用于在所述浏览器标签内的所述网页视图标签管理类中维护网页视图对象列表和网页视图标识信息列表;A list maintenance unit, configured to maintain a webpage view object list and a webpage view identification information list in the webpage view tag management class in the browser tag;

其中,所述网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,所述网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息的集合,所述网页视图对象和所述网页标识信息一一对应,所述网页标识信息中包含有对应网页载入的顺序信息。Wherein, the webpage view object list includes a collection of webpage view objects corresponding to all webpage view instances, the webpage view identification information list includes a collection of webpage identification information corresponding to all webpage view instances, and the webpage view objects and all There is a one-to-one correspondence between the webpage identification information, and the webpage identification information includes the sequence information of the corresponding webpage loading.

B12、根据B11所述的装置,其特征在于,所述第一查找模块包括:B12, the device according to B11, is characterized in that, the first search module includes:

第一查找单元,用于根据所述载入顺序关系信息和与所述第一网页对应的第一网页标识信息,在所述网页标识信息列表中查找与所述第二网页对应的第二网页标识信息;A first search unit, configured to search for a second web page corresponding to the second web page in the list of web page identification information according to the loading sequence relationship information and the first web page identification information corresponding to the first web page identification information;

第二查找单元,用于基于所述第二网页标识信息,在所述网页视图对象列表中查找与所述第二网页对应的第二网页视图对象。A second searching unit, configured to search the webpage view object list for a second webpage view object corresponding to the second webpage based on the second webpage identification information.

B13、根据B11所述的装置,其特征在于,所述网页标识信息包括网页载入序号和网页地址。B13, according to the described device of B11, it is characterized in that, described webpage identification information comprises webpage loading serial number and webpage address.

B14、根据B9所述的装置,其特征在于,所述载入顺序关系信息包括网页前进关系信息和网页后退关系信息。B14, according to the described device of B9, it is characterized in that, described loading order relation information comprises web page forward relation information and web page backward relation information.

B15、根据B9所述的装置,其特征在于,所述装置还包括:B15, according to the device described in B9, it is characterized in that, described device also comprises:

第二接收模块,用于接收在所述浏览器标签内首次加载的第三网页的加载请求;The second receiving module is used to receive the loading request of the third webpage loaded for the first time in the browser tag;

添加模块,用于在加载所述第三网页的同时生成与所述第三网页对应的第三网页视图实例,并将所述第三网页视图实例添加到所述网页视图标签管理类中。An adding module, configured to generate a third webpage view instance corresponding to the third webpage while loading the third webpage, and add the third webpage view instance to the webpage view label management class.

B16、根据B9所述的装置,其特征在于,所述装置还包括:B16, according to the device described in B9, it is characterized in that, described device also comprises:

判断模块,用于判断所述网页视图标签管理类中包含的网页视图实例的数量是否大于等于预设阈值;A judging module, configured to judge whether the number of webpage view instances included in the webpage view label management class is greater than or equal to a preset threshold;

删除模块,用于当所述网页视图实例的数量大于等于所述预设阈值时,删除所述网页视图标签管理类中最先添加的网页视图实例。A deletion module, configured to delete the first added webpage view instance in the webpage view label management class when the number of the webpage view instances is greater than or equal to the preset threshold.

Claims (10)

Translated fromChinese
1.一种浏览器标签内网页的切换方法,其特征在于,包括:1. A switching method of a webpage in a browser tab, characterized in that, comprising:接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息;receiving a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, the switching request including the loading sequence between the second webpage and the first webpage relationship information;根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;According to the loading sequence relationship information between the second webpage and the first webpage, search for a second webpage view instance corresponding to the second webpage in the webpage view label management class in the browser label, wherein , the webpage view label management class includes a plurality of webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages;根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。Switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.2.如权利要求1所述的方法,其特征在于,在所述在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例之前,所述方法还包括:2. The method according to claim 1, wherein, before the second web view instance corresponding to the second web page is searched in the web view tag management class in the browser tag, the method Also includes:预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内。Prepackaging the webpage view label management class containing the webpage view instance into the browser label.3.如权利要求2所述的方法,其特征在于,所述预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内,包括:3. The method according to claim 2, wherein said pre-encapsulating said webpage view label management class containing said webpage view instance into said browser label comprises:在所述浏览器标签内的所述网页视图标签管理类中维护网页视图对象列表和网页视图标识信息列表;Maintaining a webpage view object list and a webpage view identification information list in the webpage view tag management class in the browser tag;其中,所述网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,所述网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息的集合,所述网页视图对象和所述网页标识信息一一对应,所述网页标识信息中包含有对应网页载入的顺序信息。Wherein, the webpage view object list includes a collection of webpage view objects corresponding to all webpage view instances, the webpage view identification information list includes a collection of webpage identification information corresponding to all webpage view instances, and the webpage view objects and all There is a one-to-one correspondence between the webpage identification information, and the webpage identification information includes the sequence information of the corresponding webpage loading.4.如权利要求3所述的方法,其特征在于,所述根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,包括:4. The method according to claim 3, wherein, according to the loading order relationship information between the second web page and the first web page, the web page view tag management class in the browser tag Find the second webpage view instance corresponding to the second webpage in , including:根据所述载入顺序关系信息和与所述第一网页对应的第一网页标识信息,在所述网页标识信息列表中查找与所述第二网页对应的第二网页标识信息;Searching for the second web page identification information corresponding to the second web page in the web page identification information list according to the loading sequence relationship information and the first web page identification information corresponding to the first web page;基于所述第二网页标识信息,在所述网页视图对象列表中查找与所述第二网页对应的第二网页视图对象。Searching for a second webpage view object corresponding to the second webpage in the webpage view object list based on the second webpage identification information.5.如权利要求3所述的方法,其特征在于,所述网页标识信息包括网页载入序号和网页地址。5. The method according to claim 3, wherein the webpage identification information includes a webpage loading sequence number and a webpage address.6.一种浏览器标签内网页的切换装置,其特征在于,包括:6. A switching device for a webpage in a browser tab, characterized in that it comprises:第一接收模块,用于接收在同一浏览器标签内由当前显示的第一网页切换到历史载入过的第二网页的切换请求,所述切换请求包含所述第二网页与所述第一网页之间的载入顺序关系信息;The first receiving module is configured to receive a switching request for switching from a currently displayed first webpage to a historically loaded second webpage in the same browser tab, and the switching request includes the second webpage and the first webpage load order relationship information between web pages;查找模块,用于根据所述第二网页与所述第一网页之间的载入顺序关系信息,在该浏览器标签内的网页视图标签管理类中查找与所述第二网页对应的第二网页视图实例,其中,所述网页视图标签管理类包含多个网页视图实例,不同的网页视图实例对应不同的网页,并记录有不同网页载入的顺序关系;A search module, configured to search for the second webpage corresponding to the second webpage in the webpage view label management class in the browser tag according to the loading order relationship information between the second webpage and the first webpage. A webpage view instance, wherein the webpage view label management class includes a plurality of webpage view instances, different webpage view instances correspond to different webpages, and record the sequence relationship of loading different webpages;切换模块,用于根据查找到的所述第二网页视图实例,将所述标签当前显示的页面由所述第一网页切换到所述第二网页。A switching module, configured to switch the page currently displayed by the label from the first webpage to the second webpage according to the found second webpage view instance.7.如权利要求6所述的装置,其特征在于,所述装置还包括:7. The device of claim 6, further comprising:封装模块,用于预先封装包含所述网页视图实例的所述网页视图标签管理类到所述浏览器标签内。An encapsulation module, configured to pre-encapsulate the webpage view label management class containing the webpage view instance into the browser label.8.如权利要求7所述的装置,其特征在于,所述封装模块包括:8. The device according to claim 7, wherein the packaging module comprises:列表维护单元,用于在所述浏览器标签内的所述网页视图标签管理类中维护网页视图对象列表和网页视图标识信息列表;A list maintenance unit, configured to maintain a webpage view object list and a webpage view identification information list in the webpage view tag management class in the browser tag;其中,所述网页视图对象列表包括所有网页视图实例所对应的网页视图对象的集合,所述网页视图标识信息列表包括所有网页视图实例所对应的网页标识信息的集合,所述网页视图对象和所述网页标识信息一一对应,所述网页标识信息中包含有对应网页载入的顺序信息。Wherein, the webpage view object list includes a collection of webpage view objects corresponding to all webpage view instances, the webpage view identification information list includes a collection of webpage identification information corresponding to all webpage view instances, and the webpage view objects and all There is a one-to-one correspondence between the webpage identification information, and the webpage identification information includes the sequence information of the corresponding webpage loading.9.如权利要求8所述的装置,其特征在于,所述第一查找模块包括:9. The device according to claim 8, wherein the first search module comprises:第一查找单元,用于根据所述载入顺序关系信息和与所述第一网页对应的第一网页标识信息,在所述网页标识信息列表中查找与所述第二网页对应的第二网页标识信息;A first search unit, configured to search for a second web page corresponding to the second web page in the list of web page identification information according to the loading sequence relationship information and the first web page identification information corresponding to the first web page identification information;第二查找单元,用于基于所述第二网页标识信息,在所述网页视图对象列表中查找与所述第二网页对应的第二网页视图对象。A second searching unit, configured to search the webpage view object list for a second webpage view object corresponding to the second webpage based on the second webpage identification information.10.如权利要求8所述的装置,其特征在于,所述网页标识信息包括网页载入序号和网页地址。10. The device according to claim 8, wherein the webpage identification information includes a webpage loading sequence number and a webpage address.
CN201510967029.1A2015-12-212015-12-21Method and device for switching webpages in browser labelsPendingCN105653585A (en)

Priority Applications (1)

Application NumberPriority DateFiling DateTitle
CN201510967029.1ACN105653585A (en)2015-12-212015-12-21Method and device for switching webpages in browser labels

Applications Claiming Priority (1)

Application NumberPriority DateFiling DateTitle
CN201510967029.1ACN105653585A (en)2015-12-212015-12-21Method and device for switching webpages in browser labels

Publications (1)

Publication NumberPublication Date
CN105653585Atrue CN105653585A (en)2016-06-08

Family

ID=56476585

Family Applications (1)

Application NumberTitlePriority DateFiling Date
CN201510967029.1APendingCN105653585A (en)2015-12-212015-12-21Method and device for switching webpages in browser labels

Country Status (1)

CountryLink
CN (1)CN105653585A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106227887A (en)*2016-08-122016-12-14汪念鸿A kind of method returning the former page in browser new page
CN106843682A (en)*2017-01-032017-06-13上海斐讯数据通信技术有限公司A kind of display page layout switch apparatus and method of mobile terminal
CN107066271A (en)*2017-03-312017-08-18武汉斗鱼网络科技有限公司A kind of hierarchy management method and system for showing object
CN108073610A (en)*2016-11-112018-05-25聚好看科技股份有限公司Realize the method and device of Webpage loading
CN108268507A (en)*2016-12-302018-07-10北京搜狗科技发展有限公司A kind of processing method based on browser, device and electronic equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103246739A (en)*2013-05-162013-08-14百度在线网络技术(北京)有限公司Web browsing control method of multiple Web Views and browser
CN103309563A (en)*2013-06-282013-09-18贝壳网际(北京)安全技术有限公司Displayed page switching method and device
CN104461632A (en)*2014-12-092015-03-25东软集团股份有限公司Web App loading method and device

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN103246739A (en)*2013-05-162013-08-14百度在线网络技术(北京)有限公司Web browsing control method of multiple Web Views and browser
CN103309563A (en)*2013-06-282013-09-18贝壳网际(北京)安全技术有限公司Displayed page switching method and device
CN104461632A (en)*2014-12-092015-03-25东软集团股份有限公司Web App loading method and device

Cited By (7)

* Cited by examiner, † Cited by third party
Publication numberPriority datePublication dateAssigneeTitle
CN106227887A (en)*2016-08-122016-12-14汪念鸿A kind of method returning the former page in browser new page
CN108073610A (en)*2016-11-112018-05-25聚好看科技股份有限公司Realize the method and device of Webpage loading
CN108268507A (en)*2016-12-302018-07-10北京搜狗科技发展有限公司A kind of processing method based on browser, device and electronic equipment
CN108268507B (en)*2016-12-302021-06-22北京搜狗科技发展有限公司Browser-based processing method and device and electronic equipment
CN106843682A (en)*2017-01-032017-06-13上海斐讯数据通信技术有限公司A kind of display page layout switch apparatus and method of mobile terminal
CN107066271A (en)*2017-03-312017-08-18武汉斗鱼网络科技有限公司A kind of hierarchy management method and system for showing object
CN107066271B (en)*2017-03-312020-06-16武汉斗鱼网络科技有限公司Hierarchical management method and system for display object

Similar Documents

PublicationPublication DateTitle
CN105653585A (en)Method and device for switching webpages in browser labels
CN104036011B (en)Webpage element display method and browser device
CN104077387B (en)A kind of web page contents display methods and browser device
CN103617222A (en)Browser and method for preloading in webpages
CN103559097B (en)The method of interprocess communication, device and browser in a kind of browser
CN111736933B (en) Pop-up display method, device and readable storage medium
US10467790B2 (en)On-demand image spriting
KR102479288B1 (en) Method and system for real-time content delivery
WO2016000507A1 (en)Traffic-saving mode search service method, server, client and system
US20220036441A1 (en)Providing an item image
CN108595457A (en)A kind of rendering intent and device of the waterfall stream page
CN105608159A (en)Data caching method and device
CN110502299B (en)Method and equipment for providing novel information
US11477158B2 (en)Method and apparatus for advertisement anti-blocking
CN102929952A (en)Web page image display device and method
EP3555765B1 (en)Content search engine
US9959839B2 (en)Predictive screen display method and apparatus
CN102999591B (en)File management method and device
CN103049313B (en)For label stopping device and the method for browser
CN105512281A (en)Display method and device for official website type research result page
AU2014348888B2 (en)Presentation of digital content listings
CN110309464A (en) Information display system, method and device
CN103049507A (en)Label adding device and method for browser
CN108228790A (en)Push the methods of exhibiting and device of picture
CN115543317A (en)Front-end page development method and device

Legal Events

DateCodeTitleDescription
C06Publication
PB01Publication
C10Entry into substantive examination
SE01Entry into force of request for substantive examination
RJ01Rejection of invention patent application after publication

Application publication date:20160608

RJ01Rejection of invention patent application after publication

[8]ページ先頭

©2009-2025 Movatter.jp