Summary of the invention
The embodiment of the invention provides a kind of display methods of browser page and devices, at least to solve in the related technologyWhen showing browser page the technical issues of excessive occupied system resources.
According to an aspect of an embodiment of the present invention, a kind of display methods of browser page is provided, this method comprises:The current browser page is parsed, the current browser page is divided into multiple display areas;User is received in multiple display areasIn choose the instruction of destination display area;In response to choosing instruction, according to default layout type displaying target display area, and stopOnly run other display areas in multiple display areas in addition to destination display area.
Further, the current browser page is parsed, it includes: to obtain that the current browser page, which is divided into multiple display areas,Take the web page address of the current browser page;The corresponding web page files of web page address are loaded according to predefined rule;Analyzing web pageFile obtains page documents data model;Page documents data model is divided into and is corresponded respectively with multiple display areasMultiple script modules.
Further, receiving user to choose the instruction of destination display area in multiple display areas includes: according to the pageDocument data model shows the current browser page in a browser;Command reception module is added in each display area,In, command reception module is used to receive the instruction of user;Instruction is chosen by the command reception module reception of each display area.
Further, including: according to default layout type displaying target display area will in page documents data modelThe display properties of the corresponding script module in other display areas in multiple display areas in addition to destination display area is revised asIt is invisible;Show modified page documents data model.
Further, the display properties of the corresponding script module in other display areas is revised as it is invisible before, shouldMethod further include: replicate simultaneously memory page document data model, obtain backup page document data model, wherein receivingAfter the instruction of destination display area is chosen in user's cancellation, this method further include: obtain backup page document data model and simultaneously showShow.
Further, after receiving user and choosing the instruction of destination display area in multiple display areas, this methodFurther include: default display mode is determined according to the user's choice;Storage default display mode, and current browsing is being opened next timeIt is shown when the device page using default display mode.
Further, preset layout type and include at least following one: the center amplification based on the current browser page is aobviousShow destination display area;Other display areas in multiple display areas in addition to destination display area are carried out blurring to showProcessing.
According to another aspect of an embodiment of the present invention, a kind of display device of browser page is additionally provided, the device packetInclude: the current browser page is divided into multiple display areas for parsing the current browser page by division unit;It receives singleMember chooses the instruction of destination display area for receiving user in multiple display areas;Display unit, in response to choosingInstruction according to default layout type displaying target display area, and removes destination display area in multiple display areas out of serviceExcept other display areas.
Further, division unit includes: acquisition module, for obtaining the web page address of the current browser page;LoadModule, for loading the corresponding web page files of web page address according to predefined rule;Parsing module is used for analyzing web page file,Obtain page documents data model;Division module, for by page documents data model be divided into respectively with multiple display areasOne-to-one multiple script modules.
Further, receiving unit includes: the first display module, is used for according to page documents data model in a browserShow the current browser page;Adding module, for adding command reception module in each display area, wherein instruction connectsReceive the instruction that module is used to receive user;Receiving module is chosen for the command reception module reception by each display areaInstruction.
Further, display unit includes: modified module, is used for multiple display areas in page documents data modelIn the corresponding script module in other display areas in addition to destination display area display properties be revised as it is invisible;Second is aobviousShow module, for showing modified page documents data model.
Further, the device further include: backup units, in showing the corresponding script module in other display areasBefore showing that attribute modification is invisible, simultaneously memory page document data model is replicated, backup page document data model is obtained,In, display unit is also used to after receiving user's cancellation and choosing the instruction of destination display area, obtains backup page documentsData model is simultaneously shown.
Further, device further include: determination unit chooses target aobvious for receiving user in multiple display areasAfter showing the instruction in region, default display mode is determined according to the user's choice;Execution unit, for storing default display sideFormula, and shown when opening the current browser page next time using default display mode.
Further, preset layout type and include at least following one: the center amplification based on the current browser page is aobviousShow destination display area;Other display areas in multiple display areas in addition to destination display area are carried out blurring to showProcessing.
According to another aspect of an embodiment of the present invention, a kind of storage medium is additionally provided, which includes storageProgram, wherein equipment where program controls storage medium at runtime executes the display methods of browser page of the invention.
According to another aspect of an embodiment of the present invention, a kind of processor is additionally provided, which is used to run program,In, program executes the display methods of browser page of the invention when running.
In embodiments of the present invention, by parsing the current browser page, the current browser page is divided into multiple aobviousShow region;Receive the instruction that user chooses destination display area in multiple display areas;In response to choosing instruction, according to defaultLayout type displaying target display area, and other displays in multiple display areas out of service in addition to destination display areaRegion solves the technical issues of excessive occupied system resources when showing browser page in the related technology, and then realizes energyEnough technical effects for reducing the system resource occupied when showing browser page.
Specific embodiment
In order to enable those skilled in the art to better understand the solution of the present invention, below in conjunction in the embodiment of the present inventionAttached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is onlyThe embodiment of a part of the invention, instead of all the embodiments.Based on the embodiments of the present invention, ordinary skill peopleThe model that the present invention protects all should belong in member's every other embodiment obtained without making creative workIt encloses.
It should be noted that description and claims of this specification and term " first " in above-mentioned attached drawing, "Two " etc. be to be used to distinguish similar objects, without being used to describe a particular order or precedence order.It should be understood that using in this wayData be interchangeable under appropriate circumstances, so as to the embodiment of the present invention described herein can in addition to illustrating herein orSequence other than those of description is implemented.In addition, term " includes " and " having " and their any deformation, it is intended that coverCover it is non-exclusive include, for example, the process, method, system, product or equipment for containing a series of steps or units are not necessarily limited toStep or unit those of is clearly listed, but may include be not clearly listed or for these process, methods, productOr other step or units that equipment is intrinsic.
This application provides a kind of embodiments of the display methods of browser page.
Fig. 1 is a kind of flow chart of the display methods of optional browser page according to an embodiment of the present invention, such as Fig. 1 instituteShow, this method comprises the following steps:
Step S101 parses the current browser page, the current browser page is divided into multiple display areas:
The parsing current browser page includes the web page address for obtaining the current browser page, according to predefined rule (exampleSuch as, Html language predefined rule) the corresponding web page files of web page address are loaded, analyzing web page file obtains page documents numberAccording to model.
The current browser page can be divided into different display portions (region) automatically by browser, for example, Fig. 2 is one kindThe area dividing schematic diagram of optional browser page, as shown in Fig. 2, the current browser page has been divided into A, B, C, D, E fiveDisplay area, by taking certain blog page as an example, a-quadrant shows that the personal information of blog master, B area show search column, and the region C is shownThe classified catalogue of all articles of blog master, the region D are the setting background of the blog, and the region E is current blog articlesContent etc..
When the current browser page is divided into multiple display areas, page documents data model can be divided into pointMultiple script modules, each display area be not corresponding with a script module correspondingly with multiple display areas.
Step S102 receives the instruction that user chooses destination display area in multiple display areas:
Optionally, which can be realized by adding command reception module in each display area.Specifically, connecingReceiving user and choosing the instruction of destination display area in multiple display areas includes: to draw page according to page documents data modelFace shows the current browser page in a browser, adds command reception module in each display area, wherein instruction connectsThe instruction that module is used to receive user is received, instruction is chosen by the command reception module reception of each display area.
Alternatively, the step can also be realized by way of shortcut key, for example, by Macintosh choose one of them or it is moreA display area is destination display area.It should be noted that destination display area can be one in multiple display areasOr several display areas, user, which can choose, needs region to be shown, and in selection region, to the content in region, there is no limit noIt is limited to text, code segment, picture etc., meanwhile, current browser page is being shown according to page documents data model in a browserAfter face, the scripted code of timing automatic running can be stopped, for example, timer class script, to stop the automatic of page scriptOperation, reduces the resource occupation of browser, waits the instruction of user.
Step S103, in response to choosing instruction, according to default layout type displaying target display area, and it is out of service moreOther display areas in a display area in addition to destination display area.
Receive user choose instruction after, default layout type is obtained, according to default layout type displaying targetDisplay area, for example, browser page shown in Fig. 2 receive user choose the display area E choose instruction after, according to figureLayout type shown in 3 is shown: the display area E shows that other display areas hide, is invisible.For the system for reducing occupancyResource, the script of other display areas in multiple display areas out of service in addition to destination display area.Receiving useFamily choose instruction after, the selection of user can also be recorded, determine default display mode according to the user's choice, and store silentRecognize display mode, is shown when opening the current browser page next time using default display mode.Wherein, current clear in preservationLook at the device page default display mode when, the last setting of user can be covered into previously stored setting, that is, most with userSubject to operation afterwards, specifically, browser can provide config option, user can determine whether browser remembers user coupleThe selection of display module, if selection is, browser determines the page according to the operation that user's last time accesses the pageDefault display mode and automatically save, when user accesses the same page again by browser, browser is according to going throughHistory data provide the module displaying scheme of default and show the page according to default displaying scheme.Optionally, user can also selectSelect the configuration selection for closing default displaying scheme.
Specifically, when according to default layout type displaying target display area, it can be in page documents data modelThe display properties of the corresponding script module in other display areas in multiple display areas in addition to destination display area is modifiedBe it is invisible, show modified page documents data model.By the display category of the corresponding script module in other display areasProperty be revised as it is invisible before, can replicate and memory page document data model, obtain backup page document data model,Receive user cancel choose the instruction of destination display area after, obtain backup page document data model simultaneously show.
Default layout type may include hiding other display areas, for example, showing target is removed in multiple display areasOther display areas except region carry out blurring display processing;It also may include highlighting the target viewing area chosenDestination display area is shown and is being shown for example, displaying target display area is amplified at the center based on the current browser page by domainThe significant position of equipment, size account for most or all of entire display interface.
The current browser page is divided into multiple display areas by the parsing current browser page by the embodiment;It connectsReceive the instruction that user chooses destination display area in multiple display areas;In response to choosing instruction, according to default layout typeDisplaying target display area, and other display areas in multiple display areas out of service in addition to destination display area, solutionThe technical issues of excessive occupied system resources when showing browser page in the related technology of having determined, so realize can reduce it is aobviousThe technical effect of the system resource occupied when showing browser page.
The process for illustrating a kind of display methods of optional browser page below with reference to Fig. 4, comprises the following steps that
(1) network address is received.
(2) DOM Document Object Model is constructed.
(3) page display area divides:
Browser obtains page dom tree construction after parsing to the page, obtain the different display portions of the page.
(4) receiving module is added in each region:
According to a conventional method to by full page render come on the basis of, various pieces be added one receive user instructionModule, for example, module can be a button.Optionally, it selects to be cooperated with Macintosh when display module and realizeChoose multiple modules.
(5) it receives user instructions.
(6) it highlights:
When module receives operational order, display unit corresponding to the module for receiving operational order is highlightedPoint, when module receives operational order again, cancellation is highlighted.Therefore, it after receiving user instruction, needsWhether judgement is currently to need to highlight respective modules.
(7) display modification model and script out of service:
After judging whether to need to highlight, if it is judged that needing to highlight, then the mould chosen is highlightedBlock.Specifically highlighted page layout mode can be preset, alternatively, being the layout according to pervious setting default.For example, original display effect can be kept constant the module chosen, other modules in the page all become down state simultaneouslyFuzzy processing is carried out, specific operating method can be when having module to receive instruction, replicate a browserDocument data model (dom tree), the document data model after modification duplication, will not receive the display of the module of instructionAttribute modification is invisible mode, and the module display position for receiving instruction is placed in the middle, and display area is not less than browser clients area75 the percent of area uses a particular color (such as grey) as background, uses modified document data modelIt carries out the page to show, document data model originally, which retains, to be used to restPose.Meanwhile it can other modules out of serviceIn instruction reduce system resource and occupy for example, all timer class scripts.
(8) page restores normal
After judging whether to need to highlight, if it is judged that not needing to highlight, then full page is restored toNormal condition.Specifically, taking out backup after the receiving module in any one highlighted region receives instruction againDocument data model is shown, the document data model modified is abandoned.Restore script to operate normally, the page is restored to normallyState.
Fig. 5 is another optional embodiment, as shown in figure 5, firstly, to the display module in the client area of browserQuantity statistics are carried out, determine the quantity of display module, if quantity is greater than 9, preceding 9 display modules maximum to display areaSelection display function (that is, addition command reception module) is provided, if quantity less than 9, judge quantity whether less than 3, ifThe quantity of display module is than or equal to 3, then selection display function is provided to each display module, if the number of display moduleAmount then judges whether each display module has submodule less than 3 respectively, if it is not, providing selection to each display moduleDisplay function, if so, the sub- display module of all next stage to be then added to the set of display module, and display module againJudge whether quantity is greater than 9.
The display methods for the browser page that the embodiment provides makes during display of the browser to web page contentsObtaining user can choose a region content for only display concern, and timer-type script out of service is reducing browser display pageUser experience is improved while the system resource that face occupies.
It should be noted that attached drawing flow chart though it is shown that logical order, but in some cases, can be withShown or described step is executed different from sequence herein.
Present invention also provides a kind of embodiment of storage medium, the storage medium of the embodiment includes the program of storage,Wherein, equipment executes the display methods of the browser page of the embodiment of the present invention where controlling storage medium when program is run.
Present invention also provides a kind of embodiment of processor, the processor of the embodiment is for running program, wherein journeyThe display methods of the browser page of the embodiment of the present invention is executed when sort run.
Present invention also provides a kind of embodiments of the display device of browser page.
Fig. 6 is a kind of schematic diagram of the display device of optional browser page according to an embodiment of the present invention, such as Fig. 6 instituteShow, which includes division unit 10, receiving unit 20 and display unit 30.
Wherein, the current browser page is divided into multiple viewing areas for parsing the current browser page by division unitDomain;Receiving unit is for receiving the instruction that user chooses destination display area in multiple display areas;Display unit is for ringingYing Yu chooses instruction, according to default layout type displaying target display area, and target is removed in multiple display areas out of serviceOther display areas except display area.
The current browser page is divided into more by division unit for parsing the current browser page by the embodimentA display area;Receiving unit chooses the instruction of destination display area for receiving user in multiple display areas;Display is singleMember, in response to choosing instruction, according to default layout type displaying target display area, and multiple display areas out of serviceIn other display areas in addition to destination display area, solve and occupy system money when showing browser page in the related technologyThe excessive technical problem in source, and then realize the technical effect of the system resource occupied when can reduce display browser page.
Further, division unit includes: acquisition module, for obtaining the web page address of the current browser page;LoadModule, for loading the corresponding web page files of web page address according to predefined rule;Parsing module is used for analyzing web page file,Obtain page documents data model;Division module, for by page documents data model be divided into respectively with multiple display areasOne-to-one multiple script modules.
Further, receiving unit includes: the first display module, is used for according to page documents data model in a browserShow the current browser page;Adding module, for adding command reception module in each display area, wherein instruction connectsReceive the instruction that module is used to receive user;Receiving module is chosen for the command reception module reception by each display areaInstruction.
Further, display unit includes: modified module, is used for multiple display areas in page documents data modelIn the corresponding script module in other display areas in addition to destination display area display properties be revised as it is invisible;Second is aobviousShow module, for showing modified page documents data model.
Further, the device further include: backup units, in showing the corresponding script module in other display areasBefore showing that attribute modification is invisible, simultaneously memory page document data model is replicated, backup page document data model is obtained,In, display unit is also used to after receiving user's cancellation and choosing the instruction of destination display area, obtains backup page documentsData model is simultaneously shown.
Further, device further include: determination unit chooses target aobvious for receiving user in multiple display areasAfter showing the instruction in region, default display mode is determined according to the user's choice;Execution unit, for storing default display sideFormula, and shown when opening the current browser page next time using default display mode.
Further, preset layout type and include at least following one: the center amplification based on the current browser page is aobviousShow destination display area;Other display areas in multiple display areas in addition to destination display area are carried out blurring to showProcessing.
Above-mentioned device may include processor and memory, and said units can be used as program unit and be stored in storageIn device, above procedure unit stored in memory is executed by processor to realize corresponding function.
Memory may include the non-volatile memory in computer-readable medium, random access memory (RAM) and/Or the forms such as Nonvolatile memory, such as read-only memory (ROM) or flash memory (flashRAM), memory includes at least one storageChip.
The sequence of above-mentioned the embodiment of the present application does not represent the advantages or disadvantages of the embodiments.
In above-described embodiment of the application, all emphasizes particularly on different fields to the description of each embodiment, do not have in some embodimentThe part of detailed description, reference can be made to the related descriptions of other embodiments.In several embodiments provided herein, it should be appreciated thatIt arrives, disclosed technology contents can be realized in other ways.
Wherein, the apparatus embodiments described above are merely exemplary, such as the division of the unit, can be oneKind of logical function partition, there may be another division manner in actual implementation, for example, multiple units or components can combine orIt is desirably integrated into another system, or some features can be ignored or not executed.Another point, it is shown or discussed it is mutual itBetween coupling, direct-coupling or communication connection can be through some interfaces, the INDIRECT COUPLING or communication link of unit or moduleIt connects, can be electrical or other forms.
It, can also be in addition, each functional unit in each embodiment of the application can integrate in one processing unitIt is that each unit physically exists alone, can also be integrated in one unit with two or more units.Above-mentioned integrated listMember both can take the form of hardware realization, can also realize in the form of software functional units.
If the integrated unit is realized in the form of SFU software functional unit and sells or use as independent productWhen, it can store in a computer readable storage medium.Based on this understanding, the technical solution of the application is substantiallyThe all or part of the part that contributes to existing technology or the technical solution can be in the form of software products in other wordsIt embodies, which is stored in a storage medium, including some instructions are used so that a computerEquipment (can for personal computer, server or network equipment etc.) execute each embodiment the method for the application whole orPart steps.And storage medium above-mentioned includes: that USB flash disk, read-only memory (ROM, Read-Only Memory), arbitrary access are depositedReservoir (RAM, Random Access Memory), mobile hard disk, magnetic or disk etc. be various to can store program codeMedium.
The above is only the preferred embodiment of the application, it is noted that for the ordinary skill people of the artFor member, under the premise of not departing from the application principle, several improvements and modifications can also be made, these improvements and modifications are also answeredIt is considered as the protection scope of the application.