WO2011000299A1 - 一种多页面浏览器防假死方法及装置 - Google Patents

一种多页面浏览器防假死方法及装置 Download PDF

Info

Publication number
WO2011000299A1
WO2011000299A1 PCT/CN2010/074618 CN2010074618W WO2011000299A1 WO 2011000299 A1 WO2011000299 A1 WO 2011000299A1 CN 2010074618 W CN2010074618 W CN 2010074618W WO 2011000299 A1 WO2011000299 A1 WO 2011000299A1
Authority
WO
WIPO (PCT)
Prior art keywords
window
page
main frame
parent
page window
Prior art date
Application number
PCT/CN2010/074618
Other languages
English (en)
French (fr)
Inventor
黄奎
严峻
罗登
刘斌
刘方敏
Original Assignee
腾讯科技(深圳)有限公司
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 腾讯科技(深圳)有限公司 filed Critical 腾讯科技(深圳)有限公司
Priority to RU2012101504/08A priority Critical patent/RU2520361C2/ru
Priority to BRPI1011927A priority patent/BRPI1011927B1/pt
Publication of WO2011000299A1 publication Critical patent/WO2011000299A1/zh

Links

Images

Classifications

    • GPHYSICS
    • G06COMPUTING; CALCULATING OR COUNTING
    • G06FELECTRIC DIGITAL DATA PROCESSING
    • G06F16/00Information retrieval; Database structures therefor; File system structures therefor
    • G06F16/90Details of database functions independent of the retrieved data types
    • G06F16/95Retrieval from the web
    • G06F16/954Navigation, e.g. using categorised browsing

