CN104021168B - A kind of method and device for browsing webpage - Google Patents
A kind of method and device for browsing webpage Download PDFInfo
- Publication number
- CN104021168B CN104021168B CN201410232855.7A CN201410232855A CN104021168B CN 104021168 B CN104021168 B CN 104021168B CN 201410232855 A CN201410232855 A CN 201410232855A CN 104021168 B CN104021168 B CN 104021168B
- Authority
- CN
- China
- Prior art keywords
- plug
- page
- control process
- control
- sandbox
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Active
Links
Classifications
-
- G—PHYSICS
- G06—COMPUTING OR CALCULATING; COUNTING
- G06F—ELECTRIC DIGITAL DATA PROCESSING
- G06F21/00—Security arrangements for protecting computers, components thereof, programs or data against unauthorised activity
- G06F21/50—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems
- G06F21/52—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow
- G06F21/53—Monitoring users, programs or devices to maintain the integrity of platforms, e.g. of processors, firmware or operating systems during program execution, e.g. stack integrity ; Preventing unwanted data erasure; Buffer overflow by executing in a restricted environment, e.g. sandbox or secure virtual machine
Landscapes
- Engineering & Computer Science (AREA)
- Computer Security & Cryptography (AREA)
- Software Systems (AREA)
- Theoretical Computer Science (AREA)
- Computer Hardware Design (AREA)
- Physics & Mathematics (AREA)
- General Engineering & Computer Science (AREA)
- General Physics & Mathematics (AREA)
- Information Transfer Between Computers (AREA)
- Stored Programmes (AREA)
Abstract
本发明公开了一种浏览网页的方法及装置,其中,所述方法包括:当页面线程创建插件/控件对象时,为所述插件/控件对象创建与页面进程相独立的插件/控件进程;将所述独立的插件/控件进程放到沙箱中运行;通过实现所述插件/控件进程与所述页面进程之间进行进程间通信,实现对网页的浏览;其中,所述页面进程运行于沙箱外。通过本发明,能够在确保上网浏览安全性问题的同时,提高浏览器运行的稳定性。
The present invention discloses a method and device for browsing web pages, wherein the method includes: when a page thread creates a plug-in/control object, creating a plug-in/control process for the plug-in/control object that is independent of the page process; The independent plug-in/control process is put into a sandbox to run; by implementing inter-process communication between the plug-in/control process and the page process, browsing of the webpage is realized; wherein, the page process runs in the sandbox out of the box. Through the invention, the stability of browser operation can be improved while ensuring the safety of surfing the Internet.
Description
本发明专利申请是申请日为2011年12月28日、申请号为201110448359.1、名称为“一种浏览网页的方法及装置”的中国发明专利申请的分案申请。The patent application of the present invention is a divisional application of the Chinese invention patent application with the filing date of December 28, 2011, the application number of 201110448359.1, and the title of "A Method and Device for Browsing Web Pages".
技术领域technical field
本发明涉及浏览器安全技术领域,特别是涉及一种浏览网页的方法及装置。The invention relates to the technical field of browser security, in particular to a method and device for browsing webpages.
背景技术Background technique
随着时代的进步,互联网已经成为人们生活的重要组成部分,而Web浏览器也理所应当地成为计算机等设备中最为重要的软件之一。浏览器提供了BHO(Browser HelperObject)、AxtiveX控件、工具栏组件接口,可以以插件/控件的形式定制、完善浏览器功能。With the progress of the times, the Internet has become an important part of people's lives, and web browsers have naturally become one of the most important software in devices such as computers. The browser provides BHO (Browser Helper Object), AxtiveX control, and toolbar component interfaces, which can be customized and improved in the form of plug-ins/controls.
但是,随着Web浏览器重要性的日益突出,恶意软件、木马、间谍软件等网络攻击也呈现逐渐的上升,尤其是浏览器插件,由于插件/控件程序由不同的发行商发行,其技术水平也良莠不齐,经常存在安全漏洞,因此容易会成为木马、病毒的重点攻击目标。However, with the growing importance of web browsers, malicious software, Trojan horses, spyware and other network attacks have also gradually increased, especially browser plug-ins. Since plug-in/control programs are issued by different publishers, their technical level There are also good and bad, and there are often security holes, so it is easy to become the key target of Trojan horses and viruses.
例如,研究发现:Adobe Flash、Windows Media Player、Realplayer等常用插件都极易受到攻击。利用浏览器插件的安全漏洞,病毒能够获取用户的系统权限,向用户的计算机下载、安装、运行恶意代码,窃取用户的个人信息(如网上银行信息、电子邮件、游戏密码)等等,对用户的系统安全造成严重的影响。For example, research has found that commonly used plug-ins such as Adobe Flash, Windows Media Player, and Realplayer are extremely vulnerable to attacks. Taking advantage of the security loopholes in browser plug-ins, the virus can obtain the user's system authority, download, install, and run malicious code to the user's computer, steal the user's personal information (such as online banking information, email, game password), etc., and harm the user. serious impact on system security.
此外,也有部分插件本身就是恶意插件,例如广告软件(Adware)或间谍软件(Spyware)等。此类恶意插件程序可以监视用户的上网行为,并把所记录的数据报告给插件程序的创建者,以达到投放广告、盗取游戏或银行帐号密码等非法目的。In addition, some plug-ins are malicious plug-ins themselves, such as adware (Adware) or spyware (Spyware). This type of malicious plug-in program can monitor the user's online behavior and report the recorded data to the creator of the plug-in program to achieve illegal purposes such as advertising, stealing game or bank account passwords, etc.
为了提高用户上网时的安全性,通常可以将浏览器技术与沙箱技术相结合。沙箱是一个虚拟系统程序,通过虚拟化的磁盘、内存以及网络资源,提供了一种程序的隔离运行机制。在沙箱中运行的程序,创建、修改、删除的所有文件和注册表内容都会被虚拟化重定向,确保程序无法对系统关键部位进行改动,破坏系统的真实环境。In order to improve the security of users when surfing the Internet, it is usually possible to combine browser technology with sandbox technology. A sandbox is a virtual system program that provides an isolated running mechanism for programs through virtualized disk, memory, and network resources. For programs running in the sandbox, all files and registry contents created, modified, and deleted will be virtualized and redirected to ensure that programs cannot modify key parts of the system and destroy the real environment of the system.
现有技术中,通常是直接将浏览器进程放入到沙箱中运行,这样可以从一定程度上确保用户上网时的安全性。但是,由于插件/控件设计水平上的限制,在运行时,经常会出现插件/控件的卡死、崩溃等不稳定现象,进而也导致整个页面进程也随之失去响应,影响浏览器的稳定性。In the prior art, usually, the browser process is directly put into a sandbox to run, so that the security of the user when surfing the Internet can be ensured to a certain extent. However, due to limitations in the design level of plug-ins/controls, unstable phenomena such as stuck and crashed plug-ins/controls often occur during runtime, which in turn causes the entire page process to lose response, affecting the stability of the browser .
因此,迫切需要本领域技术人员解决的技术问题就在于,如何在确保上网浏览安全性问题的同时,提高浏览器运行的稳定性。Therefore, a technical problem that urgently needs to be solved by those skilled in the art is how to improve the stability of the browser operation while ensuring the safety of surfing the Internet.
发明内容Contents of the invention
本发明提供了一种浏览网页的方法及装置,能够在确保上网浏览安全性问题的同时,提高浏览器运行的稳定性。The invention provides a method and device for browsing webpages, which can improve the running stability of the browser while ensuring the safety of surfing the Internet.
本发明提供了如下方案:The present invention provides following scheme:
一种浏览网页的方法,包括:A method of browsing a webpage, comprising:
当页面线程创建插件/控件对象时,为所述插件/控件对象创建与页面进程相独立的插件/控件进程;When the page thread creates a plug-in/control object, create a plug-in/control process independent of the page process for the plug-in/control object;
将所述独立的插件/控件进程放到沙箱中运行;Put the independent plug-in/control process into a sandbox to run;
通过实现所述插件/控件进程与所述页面进程之间进行进程间通信,实现对网页的浏览;其中,所述页面进程运行于沙箱外。By implementing inter-process communication between the plug-in/control process and the page process, browsing of the webpage is realized; wherein, the page process runs outside the sandbox.
其中,所述实现所述插件/控件进程与所述页面进程之间进行进程间通信包括:Wherein, the implementation of inter-process communication between the plug-in/control process and the page process includes:
在所述独立的插件/控件进程中创建主窗口对象及浏览器宿主对象,将所述浏览器宿主对象连接到所述主窗口对象上,以便所述页面进程通过所述主窗口向所述插件/控件进程发送消息。Create a main window object and a browser host object in the independent plug-in/control process, connect the browser host object to the main window object, so that the page process sends the plug-in to the plug-in through the main window / The control process sends a message.
其中,所述页面进程通过所述主窗口向所述插件/控件进程发送消息包括:Wherein, the page process sending a message to the plug-in/control process through the main window includes:
所述页面进程通过所述主窗口向所述插件/控件进程发送鼠标、键盘响应事件消息。The page process sends mouse and keyboard response event messages to the plug-in/control process through the main window.
其中,所述实现所述插件/控件进程与所述页面进程之间进行进程间通信包括:Wherein, the implementation of inter-process communication between the plug-in/control process and the page process includes:
当沙箱内的插件/控件进程需要向沙箱外发出指令时,判断该指令是否为向所述插件/控件进程发出的,并且属于预置的通讯指令集,如果是,则将该指令放行,以便所述插件/控件进程向所述页面进程进行发送消息。When the plug-in/control process in the sandbox needs to send an instruction to the outside of the sandbox, judge whether the instruction is sent to the plug-in/control process and belongs to the preset communication instruction set, and if so, release the instruction , so that the plug-in/control process can send a message to the page process.
其中,所述插件/控件进程向所述页面进程进行发送消息包括:Wherein, sending a message from the plug-in/control process to the page process includes:
当所述插件/控件进程有脚本需要调用时,将所述脚本转发到创建该插件进程的页面进程中;When the plug-in/control process has a script that needs to be called, forward the script to the page process that creates the plug-in process;
或者,or,
当所述插件/控件进程产生绘制事件时,将所述绘制事件对应的数据发送给对应的页面进程。When the plug-in/control process generates a drawing event, the data corresponding to the drawing event is sent to the corresponding page process.
一种浏览网页的装置,包括:A device for browsing web pages, comprising:
独立进程创建单元,用于当页面线程创建插件/控件对象时,为所述插件/控件对象创建与页面进程相独立的插件进程;The independent process creation unit is used to create a plug-in process independent of the page process for the plug-in/control object when the page thread creates the plug-in/control object;
沙箱驱动单元,用于将所述独立的插件/控件进程放到沙箱中运行;A sandbox driver unit, configured to put the independent plug-in/control process into a sandbox to run;
进程间通信单元,用于通过实现所述插件/控件进程与所述页面进程之间进行进程间通信,实现对网页的浏览。The inter-process communication unit is configured to implement inter-process communication between the plug-in/control process and the page process to realize web page browsing.
其中,所述进程间通信单元包括:Wherein, the inter-process communication unit includes:
第一通信子单元,用于在所述独立的插件/控件进程中创建主窗口对象及浏览器宿主对象,将所述浏览器宿主对象连接到所述主窗口对象上,以便所述页面进程通过所述主窗口向所述插件/控件进程发送消息。The first communication subunit is used to create a main window object and a browser host object in the independent plug-in/control process, and connect the browser host object to the main window object so that the page process can pass through The main window sends a message to the plug-in/control process.
其中,所述第一通信子单元具体用于:Wherein, the first communication subunit is specifically used for:
所述页面进程通过所述主窗口向所述插件/控件进程发送鼠标、键盘响应事件消息。The page process sends mouse and keyboard response event messages to the plug-in/control process through the main window.
其中,所述进程间通信单元包括:Wherein, the inter-process communication unit includes:
第二通信子单元,用于当沙箱内的插件/控件进程需要向沙箱外发出指令时,判断该指令是否为向所述插件/控件进程发出的,并且属于预置的通讯指令集,如果是,则将该指令放行,以便所述插件/控件进程向所述页面进程进行发送消息。The second communication subunit is used to determine whether the instruction is sent to the plug-in/control process and belongs to a preset communication instruction set when the plug-in/control process in the sandbox needs to send an instruction to the outside of the sandbox, If so, the instruction is released, so that the plug-in/control process can send a message to the page process.
其中,所述第二通信子单元具体用于:Wherein, the second communication subunit is specifically used for:
当所述插件/控件进程有脚本需要调用时,将所述脚本转发到创建该插件/控件进程的页面进程中;When the plug-in/control process has a script that needs to be called, forward the script to the page process that creates the plug-in/control process;
或者,or,
当所述插件/控件进程产生绘制事件时,将所述绘制事件对应的数据发送给对应的页面进程。When the plug-in/control process generates a drawing event, the data corresponding to the drawing event is sent to the corresponding page process.
根据本发明提供的具体实施例,本发明公开了以下技术效果:According to the specific embodiments provided by the invention, the invention discloses the following technical effects:
通过本发明,由于将插件/控件从浏览器页面进程中独立出来,并且将插件/控件进程实时放入到沙箱中运行,因此,能够在保证用户上网安全性的同时,避免由于插件/控件的卡死或崩溃等现象引起浏览器页面失去响应的现象,进而提高浏览器运行的稳定性。Through the present invention, since the plug-in/control is separated from the browser page process, and the plug-in/control process is put into the sandbox to run in real time, it is possible to avoid problems caused by the plug-in/control while ensuring the security of users surfing the Internet. The phenomenon of freezing or crashing of the browser causes the browser page to lose response, thereby improving the stability of the browser operation.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the accompanying drawings required in the embodiments. Obviously, the accompanying drawings in the following description are only some of the present invention. Embodiments, for those of ordinary skill in the art, other drawings can also be obtained based on these drawings without any creative effort.
图1是本发明实施例提供的方法的流程图;Fig. 1 is the flowchart of the method provided by the embodiment of the present invention;
图2是本发明实施例提供的装置的示意图。Fig. 2 is a schematic diagram of a device provided by an embodiment of the present invention.
具体实施方式detailed description
下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员所获得的所有其他实施例,都属于本发明保护的范围。The following will clearly and completely describe the technical solutions in the embodiments of the present invention with reference to the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only some, not all, embodiments of the present invention. All other embodiments obtained by persons of ordinary skill in the art based on the embodiments of the present invention belong to the protection scope of the present invention.
首先需要说明的是,发明人在实现本发明的过程中发现,在传统的实现方式下,插件/控件和页面在同一个进程中,当有恶意程序或者插件,通过BHO、AxtiveX控件、工具栏组件等方式,在浏览器进程过程中加载时,这样的对象会在与浏览器相同的上下文中运行,并能对可用的窗口和模块执行任何行动。例如,一个BHO能够探测到典型的事件,如GoBack、GoForward、DocumentComplete等,另外BHO能够存取浏览器的菜单与工具栏并能做出修改,还能够产生新窗口来显示当前网页的一些额外信息,还能够安装钩子以监控一些消息和动作,从而可能会对用户的系统带来安全隐患。另一方面,也正是由于插件/控件和页面在同一进程中,因此,当插件/控件出现卡死、崩溃等不稳当情况时,就会导致整个页面进程失去响应,影响浏览器的稳定性。First of all, it needs to be explained that the inventor found in the process of implementing the present invention that in the traditional implementation mode, the plug-in/control and the page are in the same process. Components, etc., when loaded during the browser process, such objects run in the same context as the browser and can perform any action on available windows and modules. For example, a BHO can detect typical events such as GoBack, GoForward, DocumentComplete, etc. In addition, a BHO can access the browser's menu and toolbar and make changes, and can also generate a new window to display some additional information about the current web page , and can also install hooks to monitor some messages and actions, which may bring security risks to the user's system. On the other hand, it is precisely because the plug-in/control and the page are in the same process, so when the plug-in/control is stuck, crashed or other unstable conditions, it will cause the entire page process to lose response and affect the stability of the browser .
基于上述分析,本发明实施例试图提供一种新的浏览网页的方法,通过该方法来达到确保上网浏览安全性问题的同时,提高浏览器运行的稳定性的目的。Based on the above analysis, the embodiments of the present invention attempt to provide a new method for browsing webpages, through which the purpose of improving the stability of browser operation while ensuring the security of Internet browsing is achieved.
参见图1,本发明实施例提供的浏览网页的方法可以包括以下步骤:Referring to Fig. 1, the method for browsing a webpage provided by the embodiment of the present invention may include the following steps:
S101:当页面线程创建插件/控件对象时,为所述插件/控件对象创建与页面进程相独立的插件进程;S101: When the page thread creates a plug-in/control object, create a plug-in process independent of the page process for the plug-in/control object;
一般而言,如果一个页面中存在插件,则在该页面加载的过程中,页面进程会创建插件/控件对象,在传统的方式下,就会直接在页面进程中创建插件/控件对象,而在本发明实施例中,在页面进程创建插件/控件对象时,可以为该插件/控件对象创建独立于页面进程的插件/控件进程。也即,使得插件/控件与页面在不同的进程中,这样,如果插件发生了卡死或者崩溃等现象,由于不会对其他进程的运行造成影响,因此,也就不会使得页面发生随之失去响应的现象,避免使浏览器的稳定性受到影响。Generally speaking, if there is a plug-in in a page, the page process will create the plug-in/control object during the page loading process. In the traditional way, the plug-in/control object will be created directly in the page process, while in In the embodiment of the present invention, when a page process creates a plug-in/control object, a plug-in/control process independent of the page process may be created for the plug-in/control object. That is to say, make the plug-in/control and the page in different processes, so that if the plug-in is stuck or crashes, it will not affect the operation of other processes, so it will not make the page happen Unresponsive phenomenon, to avoid affecting the stability of the browser.
S102:将所述独立的插件/控件进程放到沙箱中运行;S102: Put the independent plug-in/control process in a sandbox to run;
由于插件/控件被木马、病毒攻击的可能性比较大,因此,在本发明实施例中,将为插件/控件对象创建的独立进程放入到沙箱中运行,这样,可以避免由于插件/控件而给用户的系统安全造成威胁。Because the plug-in/control is more likely to be attacked by a Trojan horse or a virus, in the embodiment of the present invention, the independent process created for the plug-in/control object is put into a sandbox to run, so that the And pose a threat to the user's system security.
S103:通过实现所述插件/控件进程与所述页面进程之间进行进程间通信,实现对网页的浏览;其中,所述页面进程运行于沙箱外。S103: Realize web page browsing by implementing inter-process communication between the plug-in/control process and the page process; wherein, the page process runs outside the sandbox.
插件/控件作为对浏览器功能的补充或完善,在实现一些浏览器功能时,需要页面与插件/控件相互配合来完成。而在本发明实施例中,由于页面和插件/控件在不同的进程中,因此,还要使得页面与插件/控件之间能够进行必要的信息交互,这样才能保证浏览器功能的实现。这里所谓的信息交互包括两种情况,一种情况是页面进程需要发送消息给插件/控件进程,另一种情况就是插件/控件进程需要发送消息给页面进程。As a supplement or improvement to browser functions, plug-ins/controls need to cooperate with the page and plug-ins/controls to complete some browser functions. In the embodiment of the present invention, since the page and the plug-in/control are in different processes, it is necessary to enable necessary information interaction between the page and the plug-in/control, so as to ensure the realization of the browser function. The so-called information interaction here includes two cases, one case is that the page process needs to send a message to the plug-in/control process, and the other case is that the plug-in/control process needs to send a message to the page process.
为了使得页面进程能够发送消息给插件/控件进程,在将插件从浏览器页面进程中独立出来,并将插件/控件进程放入到沙箱中的同时,还需要在独立的插件/控件进程中创建主窗口对象及浏览器宿主对象,并将浏览器宿主对象连接到主窗口对象上。由于操作系统中的消息交互是基于窗口进行的,当在插件/控件进程中创建了主窗口对象并连接到浏览器宿主对象之后,当页面需要向插件/控件发送消息时,就可以向该插件/控件的主窗口发送,这样,插件/控件进程就可以通过该主窗口接收页面进程发送的消息。In order to enable the page process to send messages to the plug-in/control process, while separating the plug-in from the browser page process and putting the plug-in/control process into the sandbox, it is also necessary to be in an independent plug-in/control process Create a main window object and a browser host object, and connect the browser host object to the main window object. Since the message interaction in the operating system is based on the window, after the main window object is created in the plug-in/control process and connected to the browser host object, when the page needs to send a message to the plug-in/control, it can send a message to the plug-in /control's main window, so that the plug-in/control process can receive the message sent by the page process through the main window.
具体实现的过程中,页面进程在多种情况下都可能会向插件/控件进程发送消息。例如,可以由浏览器页面进程接管插件/控件进程中的鼠标、键盘等响应事件,并通过消息转发机制通知给沙箱内的插件进程,再由插件/控件进程执行相应的操作。这些鼠标、键盘响应事件具体可以包括:当页面进程对象改变窗口大小、页面刷新等事件时,页面进程可以通知插件/控件进程对象调整插件的大小、位置,等等。或者,当页面关闭或者浏览器退出时,还可以通知插件/控件进程,完成插件/控件对象的释放和销毁等操作,等等。During the specific implementation process, the page process may send messages to the plug-in/control process under various circumstances. For example, the browser page process can take over the mouse, keyboard and other response events in the plug-in/control process, and notify the plug-in process in the sandbox through the message forwarding mechanism, and then the plug-in/control process performs corresponding operations. These mouse and keyboard response events may specifically include: when the page process object changes the window size, page refresh and other events, the page process may notify the plug-in/control process object to adjust the size and position of the plug-in, and so on. Or, when the page is closed or the browser exits, the plug-in/control process can also be notified, and operations such as releasing and destroying the plug-in/control object can be completed, and so on.
而为了使得插件/控件进程能够发送消息给页面进程,由于页面进程自身存在窗口对象,因此不必再为页面进程创建窗口对象,但是在本发明实施例中,由于插件/控件进程在沙箱内,而浏览器页面进程在沙箱外,此时,如果插件/控件进程需要在沙箱内与沙箱外的浏览器页面进程进行进程间通讯时,由于沙箱的安全性限制,插件/控件进程向沙箱外的操作指令会被沙箱虚拟环境屏蔽,因此,需要沙箱做特殊处理,放过插件/控件进程必要的指令到沙箱外,以通知外部的浏览器页面进程,同时,外部的浏览器页面进程也可以把一些用户操作的指令(例如用户点击了某链接,或者点击“停止”、“播放”按钮等等)通知给沙箱内的插件/控件进程执行相应的处理工作。And in order to make the plug-in/control process send messages to the page process, because the page process itself has a window object, it is not necessary to create a window object for the page process, but in the embodiment of the present invention, because the plug-in/control process is in the sandbox, The browser page process is outside the sandbox. At this time, if the plug-in/control process needs to communicate with the browser page process outside the sandbox in the sandbox, due to the security restrictions of the sandbox, the plug-in/control process Operation instructions to outside the sandbox will be blocked by the sandbox virtual environment, therefore, the sandbox needs to do special processing to let the necessary instructions of the plug-in/control process go outside the sandbox to notify the external browser page process, and at the same time, the external The browser page process can also notify the plug-in/control process in the sandbox of some user-operated instructions (for example, the user clicks on a certain link, or clicks on the "stop", "play" button, etc.) to perform corresponding processing.
当然,为了确保安全性,并不能让插件/控件进程发出的所有消息都能发送到沙箱外,为此,可以预先定义必要的指令集,沙箱放过内部插件/控件进程向外发出的这些指令集,从而保证浏览器的正常运行。换言之,为了保证浏览器能够正常运行,沙箱可以允许一些指令发出到沙箱外,但是前提有两点:第一,该指令是由插件/控件进程发出的,第二,该指令属于预先定义的通讯指令集,只有当这两个条件同时满足时,才能放行,以保证系统的安全性。当然,在上述的具体实现时,除了上述定义通信指令集的方式之外,还可以通过其他方式实现,例如,可以通过管道机制来实现,等等,这里不再赘述。Of course, in order to ensure security, not all messages sent by the plug-in/control process can be sent out of the sandbox. For this reason, the necessary instruction set can be defined in advance, and the sandbox will let go of the messages sent by the internal plug-in/control process. These instruction sets, thus ensuring the normal operation of the browser. In other words, in order to ensure the normal operation of the browser, the sandbox can allow some instructions to be issued outside the sandbox, but there are two prerequisites: first, the instruction is issued by the plug-in/control process, and second, the instruction is a pre-defined Only when these two conditions are met at the same time can it be released to ensure the safety of the system. Of course, in the specific implementation of the above, in addition to the above-mentioned way of defining the communication instruction set, it can also be realized in other ways, for example, it can be realized through a pipeline mechanism, etc., which will not be repeated here.
在具体实现时,这些可以从沙箱内放过的指令可以包括多种情况。例如,由于页面与插件/控件具有对应性,因此为了保证运行中的正确性,如果独立进程中的插件需要执行某事件,则需要将对应的脚本放入到创建该插件/控件进程的页面线程中区,在该页面线程中运行该脚本。为此,插件/控件进程还可以维护一份插件/控件主窗口与页面线程之间的映射关系,用来保证页面线程与插件/控件线程的一一对应。当插件/控件进程中需要运行某脚本时,就可以通过该映射关系找到对应的页面线程,并将该脚本放入到该页面线程中运行。显然,当插件/控件进程发出的消息时这种消息时,就应该将该消息放过,也即允许将该消息发出到处于沙箱外的页面线程,可以将这种消息写入到通讯指令集中。In actual implementation, these instructions that can be released from the sandbox can include various situations. For example, due to the correspondence between pages and plug-ins/controls, in order to ensure correctness during operation, if a plug-in in an independent process needs to execute a certain event, the corresponding script needs to be put into the page thread that created the plug-in/control process Central, run the script in the page thread. For this reason, the plug-in/control process can also maintain a mapping relationship between the main window of the plug-in/control and the page thread, so as to ensure the one-to-one correspondence between the page thread and the plug-in/control thread. When a script needs to be run in the plug-in/control process, the corresponding page thread can be found through the mapping relationship, and the script can be put into the page thread to run. Obviously, when the message sent by the plug-in/control process is such a message, the message should be let go, that is, the message is allowed to be sent to the page thread outside the sandbox, and this message can be written into the communication command concentrated.
此外,由于插件/控件进程是在沙箱内运行的,因此,为了使得插件/控件进程涉及到的与界面相关的内容能够展现给用户,还需要插件/控件进程将界面相关的内容、显示的位置、大小等数据发送给对应的浏览器页面进程,由浏览器页面进程绘制界面显示结果(具体的,页面进程可以调用插件/控件进程的IViewObject::Draw方法,完成插件/控件对象内容的绘制及显示),这样,用户就能够看到相关的界面显示结果。同样的,插件/控件进程发出的这种绘制消息也可以从沙箱内放过,可以将这种消息写入到通讯指令集中。In addition, since the plug-in/control process runs in a sandbox, in order to display the content related to the interface involved in the plug-in/control process to the user, it is also necessary for the plug-in/control process to display the interface-related content, displayed Data such as position and size are sent to the corresponding browser page process, and the browser page process draws the interface display results (specifically, the page process can call the IViewObject::Draw method of the plug-in/control process to complete the drawing of the plug-in/control object content and display), so that the user can see the relevant interface display results. Similarly, the drawing messages sent by the plug-in/control process can also be released from the sandbox, and such messages can be written into the communication instruction set.
需要说明的是,在实际应用中,可能并不是所有的插件/控件都是允许与所在页面的进程独立的,例如,一些网银的控件,如果放到与页面进程相独立的另一个进程中,则可能无法实现相应的功能。因此,在具体实现时,可以仅针对一些播放器、flash等独立性强的插件/控件,或者在将插件/控件进程独立出来之后不会影响到具体功能实现的插件/控件,使用本发明实施例的方案来实现,其他的插件/控件仍然使用已有技术来实现即可。It should be noted that in actual applications, not all plug-ins/controls may be allowed to be independent from the process of the page where they are located. For example, if some online banking controls are placed in another process independent of the page process, Otherwise, the corresponding function may not be realized. Therefore, in specific implementation, it is only possible to use the present invention to implement plug-ins/controls that are highly independent such as some players and flash, or plug-ins/controls that will not affect the realization of specific functions after the plug-in/control process is separated. The solution of the example is implemented, and other plug-ins/controls can still be implemented using existing technologies.
总之,通过本发明实施例提供的浏览网页的方法,由于将插件/控件从浏览器页面进程中独立出来,并且将插件/控件进程实时放入到沙箱中运行,因此,能够在保证用户上网安全性的同时,避免由于插件/控件的卡死或崩溃等现象引起浏览器页面失去响应的现象,进而提高浏览器运行的稳定性。In a word, through the method for browsing web pages provided by the embodiment of the present invention, since the plug-in/control is separated from the browser page process, and the plug-in/control process is put into the sandbox to run in real time, it is possible to ensure that the user surfs the Internet. At the same time of security, avoid the phenomenon that the browser page loses response due to plug-in/control stuck or crashed, etc., thereby improving the stability of the browser operation.
与本发明实施例提供的浏览网页的方法相对应,本发明实施例还提供了一种浏览网页的装置,参见图2,该装置可以包括:Corresponding to the method for browsing webpages provided by the embodiment of the present invention, the embodiment of the present invention also provides a device for browsing webpages. Referring to FIG. 2, the device may include:
独立进程创建单元201,用于当页面线程创建插件/控件对象时,为所述插件/控件对象创建与页面进程相独立的插件/控件进程;An independent process creating unit 201, configured to create a plug-in/control process independent of the page process for the plug-in/control object when the page thread creates the plug-in/control object;
沙箱驱动单元202,用于将所述独立的插件/控件进程放到沙箱中运行;A sandbox driving unit 202, configured to put the independent plug-in/control process into a sandbox to run;
进程间通信单元203,用于通过实现所述插件/控件进程与所述页面进程之间进行进程间通信,实现对网页的浏览;其中,所述页面进程运行于沙箱外。The inter-process communication unit 203 is configured to implement inter-process communication between the plug-in/control process and the page process to browse web pages; wherein the page process runs outside the sandbox.
其中,进程间通信单元203具体可以包括:Wherein, the inter-process communication unit 203 may specifically include:
第一通信子单元,用于在所述独立的插件/控件进程中创建主窗口对象及浏览器宿主对象,将所述浏览器宿主对象连接到所述主窗口对象上,以便所述页面进程通过所述主窗口向所述插件/控件进程发送消息。The first communication subunit is used to create a main window object and a browser host object in the independent plug-in/control process, and connect the browser host object to the main window object so that the page process can pass through The main window sends a message to the plug-in/control process.
具体实现时,所述第一通信子单元具体可以用于:During specific implementation, the first communication subunit may specifically be used for:
所述页面进程通过所述主窗口向所述插件/控件进程发送鼠标、键盘响应事件消息。The page process sends mouse and keyboard response event messages to the plug-in/control process through the main window.
或者,进程间通信单元203也可以包括:Alternatively, the inter-process communication unit 203 may also include:
第二通信子单元,用于当沙箱内的插件/控件进程需要向沙箱外发出指令时,判断该指令是否为向所述插件/控件进程发出的,并且属于预置的通讯指令集,如果是,则将该指令放行,以便所述插件/控件进程向所述页面进程进行发送消息。The second communication subunit is used to determine whether the instruction is sent to the plug-in/control process and belongs to a preset communication instruction set when the plug-in/control process in the sandbox needs to send an instruction to the outside of the sandbox, If so, the instruction is released, so that the plug-in/control process can send a message to the page process.
具体实现时,所述第二通信子单元具体可以用于:During specific implementation, the second communication subunit can specifically be used for:
当所述插件/控件进程有脚本需要调用时,将所述脚本转发到创建该插件/控件进程的页面线程中;When the plug-in/control process has a script that needs to be called, forward the script to the page thread that creates the plug-in/control process;
或者,or,
当所述插件/控件进程产生绘制事件时,将所述绘制事件对应的数据发送给对应的页面进程。When the plug-in/control process generates a drawing event, the data corresponding to the drawing event is sent to the corresponding page process.
通过本发明实施例提供的浏览网页的装置,由于将插件/控件从浏览器页面进程中独立出来,并且将插件/控件进程实时放入到沙箱中运行,因此,能够在保证用户上网安全性的同时,避免由于插件/控件的卡死或崩溃等现象引起浏览器页面失去响应的现象,进而提高浏览器运行的稳定性。Through the device for browsing web pages provided by the embodiment of the present invention, since the plug-in/control is independent from the browser page process, and the plug-in/control process is put into the sandbox to run in real time, it can ensure the user's online security. At the same time, avoid the phenomenon that the browser page loses response due to the plug-in/control being stuck or crashed, thereby improving the stability of the browser operation.
通过以上的实施方式的描述可知,本领域的技术人员可以清楚地了解到本发明可借助软件加必需的通用硬件平台的方式来实现。基于这样的理解,本发明的技术方案本质上或者说对现有技术做出贡献的部分可以以软件产品的形式体现出来,该计算机软件产品可以存储在存储介质中,如ROM/RAM、磁碟、光盘等,包括若干指令用以使得一台计算机设备(可以是个人计算机,服务器,或者网络设备等)执行本发明各个实施例或者实施例的某些部分所述的方法。It can be seen from the above description of the implementation manners that those skilled in the art can clearly understand that the present invention can be implemented by means of software plus a necessary general hardware platform. Based on this understanding, the essence of the technical solution of the present invention or the part that contributes to the prior art can be embodied in the form of software products, and the computer software products can be stored in storage media, such as ROM/RAM, disk , CD, etc., including several instructions to make a computer device (which may be a personal computer, server, or network device, etc.) execute the methods described in various embodiments or some parts of the embodiments of the present invention.
本说明书中的各个实施例均采用递进的方式描述,各个实施例之间相同相似的部分互相参见即可,每个实施例重点说明的都是与其他实施例的不同之处。尤其,对于装置或系统实施例而言,由于其基本相似于方法实施例,所以描述得比较简单,相关之处参见方法实施例的部分说明即可。以上所描述的装置及系统实施例仅仅是示意性的,其中所述作为分离部件说明的单元可以是或者也可以不是物理上分开的,作为单元显示的部件可以是或者也可以不是物理单元,即可以位于一个地方,或者也可以分布到多个网络单元上。可以根据实际的需要选择其中的部分或者全部模块来实现本实施例方案的目的。本领域普通技术人员在不付出创造性劳动的情况下,即可以理解并实施。Each embodiment in this specification is described in a progressive manner, the same and similar parts of each embodiment can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device or system embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and for relevant parts, refer to part of the description of the method embodiments. The device and system embodiments described above are only illustrative, and the units described as separate components may or may not be physically separated, and the components shown as units may or may not be physical units, that is, It can be located in one place, or it can be distributed to multiple network elements. Part or all of the modules can be selected according to actual needs to achieve the purpose of the solution of this embodiment. It can be understood and implemented by those skilled in the art without creative effort.
以上对本发明所提供的浏览网页的方法及装置,进行了详细介绍,本文中应用了具体个例对本发明的原理及实施方式进行了阐述,以上实施例的说明只是用于帮助理解本发明的方法及其核心思想;同时,对于本领域的一般技术人员,依据本发明的思想,在具体实施方式及应用范围上均会有改变之处。综上所述,本说明书内容不应理解为对本发明的限制。The method and device for browsing webpages provided by the present invention have been introduced in detail above. The principle and implementation of the present invention have been explained by using specific examples in this paper. The description of the above embodiments is only used to help understand the method of the present invention. And its core idea; at the same time, for those skilled in the art, according to the idea of the present invention, there will be changes in the specific implementation and application scope. In summary, the contents of this specification should not be construed as limiting the present invention.
Claims (6)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410232855.7A CN104021168B (en) | 2011-12-28 | 2011-12-28 | A kind of method and device for browsing webpage |
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201410232855.7A CN104021168B (en) | 2011-12-28 | 2011-12-28 | A kind of method and device for browsing webpage |
CN201110448359.1A CN102436507B (en) | 2011-12-28 | 2011-12-28 | Method and device for browsing web pages |
Related Parent Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201110448359.1A Division CN102436507B (en) | 2011-12-28 | 2011-12-28 | Method and device for browsing web pages |
Publications (2)
Publication Number | Publication Date |
---|---|
CN104021168A CN104021168A (en) | 2014-09-03 |
CN104021168B true CN104021168B (en) | 2017-06-16 |
Family
ID=51437922
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201410232855.7A Active CN104021168B (en) | 2011-12-28 | 2011-12-28 | A kind of method and device for browsing webpage |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN104021168B (en) |
Families Citing this family (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN105678165A (en) * | 2016-01-29 | 2016-06-15 | 博雅网信(北京)科技有限公司 | Sandboxing keyboard system of mobile terminal and data transmitting method of sandboxing keyboard system |
CN106682062B (en) * | 2016-10-18 | 2021-03-12 | 腾讯科技(深圳)有限公司 | Website navigation processing method and terminal |
CN113704669B (en) * | 2021-09-01 | 2022-10-14 | 稿定(厦门)科技有限公司 | Data processing method and device for webpage operation |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101996095A (en) * | 2009-08-26 | 2011-03-30 | 阿里巴巴集团控股有限公司 | Method and device for accessing instant messaging program to plugin |
CN102184356A (en) * | 2011-04-21 | 2011-09-14 | 奇智软件(北京)有限公司 | Method, device and safe browser using sandbox technology for defense |
CN102232217A (en) * | 2008-12-02 | 2011-11-02 | 微软公司 | Sandboxed execution of plug-ins |
Family Cites Families (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US8924922B2 (en) * | 2010-06-14 | 2014-12-30 | Microsoft Corporation | Pre-compiling hosted managed code |
-
2011
- 2011-12-28 CN CN201410232855.7A patent/CN104021168B/en active Active
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN102232217A (en) * | 2008-12-02 | 2011-11-02 | 微软公司 | Sandboxed execution of plug-ins |
CN101996095A (en) * | 2009-08-26 | 2011-03-30 | 阿里巴巴集团控股有限公司 | Method and device for accessing instant messaging program to plugin |
CN102184356A (en) * | 2011-04-21 | 2011-09-14 | 奇智软件(北京)有限公司 | Method, device and safe browser using sandbox technology for defense |
Also Published As
Publication number | Publication date |
---|---|
CN104021168A (en) | 2014-09-03 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN102436507B (en) | Method and device for browsing web pages | |
US9355246B1 (en) | Tuning sandbox behavior based on static characteristics of malware | |
US11062028B2 (en) | Methods and systems for end-point malware prevention to refrain malware components from being executed | |
US9037873B2 (en) | Method and system for preventing tampering with software agent in a virtual machine | |
JP6706273B2 (en) | Behavioral Malware Detection Using Interpreted Virtual Machines | |
US20130333033A1 (en) | Software protection mechanism | |
US9111089B1 (en) | Systems and methods for safely executing programs | |
CN107949846B (en) | Detection of malicious thread suspension | |
Rosenthal | Emulation & virtualization as preservation strategies | |
US20170090929A1 (en) | Hardware-assisted software verification and secure execution | |
US8904538B1 (en) | Systems and methods for user-directed malware remediation | |
JP7144642B2 (en) | Behavior-based VM resource capture for forensics | |
MX2013013970A (en) | System and method for preserving references in sandboxes. | |
JP2013522761A (en) | System and method for performing network access control in a virtual environment | |
US11726843B2 (en) | File upload modifications for client side applications | |
JP2019061636A (en) | System and method for generating a log on a virtual machine for performing an antivirus scan of a file | |
CN102779030B (en) | A kind of manner of execution of registry operations and device | |
CN104021167B (en) | A kind of method and device for browsing webpage | |
CN106687979A (en) | Cross View Malware Detection | |
Oyama et al. | Detecting malware signatures in a thin hypervisor | |
EP3079057B1 (en) | Method and device for realizing virtual machine introspection | |
CN104021168B (en) | A kind of method and device for browsing webpage | |
CN103648049B (en) | Method and device for achieving safe video play | |
CN104598812B (en) | Web-page approach and device are browsed in sandbox | |
Ghodke et al. | On the implications of machine virtualization for DRM and fair use: a case study of a virtual audio device driver |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
C06 | Publication | ||
PB01 | Publication | ||
C10 | Entry into substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
TR01 | Transfer of patent right |
Effective date of registration: 20220725 Address after: Room 801, 8th floor, No. 104, floors 1-19, building 2, yard 6, Jiuxianqiao Road, Chaoyang District, Beijing 100015 Patentee after: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Address before: 100088 room 112, block D, 28 new street, new street, Xicheng District, Beijing (Desheng Park) Patentee before: BEIJING QIHOO TECHNOLOGY Co.,Ltd. Patentee before: Qizhi software (Beijing) Co.,Ltd. |
|
TR01 | Transfer of patent right |