Firefox browser abnormal restoring method
Technical field
The present invention relates to a kind of firefox browser abnormal restoring method, espespecially a kind of under the Linux platform, the method that causes abnormal browser automatically to recover because of third party's assembly or other reasons.
Background technology
In present Web experienced and develops, it was a kind of mode of commonly using that browser carries out abundant in content product development in conjunction with assemblies such as all kinds of plug-in units, expansions.Wherein, Adobe Flash Player is present most popular multimedia plug-in unit, and it provides breakthrough Web to experience as a cross-platform browser plug-in, becomes and is fit to the instrument that exploitation is created rich Internet application, flowed video/audio.Yet under the Linux platform, the browser components such as Adobe Flash Player often can cause the abnormal phenomenon of firefox while moving under firefox.In the situation that use browser as user's operation or experience carrier, in a single day firefox runs into extremely, acquiescence can eject the exception reporting device, system can enter dead state afterwards, in the situation that can not automatically recover to restart system, this is belonging to high level availability issue aspect the web product of development support flash on based on firefox under Linux platform, and this class problem finally can cause the miscarriage of product development.
As shown in Figure 1, in the situation that use browser as user's operation or experience carrier, in a single day the firefox browser runs into extremely, acquiescence can eject the exception reporting device, system can enter dead state afterwards, in the situation that can not automatically recover to restart system, its flow process as shown in Figure 1.
, if from the angle of firefox assembly, address this problem,, for closing source component,, as Adobe FlashPlayer,, even if determined reason, also can't revise its source code; For the assembly of increasing income,, even can revise its source code, also need first the source code of different assemblies is analyzed respectively and revised, solution does not have versatility., if from firefox browser source code aspect, address this problem, need to revise the exception handling of firefox inside; If from arrangement angles, address this problem, can only force to make it not eject the exception reporting device when firefox is abnormal, and the normal operation that can't recover firefox, also just can not solve well the availability issue of product.
Summary of the invention
For these reasons, the present invention is intended to address this problem by the mode of the exception handling (to the user, showing the exception reporting device) of revising firefox browser acquiescence, and does not need to revise simultaneously the source code of firefox browser or browser component (as Adobe Flash Player).
The present invention gets around and is difficult to solve the mode that causes abnormal cause, but by how quick and precisely recovering to solve browser after solving extremely, extremely produces disabled problem.
The purpose of this invention is to provide a kind of firefox of change acquiescence and eject the treatment mechanism of exception reporting device under abnormal conditions, make system can recover rapidly and continue normal operation after abnormal, the user is experienced and do not have any impact, and reach the compatible purpose of relevant third party's assemblies (containing plug-in unit and assembly) such as firefox and Adobe Flash Player.
The objective of the invention is to avoid revising and realizing to closing source component (as the modification of Adobe FlashPlayer), do not modified in the inside of the firefox that increases income simultaneously yet, but by revising the exception handling of firefox, add simultaneously quick restoring mechanism, realize the compatibility of firefox to all kinds of plug-in units, guarantee the stable operation of system.
The explanation of nouns of the relevant technical terms that the present invention relates to:
Adobe Flash Player: be a multimedia player or player plug-in unit, in this article, refer to the flash plug-in unit under browser.
Page jump: refer to that browser switches between different html pages by reloading page address in the same page, as browser, switch between www.baidu.com and two pages of www.163.com.Page jump relates to the release of page resource and reloads.
Browser component, plug-in unit, expansion: assembly is exactly control, object in ASP, its definition comprises plug-in unit and expansion.Plug-in unit is the program that a kind of application programming interfaces of following certain standard are write out, and the effect of plug-in unit is to make the WEB browser can directly call plug-in card program, for the treatment of data or the file of particular type.And expansion is the expansion of browser self function, as firefox self as skin, the modification of theme belongs to the expansion of firefox, and firefox to carry out video playback by Adobe Flash Player be the Plugin Mechanism that belongs to firefox.
The object of the invention is to:
, in order to guarantee the stability of system, do not allow firefox to occur abnormal or because firefox occurs abnormal, cause system unavailable;
Even it is abnormal to allow firefox to occur, but, in order the user not to be experienced and to impact, do not allow firefox to eject exception reporting device interface;
Even allow firefox abnormal rear ejection exception reporting device interface to occur, also can't complete browser by the exception reporting device that firefox gives tacit consent to and normally restart.
Wherein, the most typical application scenarios of the present invention is according to customer demand, linux system to be carried out the system of customization, as set-top-box system.
The technological means of the present invention's employing is: the present invention is basis take the exception reporting mechanism of browser firefox with the page access recording mechanism, replace the exception reporting device program of firefox by the application program that designs a recovery, and add and monitor and Restoration Mechanism, restart timely and accurately firefox after firefox is abnormal, the method for its realization comprises the following steps:
(1) keep the firefox browser by configuration in the situation that abnormal default treatment mode: guarantee to call firefox exception reporting device program when abnormal;
(2) revise exception reporting device (crash reporter) program, exception reporting device program with an executable recovery routine replacement firefox browser: the exception reporting device program that the application program of a recovery of design is replaced firefox, the exception handling that keeps firefox browser acquiescence, the abnormal prompt window of removal firefox browser; Simultaneously by calling recovery routine, for follow-up firefox browser is restarted and prepared at effective page place.
Further, can also comprise that step (3) obtains correct effective page of the last access of firefox browser, restart firefox and access and be somebody's turn to do " the effectively page ": according to the product application demand of reality, set up a kind of system monitoring mechanism of general product, obtain " the effectively page " of the last access of firefox browser; And realize that under the product systems of target the firefox browser returns to the normal condition that the page shows.
Of the present inventionly at useful technique effect, be: restarting of the abnormal rear acquiescence of existing firefox must be carried out manual operation by the exception reporting device under conventional system, yet be (great number of issues such as button operation and focus are arranged) that can not operate under custom-built system, and also can not meet the demands after restarting.Therefore, in case firefox is abnormal, after ejection exception reporting device, whole system will be absorbed in " deadlock " state, belongs to availability issue.Be generally not have the firefox browser under default situations to restart, also just do not have the contrast of restarting rear effect.The concrete Contrast on effect of realizing is: the result that the former causes is unavailable, even the latter does not extremely use and has any impact to system.
The abnormal restoration methods of firefox browser of the present invention, can guarantee the abnormal of monitoring firefox browser, and be restored to rapidly under abnormal state and cause the abnormal page.Simultaneously, because the firefox browser moves in internal memory, toggle speed is fast, just can restart from the abnormal page in 1s after abnormal, make user's experience aspect not have very large visible change, make under the Linux platform can be stable the various assemblies of use, the incompatibility problem that shield assembly brings, reach the usability requirements of product.
Description of drawings
Fig. 1 is the acquiescence flowchart of firefox browser after abnormal.
Fig. 2 is the flowchart that the present invention has the abnormal restoring ability.
Embodiment
The present invention take the exception reporting of browser firefox mechanism with the page access recording mechanism as basis, monitor and Restoration Mechanism by interpolation, the firefox of restarting promptly and accurately reaches the purpose of firefox and AdobeFlash Player compatibility.
The system of Web product generally all needs the firefox browser to carry out redirect at all kinds of pages, and below in conjunction with accompanying drawing Fig. 2, the invention will be further described as an example of following application scenarios example, but the present invention is not limited to the following examples.
Before entering the required http page after custom system starts, need transition pages carry out redirect (as transition pages be used for the Sampling network state with judge whether can the calling party homepage).To need two transition pages redirects to realize while supposing practical application: jump to jump.html by start.html, then by jump.html, jump to actual homepage index.html.If guarantee that firefox correctly recovers in time under of this sort application, must at first to firefox, be configured (step 10), that is: allow to close the firefox window by script; The inspection that forbidding is opened target pages; Allow the firefox exception reporting.
After firefox configuration step (10) is completed, need to carry out following steps:
(1) when firefox normally moves (step 11), with the firefox exception reporting device program monitoring of firefox browser acquiescence and judge whether firefox has (step 12) extremely.If the firefox no exceptions, firefox continues normal operation (step 11); Otherwise, with the abnormal restoring program, replace exception reporting device (crash reporter) program (step 13).
(2) firefox carries out with the abnormal restoring program and replaces exception reporting device (crash reporter) program (step 13); at first delete original exception reporting device (crash reporter) program; design again executable program of the same name (shell script) replacement exception reporting device (crash reporter) program that is used for realizing abnormal restoring; it can be started at just abnormal page place, be follow-up restarting firefox and access correct effective page and prepare.As shown in the dotted line frame in Fig. 2.
(3) detect page record (step 14): at first, obtain the page of the last access of firefox: the method for obtaining last accession page is by text filtering, obtains under the firefox User Catalog last the URL address in log file and is recorded as URL_NEW.Then, determine whether this page is " the effectively page ": if firefox is when certain is restarted, just in time at start.html, again abnormal on the system jump page of jump.html, the URL_NEW that by previous step, is got is exactly the transition pages of system, the address of effective page of depositing before need to obtaining from log file this moment, then complete corresponding work.
In the situation that the transition pages redirect is arranged, need to re-execute the redirect of transition pages, meet the product design demand.This be because, in the demand of some products, need to detect or configure system before enter actual User Page, as whether available in network, need in this case to do transition with some pages of realizing system configuration, in configuration with after determining, jump to actual User Page.Therefore, occur also needing to carry out such flow process after collapse, in order to meet the designing requirement of product.
(4) generate new effective page (step 15): at first, template page resume_jump_templet.html by jump.html builds resume_jump.html, the address of exception is write in the jump address of this file, then in conjunction with effective URL_NEW, generate an available jump.html page.
(5) restart firefox (step 16): firefox and at first access resume_start.html, jump to newly-generated resume_jump.html, then from this page jump to the abnormity point address that has just got, firefox returns to the abnormal front page, the final normal operation of recovery (step 11) by conversion of page.
The flash plug-in unit just causes the main object of numerous abnormal occurrencies, but not all.Simultaneously, this Restoration Mechanism also is applicable to all kinds of other and causes abnormal situation.Therefore, the present invention mainly is intended to the emphasis of protection system stability and Product Usability.No matter increasing income or close source,, in the situation that cause browsing abnormal, is to revise if close source item, is difficult to solve; If the project of increasing income, also need it is analyzed and transforms even revise, can the wasting manpower and material resources on solution.And now widely used flash player must solve abnormal problem.
And the present invention only causes the abnormal of browser firefox and reverts to example with player module Adobe Flash Player and describes, and in fact any employing third party assembly (containing plug-in unit and assembly) causes abnormal all in the scope that the present invention solves.