Definitions

  • the present invention relates to the field of Internet browser technologies, and in particular, to an anti-fake technology of a multi-page browser.
  • multi-page browsers have at least the following disadvantages: Since a multi-page browser is a whole, if a page is suspended, the entire browser will be suspended, so that the entire browser cannot click any button, if you want to open a new one. The window can only restart the browser, which brings great inconvenience to the user on the user's physical examination.
  • the suspended animation refers to a state in which the browser has a problem, which is a state in which the interface is not refreshed, and any button is clicked without response, and no operation can be performed.
  • the existing anti-browser technology is only an anti-fake solution for Chrome browser, and Chrome browser uses a windowless way of page rendering.
  • the page has no window at all, and it will not cause suspended animation. . Therefore, the prior art does not have a perfect solution to the multi-page browser suspended animation, and the anti-fake death problem of the multi-page browser is an urgent problem to be solved.
  • the embodiment of the invention provides a multi-page browser anti-fake method and device, which effectively prevents the problem of suspended animation of the entire browser caused by a page suspended animation.
  • Embodiments of the present invention provide a multi-page browser anti-fake method, including:
  • the page window that removes the parent-child relationship communicates with the main frame window asynchronously.
  • the performance of the parent-child relationship is simulated between the page window from which the parent-child relationship is removed and the main frame window.
  • the performance of the simulated parent-child relationship includes:
  • the page window is moved, resized, displayed, or hidden accordingly.
  • the method further includes:
  • the embodiment of the invention provides a multi-page browser anti-fake device, comprising:
  • a first setting unit configured to set a page window as a top-level window, and remove a parent-child relationship between the page window and the main frame window, so that the page window is level with the main frame window;
  • the communication unit is configured to communicate asynchronously between the page window from which the parent-child relationship is removed and the main frame window.
  • the simulation unit is configured to simulate the performance of the parent-child relationship between the page window from which the parent-child relationship is removed and the main frame window.
  • the device further includes:
  • a second setting unit for setting a separate thread for each page window.
  • the embodiment of the present invention removes the parent-child relationship between the main frame window and the page window, and asynchronously communicates between the main frame window and the page window, so that the main frame is The window returns immediately after issuing a message, and does not wait for the processing of the page window. Even if the page window cannot respond, it has no effect on the main frame window, thereby avoiding the problem that the fake death of one page window causes the entire browser to die, effectively enhancing the user experience. .
  • FIG. 1 is a schematic diagram of a parent-child window relationship in a Windows system according to an embodiment of the present invention
  • FIG. 2 is a schematic diagram of an anti-fake method of a multi-page browser according to an embodiment of the present invention
  • FIG. 3 is a schematic diagram of message loops after a single thread is set to multi-thread according to an embodiment of the present invention
  • FIG. 4 is a schematic structural diagram of a multi-page browser anti-death device according to an embodiment of the present invention.
  • the embodiment of the present invention first analyzes the reason why a multi-page browser generates a suspended animation:
  • the window has a window that can be displayed to the user and is operable. That is, the user operates the mouse and the keyboard to generate various messages. Distribute to the window where the current system has focus. Only one window in the system has focus at the same time. The focus that is usually seen, such as the blinking cursor in the edit box, will be based on the different types of messages after the current focus window receives the message. Make a different response. For example, a mouse click, a mouse double click, a keyboard button, etc. will generate a message. Based on these messages, the application is continuously responsive, refreshing the interface, and completing the operation.
  • the internal message processing mode of the system is: the system will continuously put the message into the message queue, and each execution thread of the window has a message loop, and the message loop continuously obtains the message from the message queue and processes the message. However, if the part that handles the message is blocked and has not been run, then the message loop cannot get a new message, and then the operation on this page will not respond. When this happens, the page will not be refreshed, because the message must be refreshed to refresh the interface, and there is no response by pressing a button, so the message loop is blocked in the message processing, and does not respond to any operation, that is, it appears. suspended animation.
  • Each thread in the Windows system has a message loop, but in a single-threaded environment, multiple pages share a message loop, and blocking of a message loop can cause blocking of the entire program.
  • the embodiment of the present invention sets a separate thread for each page window. That is to construct a multi-threaded environment.
  • FIG. 1 there is a relationship between windows.
  • FIG. 1 there is a top-level window in Figure 1, which has an item on the taskbar and a window that minimizes, maximizes, and closes the button.
  • a button in the top-level window is also a window, that is, a button window in the figure, and a parent-child relationship between the top-level window and the button window is called a parent-child window.
  • the connection between the parent and child windows is: when the parent window moves, the child window must also move. When the parent window is hidden, the child window must also be hidden. When the parent window is displayed, the child window must also be displayed together.
  • the main frame window is the top-level window (parent window), and the page window (child window) is the relationship between the parent and child windows.
  • Each page window is in one thread, and the main frame window is in one thread.
  • the thread where the main frame window is located is the address bar, the toolbar where the toolbar is located, and the thread where the page window is located is the thread where the page window is located.
  • some operations of the parent window are synchronized with the child window by sending a message, such as moving, when the parent window moves, a message is sent to the child window, and then the child window also moves. There is a problem here.
  • the embodiment of the present invention solves the problem by removing the parent-child relationship between the page window and the main frame window and communicating asynchronously between the page window and the main frame window.
  • an embodiment of the present invention provides a multi-page browser anti-fake method. Taking the example shown in FIG. 2, the method includes the following steps:
  • Step 20 Set a separate thread for each page window
  • This step is necessary in a single-threaded environment, and in a multi-threaded environment, this step can be omitted.
  • the separate thread is set for each page window, that is, each page window is placed in a separate thread.
  • each page window is placed in a separate thread, so that each page window has a message loop, when a message loop of a thread is blocked. Does not affect the message loop of other threads. In other words, when a page window is suspended, other page windows are not affected.
  • a separate process is set up for each page window to further prevent a crash from occurring.
  • Step 21 The page window is used as the top-level window, and the parent-child relationship between the page window and the main frame window is removed, so that the page window is level with the main frame window;
  • the method of using the page window as a top-level window includes: setting an item including a minimize, maximize, and close button on a task bar of each page window.
  • the page window is leveled with the main frame window, that is, the page window and the main frame window are top-level windows, and there is no parent-child relationship.
  • Each window corresponds to a unique ID
  • the internal module of the system records the ID and records whether the window corresponding to the ID is a page window or a main frame window, so that even if the page window and the main frame window are set to be level, which window can be distinguished internally by the system Is the page window, which window is the main frame window.
  • the page window is used as the top-level window, if the page window does not respond to the main frame window, the user can choose to switch to another page window or close the page window.
  • Step 22 The page window from which the parent-child relationship is removed communicates with the main frame window in an asynchronous manner.
  • the asynchronous mode communication that is, the main frame window sends a message to the page window and returns immediately, without waiting for the processing of the message to be completed.
  • the parent window in the prior art is synchronized with the child window (page window) by sending a synchronous message, such as moving, when the parent window moves, a message is sent to the child window, and then the child window also moves.
  • a synchronous message such as moving
  • the parent window will wait for the return of the message, and the parent window is also blocked, causing the thread of the parent window to be blocked, so the entire program does not respond. It is.
  • the main frame window because the asynchronous communication is performed between the page window and the main frame window, the main frame window sends a message to the page window and returns immediately, without waiting for the processing of the message to be completed, so that even if the page window does not respond to the message, the main The frame window can still continue to process its own messages, thus avoiding the problem that the main frame window does not respond because the page window is not responding, and can limit the suspended animation to a page window.
  • the performance of the parent-child relationship is simulated between the page window from which the parent-child relationship is removed and the main frame window.
  • the performance of the simulated parent-child relationship includes: if the main frame window is moved, resized, displayed, or hidden, the page window is also moved, resized, displayed, or hidden accordingly. If the page window does not respond to the main frame window, the user can individually switch the unresponsive page window to another page window or close the unresponsive page window as needed.
  • the simulation operation may be limited to being displayed between the page window and the main frame window of the user. For example, if the main frame window moves, the user manually simulates the performance of the original parent-child relationship between the main frame window and the page window, that is, the user manually moves.
  • each page is placed in a separate thread, a page is suspended, other pages are not affected, and the parent-child relationship between the main frame window and the page window is removed, and the main frame window and the page window are
  • the main frame window returns immediately after issuing a message, and does not wait for the processing of the page window (child window), so that if the page window cannot respond, there is no effect on the main frame window.
  • Such a page window's suspended animation will not affect the operation of the main frame window, and can limit the suspended animation to the extent of a page window, effectively preventing the false death of a page window and causing the entire browser to die.
  • the embodiment of the invention further provides a multi-page browser anti-fake device, as shown in FIG. 4, the device includes:
  • a first setting unit 40 configured to set a page window as a top-level window, and remove a parent-child relationship between the page window and the main frame window, so that the page window is level with the main frame window;
  • the communication unit 41 is configured to communicate asynchronously between the page window from which the parent-child relationship is removed and the main frame window.
  • the device also includes:
  • the simulation unit 42 is configured to simulate the performance of the parent-child relationship between the page window from which the parent-child relationship is removed and the main frame window.
  • the performance of the simulated parent-child relationship includes: if the main frame window is moved, resized, displayed, or hidden, the page window is also moved, resized, displayed, or hidden accordingly.
  • the device further includes:
  • the second setting unit 43 is configured to set a separate thread for each page window, that is, to place each page in a separate thread.
  • the device in the embodiment of the present invention may be installed in a device existing in the browser management system, or may be a newly added device.
  • the multi-page browser anti-fake method and apparatus according to the embodiment of the present invention are applicable to any browser kernel, such as an IE kernel.
  • the embodiment of the present invention removes the parent-child relationship between the main frame window and the page window, and communicates asynchronously between the main frame window and the page window, and returns immediately after the main frame window (parent window) issues a message, without waiting
  • the processing of the page window (child window) so if the page window can not respond, it has no effect on the main frame window, so the fake death of a page window does not affect the operation of the main frame window; by placing each page window In a separate thread, a page window is suspended, and other page windows are not affected. Therefore, the embodiment of the present invention can limit the suspended animation to a range of a page window, thereby effectively preventing the false death of a page window and causing the entire browser to die. .
  • the embodiment of the present invention removes the parent-child relationship between the main frame window and the page window, and communicates asynchronously between the main frame window and the page window, so that the main frame window returns a message immediately after the message is sent, Waiting for the processing of the page window, even if the page window can't respond, it has no effect on the main frame window, thus avoiding the problem that the fake death of one page window causes the entire browser to die, which effectively enhances the user experience.
  • the readable storage medium is, for example, a read only memory (ROM), a random access memory (RAM), a magnetic disk, an optical disk, or the like.

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • User Interface Of Digital Computer (AREA)
  • Digital Computer Display Output (AREA)

Description

一种多页面浏览器防假死方法及装置
本申请要求于2009年7月2日提交中国专利局、申请号为2009101520074、发明名称为“一种多页面浏览器防假死方法及装置”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
技术领域
本发明涉及互联网浏览器技术领域,尤其涉及一种多页面浏览器的防假死技术。
发明背景
随着互联网的蓬勃发展,浏览器技术也得到了很大的发展,从开始的单页面浏览器,逐步过渡到现在的多页面浏览器。现在的浏览器绝大部分都是多页面浏览器。多页面浏览器也就是能在一个窗口同时打开多个页面,其优点是多个页面切换更方便,资源占用更少,浏览体验更好。
但是,多页面浏览器至少存在如下缺点:由于一个多页面浏览器是一个整体,如果一个页面假死,那么整个浏览器都会假死,使整个浏览器点击任何按键都不能操作,如果想要打开新的窗口,只能重新启动浏览器,这样在用户体检上给用户带来了很大的不便。所述假死是指浏览器出问题的一种状态,表现为界面不刷新,点击任何按钮没有响应,无法进行任何操作的一种状态。
现有的防浏览器假死技术仅有针对Chrome浏览器提供的一种防假死解决方案,而Chrome浏览器使用的是无窗口的一种页面渲染方式,页面根本就没有窗口,也不会导致假死。因此,现有技术没有一种完善的解决多页面浏览器假死的方案,多页面浏览器的防假死问题是亟待解决的问题。
发明内容
本发明实施例提供一种多页面浏览器防假死方法及装置,有效防止一个页面假死导致整个浏览器假死的问题。
本发明实施例是通过以下技术方案实现的:
本发明实施例提供一种多页面浏览器防假死方法,包括:
将页面窗口设置为顶层窗口,去掉页面窗口与主框架窗口之间的父子关系,使页面窗口与主框架窗口平级;
去掉父子关系的页面窗口与主框架窗口之间通过异步方式通信。
还包括:
在所述去掉父子关系的页面窗口与主框架窗口之间模拟父子关系的表现。
所述模拟父子关系的表现包括:
若主框架窗口移动、改变大小、显示或隐藏,则页面窗口也相应的移动、改变大小、显示或隐藏。
所述方法还包括:
在单线程环境中,为每个页面窗口设置单独的线程。
本发明实施例提供一种多页面浏览器防假死装置,包括:
第一设置单元,用于将页面窗口设置为顶层窗口,去掉页面窗口与主框架窗口之间的父子关系,使页面窗口与主框架窗口平级;
通信单元,用于在去掉父子关系的页面窗口与主框架窗口之间通过异步方式通信。
还包括:
模拟单元,用于在所述去掉父子关系的页面窗口与主框架窗口之间模拟父子关系的表现。
在单线程环境中,所述装置还包括:
第二设置单元,用于为每个页面窗口设置单独的线程。
由上述本发明实施例提供的技术方案可以看出,本发明实施例通过去掉主框架窗口与页面窗口之间的父子关系,并在主框架窗口与页面窗口之间采用异步方式通信,使主框架窗口发出一个消息后立即返回,不等待页面窗口的处理,即使页面窗口不能响应,对主框架窗口也没有任何影响,从而避免了一个页面窗口假死导致整个浏览器假死的问题,有效增强了用户体验。
附图简要说明
图1为本发明实施例Windows系统下,父子窗口关系示意图;
图2为本发明实施例多页面浏览器防假死方法示意图;
图3为本发明实施例单线程设置成多线程后的消息循环示意图;
图4为本发明实施例多页面浏览器放假死装置结构示意图。
实施本发明的方式
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,可以理解的是,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。
本发明实施例为解决多页面浏览器假死问题,首先分析多页面浏览器产生假死的原因:
在Windows系统下,所有的有窗口的程序都是消息驱动的,所述有窗口,即有可显示给用户且可操作的窗口,也就是用户操作鼠标和键盘会产生各种消息,这些消息会分发到当前系统有焦点的窗口,一个系统中同一时刻仅有一个窗口有焦点,通常看见的焦点,比如编辑框里面闪烁的光标,当前有焦点的窗口收到消息以后,会根据消息的不同类型做出不同的响应。比如鼠标按下,鼠标双击,键盘按键等都会产生消息。根据这些消息,使应用程序不断的做出响应,刷新界面,完成操作。
系统内部消息处理方式为:系统会把消息不断的放到消息队列里面,每个有窗口的执行线程都有一个消息循环,这个消息循环不断的从消息队列里面获取消息,处理消息。但是如果处理消息的部分发生了阻塞,一直没有运行完成,那么这个消息循环就不能获取新的消息,这时再对这个页面进行操作就会不响应了。出现这种情况,页面不会刷新,因为必须要收到刷新的消息才会刷新界面,按一个按钮也没有响应,于是这个消息循环就阻塞在消息处理这里,不响应任何操作了,也就是出现假死。
Windows系统中每一个线程有一个消息循环,但在单线程环境下,多个页面共用一个消息循环,一个消息循环的阻塞会导致整个程序的阻塞。基于上述分析,本发明实施例为每个页面窗口设置一个单独的线程。也就是构造出多线程环境。
但在多线程环境下还存在另外一个问题:在Windows系统下,窗口之间是有关系的。如图1中所示,图1中有一个顶层窗口,顶层窗口就是在任务栏上有一个项,并且有最小化,最大化和关闭按钮的一个窗口。而这个顶层窗口里面的一个按钮也是一个窗口,即图中的按钮窗口,顶层窗口与按钮窗口之间为父子关系,称为父子窗口。父子窗口之间的联系为:当父窗口移动的时候,子窗口也必须要移动。当父窗口隐藏的时候,子窗口也必须隐藏,父窗口显示的时候,子窗口也必须要一起显示。在多线程多页面浏览器的环境下,主框架窗口为顶层窗口(父窗口),和页面窗口(子窗口)之间就是父子窗口的关系。每个页面窗口各在一个线程,主框架窗口在一个线程。主框架窗口所在线程就是地址栏,工具栏等所在的线程,页面窗口所在线程就是页面窗口所在的线程。在多线程的情况下,父窗口的某些操作是通过发消息来和子窗口同步的,比如移动,当父窗口移动的时候,向子窗口发一个消息,然后子窗口也移动。这里有一个问题,如果子窗口所在的线程阻塞了,不响应消息了,那么父窗口会一直等待这个消息的返回,于是父窗口也阻塞了,导致父窗口所在的线程也阻塞了,于是整个程序就不响应了。因此,在多线程的情况下,如果一个页面窗口出现了假死,则操作主框架窗口的时候,主框架窗口需要发消息与页面窗口同步,但页面窗口不响应消息,于是主框架窗口就等待页面窗口,导致整个浏览器不响应出现假死。基于对多线程环境的分析,本发明实施例通过去掉页面窗口与主框架窗口之间的父子关系,并在页面窗口与主框架窗口间通过异步方式通信来解决该问题。
通过上面的分析,本发明实施例提供一种多页面浏览器防假死方法,以图2中所示为例,该方法包括如下步骤:
步骤20:为每个页面窗口设置单独的线程;
在单线程环境中,该步骤是必须的,而在多线程环境下,该步骤是可以省略的。
所述为每个页面窗口设置单独的线程,即,将每个页面窗口都放在一个独立的线程里面。
在单线程环境中,如图3中所示,把每个页面窗口各自放在一个独立的线程里面,这样每个页面窗口就有了一个消息循环,当某一个线程的消息循环发生阻塞的时候,不会影响到其它线程的消息循环。也就是说,当一个页面窗口假死的时候,其它页面窗口不会受到影响。
可选地,为每个页面窗口单独设置一个进程,从而可以进一步防止崩溃的发生。
步骤21:将页面窗口作为顶层窗口,并去掉页面窗口与主框架窗口之间的父子关系,使页面窗口与主框架窗口平级;
所述将页面窗口作为顶层窗口的方法包括:在每个页面窗口的任务栏上设置一个包括最小化,最大化和关闭按钮的一个项。
所述使页面窗口与主框架窗口平级,即令页面窗口和主框架窗口均为顶层窗口,不存在父子关系。每个窗口对应唯一一个ID,系统内部模块记录该ID以及记录该ID对应的窗口是页面窗口还是主框架窗口,这样即使将页面窗口与主框架窗口设置为平级,系统内部也能区分哪个窗口是页面窗口,哪个窗口是主框架窗口。
将页面窗口作为顶层窗口后,若页面窗口不响应主框架窗口,则用户可以选择切换到别的页面窗口或关闭该页面窗口。
步骤22:去掉父子关系的页面窗口与主框架窗口之间通过异步方式通信。
所述异步方式通信,即主框架窗口发出一个消息给页面窗口以后立即返回,不用等待消息的处理完成。
由于现有技术中父窗口(主框架窗口)采用发送同步消息方式与子窗口(页面窗口)同步的,比如移动,当父窗口移动的时候,向子窗口发一个消息,然后子窗口也移动,这时如果子窗口所在的线程阻塞了,不响应消息了,那么父窗口会一直等待这个消息的返回,于是父窗口也阻塞了,导致父窗口所在的线程也阻塞了,于是整个程序就不响应了。而本发明实施例中由于在页面窗口与主框架窗口之间通过异步方式通信,主框架窗口发出一个消息给页面窗口以后立即返回,不用等待消息的处理完成,这样即使页面窗口不响应消息,主框架窗口还是可以继续处理自己的消息,这样就避免了主框架窗口因为页面窗口的不响应而导致自己也不响应的问题,可以将假死限制在一个页面窗口。
另外,在所述去掉父子关系的页面窗口与主框架窗口之间模拟父子关系的表现。所述模拟父子关系的表现包括:若主框架窗口移动、改变大小、显示或隐藏,则页面窗口也相应的移动、改变大小、显示或隐藏。若页面窗口不响应主框架窗口,则用户可以根据需要单独对该不响应的页面窗口选择切换到别的页面窗口或关闭该不响应的页面窗口。所述模拟操作可以只限于显示给用户的页面窗口与主框架窗口之间,例如,若主框架窗口移动,则用户手动模拟主框架窗口与页面窗口之间原父子关系的表现,即用户手动移动显示给用户的页面窗口。
本发明实施例把每个页面都放在一个独立的线程里面,一个页面假死,其它页面不会受到影响,且去掉主框架窗口与页面窗口之间的父子关系,并在主框架窗口与页面窗口间采用异步方式通信,则在主框架窗口(父窗口)发出一个消息后立即返回,不等待页面窗口(子窗口)的处理,这样如果页面窗口不能响应,则对主框架窗口也没有任何影响,这样一个页面窗口的假死不会影响主框架窗口的操作,可以把假死限制在一个页面窗口的范围之内,有效防止一个页面窗口假死导致整个浏览器假死的问题。
本发明实施例还提供一种多页面浏览器防假死装置,如图4所示,该装置包括:
第一设置单元40,用于将页面窗口设置为顶层窗口,并去掉页面窗口与主框架窗口之间的父子关系,使页面窗口与主框架窗口平级;
通信单元41,用于在去掉父子关系的页面窗口与主框架窗口之间通过异步方式通信。
所述装置还包括:
模拟单元42,用于在所述去掉父子关系的页面窗口与主框架窗口之间模拟父子关系的表现。所述模拟父子关系的表现包括:若主框架窗口移动、改变大小、显示或隐藏,则页面窗口也相应的移动、改变大小、显示或隐藏。
在单线程环境中,所述装置还包括:
第二设置单元43,用于为每个页面窗口设置单独的线程,也就是将每个页面都放在一个独立的线程里面。
本发明实施例所述装置可以设置于浏览器管理系统已有的装置内,也可以为新增的装置。本发明实施例所述多页面浏览器防假死方法及装置适用于任何浏览器内核,例如IE内核。
本发明实施例去掉主框架窗口与页面窗口之间的父子关系,并在主框架窗口与页面窗口之间采用异步方式通信,则在主框架窗口(父窗口)发出一个消息后立即返回,不等待页面窗口(子窗口)的处理,这样如果页面窗口不能响应,则对主框架窗口也没有任何影响,这样一个页面窗口的假死不会影响主框架窗口的操作;通过将每个页面窗口都放在一个独立的线程里面,一个页面窗口假死,其它页面窗口不会受到影响,因此本发明实施例可以把假死限制在一个页面窗口的范围之内,有效防止一个页面窗口假死导致整个浏览器假死的问题。
综上所述,本发明实施例通过去掉主框架窗口与页面窗口之间的父子关系,并在主框架窗口与页面窗口之间采用异步方式通信,使主框架窗口发出一个消息后立即返回,不等待页面窗口的处理,即使页面窗口不能响应,对主框架窗口也没有任何影响,从而避免了一个页面窗口假死导致整个浏览器假死的问题,有效增强了用户体验。
另外,在单线程环境下,通过为每个页面设置独立的线程,对应独立的消息队列,解决了单线程环境下一个页面假死,导致所有页面假死的问题。
本领域普通技术人员可以理解,实现上述实施例方法中的全部或部分步骤是可以通过程序来指令相关的硬件完成,所述的程序可以存储于一计算机可读存储介质中。该可读存储介质例如只读存储器(简称ROM)、随机存取存储器(简称RAM)、磁盘、光盘等。
以上所述,仅为本发明较佳的具体实施方式,但本发明的保护范围并不局限于此,任何熟悉本技术领域的技术人员在本发明揭露的技术范围内,可轻易想到的变化或替换,都应涵盖在本发明的保护范围之内。因此,本发明的保护范围应该以权利要求的保护范围为准。

Claims (7)

  1. 一种多页面浏览器防假死方法,其特征在于,包括:
    将页面窗口设置为顶层窗口,去掉页面窗口与主框架窗口之间的父子关系,使页面窗口与主框架窗口平级;
    去掉父子关系的页面窗口与主框架窗口之间通过异步方式通信。
  2. 如权利要求1所述的方法,其特征在于,还包括:
    在所述去掉父子关系的页面窗口与主框架窗口之间模拟父子关系的表现。
  3. 如权利要求2所述的方法,其特征在于,所述模拟父子关系的表现包括:
    若主框架窗口移动、改变大小、显示或隐藏,则页面窗口也相应的移动、改变大小、显示或隐藏。
  4. 如权利要求1、2或3所述的方法,其特征在于,还包括:
    在单线程环境中,为每个页面窗口设置单独的线程。
  5. 一种多页面浏览器防假死装置,其特征在于,包括:
    第一设置单元,用于将页面窗口设置为顶层窗口,去掉页面窗口与主框架窗口之间的父子关系,使页面窗口与主框架窗口平级;
    通信单元,用于在去掉父子关系的页面窗口与主框架窗口之间通过异步方式通信。
  6. 如权利要求5所述的装置,其特征在于,还包括:
    模拟单元,用于在所述去掉父子关系的页面窗口与主框架窗口之间模拟父子关系的表现。
  7. 如权利要求5或6所述的装置,其特征在于,在单线程环境中,所述装置还包括:
    第二设置单元,用于为每个页面窗口设置单独的线程。
PCT/CN2010/074618 2009-07-02 2010-06-28 一种多页面浏览器防假死方法及装置 WO2011000299A1 (zh)

Priority Applications (2)

Application Number Priority Date Filing Date Title
RU2012101504/08A RU2520361C2 (ru) 2009-07-02 2010-06-28 Способ предотвращения ложной приостановки многостраничного браузера и соответствующее устройство
BRPI1011927A BRPI1011927B1 (pt) 2009-07-02 2010-06-28 método e aparelho para impedir suspensão espúria de um navegador multipágina

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN200910152007.4 2009-07-02
CN2009101520074A CN101609470B (zh) 2009-07-02 2009-07-02 一种多页面浏览器防假死方法及装置

Publications (1)

Publication Number Publication Date
WO2011000299A1 true WO2011000299A1 (zh) 2011-01-06

Family

ID=41483224

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2010/074618 WO2011000299A1 (zh) 2009-07-02 2010-06-28 一种多页面浏览器防假死方法及装置

Country Status (4)

Country Link
CN (1) CN101609470B (zh)
BR (1) BRPI1011927B1 (zh)
RU (1) RU2520361C2 (zh)
WO (1) WO2011000299A1 (zh)

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541564A (zh) * 2011-12-31 2012-07-04 东软集团股份有限公司 一种ui复用方法及装置
CN102722559A (zh) * 2012-05-31 2012-10-10 奇智软件(北京)有限公司 一种异常页面的进程控制方法、装置和系统
CN105975325A (zh) * 2016-04-22 2016-09-28 浙江工业大学 一种自动跳出阻塞式代码段的控制方法

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101504658B (zh) * 2009-01-23 2011-09-28 北京搜狗科技发展有限公司 一种实现多标签应用程序中进行消息交互的方法及系统
CN101609470B (zh) * 2009-07-02 2011-08-10 腾讯科技(深圳)有限公司 一种多页面浏览器防假死方法及装置
CN102375758A (zh) * 2010-08-20 2012-03-14 联芯科技有限公司 移动通信设备浏览器防假死方法和装置
CN102385594B (zh) * 2010-08-31 2015-09-30 腾讯科技(深圳)有限公司 多核浏览器的内核控制方法和装置
CN102843394B (zh) * 2011-06-22 2015-12-09 腾讯科技(深圳)有限公司 网络应用的框架装置及运行方法
CN103116503B (zh) * 2011-11-17 2016-12-07 华为软件技术有限公司 一种多窗口的实现方法及装置
CN102591711B (zh) 2011-12-29 2014-06-25 奇智软件(北京)有限公司 一种窗口防假死方法和装置
CN104035815B (zh) * 2011-12-29 2017-12-12 北京奇虎科技有限公司 一种窗口防假死方法和装置
CN102915251B (zh) * 2012-03-08 2014-06-18 北京金山安全软件有限公司 一种多页面浏览器处理消息的方法和装置
CN102915256B (zh) * 2012-03-08 2015-02-18 北京金山安全软件有限公司 多核浏览器下的消息传递方法与装置
CN103377228B (zh) * 2012-04-25 2016-09-07 阿里巴巴集团控股有限公司 一种用于浏览器的页面内容呈现方法及装置
CN103631706B (zh) * 2012-08-27 2018-09-04 腾讯科技(深圳)有限公司 一种浏览器测试方法和装置
CN103810238A (zh) * 2013-11-20 2014-05-21 国家电网公司 一种基于异步处理的大数据量Excel文件导出方法
CN104252538B (zh) * 2014-09-22 2018-10-12 可牛网络技术(北京)有限公司 网页处理方法和装置
CN104572271B (zh) * 2015-02-04 2018-04-13 北京瑞星网安技术股份有限公司 多标签页浏览器防假死的方法和系统
CN108234624A (zh) * 2017-12-29 2018-06-29 贵阳语玩科技有限公司 数据请求的处理方法及系统
CN111045775B (zh) * 2019-12-10 2023-10-27 北京恒泰实达科技股份有限公司 一种在大屏可视化系统中高效集成第三方应用程序的方法
CN113312192A (zh) * 2021-06-07 2021-08-27 平安证券股份有限公司 基于窗口的数据同步方法、装置、电子设备及存储介质

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0974900A2 (en) * 1998-07-20 2000-01-26 Hewlett-Packard Company Method for communicating between frames within a web browser window
CN101299220A (zh) * 2008-06-24 2008-11-05 腾讯科技(深圳)有限公司 多页面浏览器窗口拆分方法、合并方法和多页面浏览器
CN101504658A (zh) * 2009-01-23 2009-08-12 北京搜狗科技发展有限公司 一种实现多标签应用程序中进行消息交互的方法及系统
CN101609470A (zh) * 2009-07-02 2009-12-23 腾讯科技(深圳)有限公司 一种多页面浏览器防假死方法及装置

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7596760B2 (en) * 2005-04-07 2009-09-29 Microsoft Corporation System and method for selecting a tab within a tabbed browser

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP0974900A2 (en) * 1998-07-20 2000-01-26 Hewlett-Packard Company Method for communicating between frames within a web browser window
CN101299220A (zh) * 2008-06-24 2008-11-05 腾讯科技(深圳)有限公司 多页面浏览器窗口拆分方法、合并方法和多页面浏览器
CN101504658A (zh) * 2009-01-23 2009-08-12 北京搜狗科技发展有限公司 一种实现多标签应用程序中进行消息交互的方法及系统
CN101609470A (zh) * 2009-07-02 2009-12-23 腾讯科技(深圳)有限公司 一种多页面浏览器防假死方法及装置

Cited By (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102541564A (zh) * 2011-12-31 2012-07-04 东软集团股份有限公司 一种ui复用方法及装置
CN102722559A (zh) * 2012-05-31 2012-10-10 奇智软件(北京)有限公司 一种异常页面的进程控制方法、装置和系统
CN105975325A (zh) * 2016-04-22 2016-09-28 浙江工业大学 一种自动跳出阻塞式代码段的控制方法

Also Published As

Publication number Publication date
CN101609470B (zh) 2011-08-10
BRPI1011927A2 (pt) 2016-04-19
RU2012101504A (ru) 2013-08-10
RU2520361C2 (ru) 2014-06-20
BRPI1011927B1 (pt) 2020-05-05
CN101609470A (zh) 2009-12-23

Similar Documents

Publication Publication Date Title
WO2011000299A1 (zh) 一种多页面浏览器防假死方法及装置
CN105681841B (zh) 一种基于浏览器的视频播放控制方法及系统
WO2014134899A1 (zh) 电子阅读设备及其文本信息提取与保存的方法、存储介质
WO2013075440A1 (zh) 虚拟机管理系统及方法
WO2018036000A1 (zh) 应用程序跨系统运行的方法和装置
US20150067024A1 (en) Autobatching
Ramachandran et al. Space-time memory: A parallel programming abstraction for interactive multimedia applications
WO2019047218A1 (zh) 一种图形化编程方法、装置、计算机存储介质及视觉系统
CN107656933A (zh) 一种语音播报方法及装置
CN107368568A (zh) 一种笔记生成的方法、装置、设备和存储介质
CN102779076B (zh) 一种浏览器中进程间通信的方法和装置
CN107577478A (zh) 一种手机软件上线方法及系统
Guo et al. The effects of continuous conversation and task complexity on usability of an AI-based conversational agent in smart home environments
CN103778488A (zh) 一种考核系统
Yu et al. The development of online examination system based on B/S structure
CN206332773U (zh) 舆情展示装置
WO2017143511A1 (zh) 智能手表的睡眠检测方法及系统
Guerraoui What object-oriented distributed programming does not have to be, and what it may be
US5898840A (en) Maintaining a sequential store order (SSO) in a non-SSO machine
WO2017120878A1 (zh) 一种浏览网页的重启方法以及电子设备
CN118210568A (zh) 一种MacOS上多个浏览器实例间同步操作的方法及装置
Milev Technological approaches for presentation of data analysis in web applications
JPH11143674A (ja) 自動ページ表示装置及び自動ページ表示方法
JP2022113626A (ja) レンダリング方法、装置、電子機器及び記憶媒体
CN115277376A (zh) 灾备切换方法、装置、设备及介质

Legal Events

Date Code Title Description
121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 10793594

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

WWE Wipo information: entry into national phase

Ref document number: 2012101504

Country of ref document: RU

32PN Ep: public notification in the ep bulletin as address of the adressee cannot be established

Free format text: NOTING OF LOSS OF RIGHTS PURSUANT TO RULE 112(1) EPC (EPO FORM 1205A DATED 25/05/2012)

REG Reference to national code

Ref country code: BR

Ref legal event code: B01A

Ref document number: PI1011927

Country of ref document: BR

122 Ep: pct application non-entry in european phase

Ref document number: 10793594

Country of ref document: EP

Kind code of ref document: A1

ENP Entry into the national phase

Ref document number: PI1011927

Country of ref document: BR

Kind code of ref document: A2

Effective date: 20111230