CN103810193A - Webpage element shielding method and device - Google Patents

Webpage element shielding method and device Download PDF

Info

Publication number
CN103810193A
CN103810193A CN201210446096.5A CN201210446096A CN103810193A CN 103810193 A CN103810193 A CN 103810193A CN 201210446096 A CN201210446096 A CN 201210446096A CN 103810193 A CN103810193 A CN 103810193A
Authority
CN
China
Prior art keywords
resource
file
type
request
resource file
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN201210446096.5A
Other languages
Chinese (zh)
Inventor
杨振辉
丁川达
张天毅
徐鸣
张志和
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Beijing Kingsoft Internet Security Software Co Ltd
Conew Network Technology Beijing Co Ltd
Shell Internet Beijing Security Technology Co Ltd
Beijing Kingsoft Internet Science and Technology Co Ltd
Original Assignee
Beijing Kingsoft Internet Security Software Co Ltd
Conew Network Technology Beijing Co Ltd
Shell Internet Beijing Security Technology Co Ltd
Beijing Kingsoft Internet Science and Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Kingsoft Internet Security Software Co Ltd, Conew Network Technology Beijing Co Ltd, Shell Internet Beijing Security Technology Co Ltd, Beijing Kingsoft Internet Science and Technology Co Ltd filed Critical Beijing Kingsoft Internet Security Software Co Ltd
Priority to CN201210446096.5A priority Critical patent/CN103810193A/en
Publication of CN103810193A publication Critical patent/CN103810193A/en
Pending legal-status Critical Current

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/957Browsing optimisation, e.g. caching or content distillation
    • G06F16/9574Browsing optimisation, e.g. caching or content distillation of access to content, e.g. by caching

Abstract

The invention discloses a webpage element shielding method and device. The webpage element shielding method comprises the following steps: acquiring a resource request; acquiring a first resource request in the resource requests, wherein a resource file corresponding to the first resource request is a shielded resource; loading a resource file corresponding to the resource request and shielding a first resource file, wherein the first resource file is the resource file corresponding to the first resource request; and outputting the loaded resource file to generate a webpage. The method and the device solve the problem that the webpage loading speed is easily reduced by a webpage element shielding method in the prior art, and further achieve the effect of improving the webpage loading speed.

Description

Web page element screen method and device
Technical field
The present invention relates to data processing field, in particular to a kind of web page element screen method and device.
Background technology
User, in the time of browsing page, can run into the content that some are not infered mostly, as other harmful information (as harmful script, illegal picture etc.) of web advertisement, floating animation and some.The advertising filtering function of existing browser, the simple URL(uniform resource locator) to web page resources of general only meeting, be also referred to as web page address (Uniform/Universal Resource Locator is called for short URL) and shield, or do not load after resource downloading.But in actual applications, adopt the scheme of web page address shielding that whole webpage all cannot be shown, directly cause non-harmful information conductively-closed, although adopt the scheme not loading after resource downloading to solve the drawback of non-harmful information conductively-closed, but in actual applications, when the scheme not loading after resource downloading is processed web page resources, often by resource downloading is hidden to realize web page element shielding behind this locality again, this kind of method not only taken network traffics, cause loading velocity to reduce, need to carry out but also exist the risk that the viewed device mistake of hiding resource loads, cannot reach web page element shielding.In addition, according to screen method of the prior art, after web page resources is blocked, image placeholder or web page frame etc. still exist, and this just makes the page after treatment become incoherent, very not attractive in appearance.
The problem that easily causes webpage loading velocity to reduce for the screen method of web page element in correlation technique, not yet proposes effective solution at present.
Summary of the invention
Fundamental purpose of the present invention is to provide a kind of web page element screen method and device, the problem that easily causes webpage loading velocity to reduce to solve the screen method of web page element in prior art.
To achieve these goals, according to an aspect of the present invention, provide a kind of web page element screen method, having comprised: Gains resources request; First resource request in Gains resources request, wherein, resource file corresponding to first resource request is shielding resource; Load resource file corresponding to resource request and first resource file is shielded, wherein, first resource file is resource file corresponding to first resource request; And output load after resource file with generating web page.
Further, first resource file is shielded and comprised: the type of obtaining first resource file; The type that judgement gets is the first preset kind or the second preset kind, wherein, the resource file that the first preset kind represents is non-visible resource file in web displaying, and the resource file that the second preset kind represents is visible resource file in web displaying; The type getting if judge is the first preset kind, and to first resource, request is tackled; And if to judge the type getting be the second preset kind, obtain the placeholder of first resource file, and replace first resource file with the first default resource file, wherein, the placeholder of the first default resource file is identical with the placeholder getting.
Further, first resource request comprises the request of first resource and the request of Secondary resource, resource file corresponding to first resource request is first resource son file, resource file corresponding to Secondary resource request is Secondary resource son file, first resource file shielded and comprised: the type of obtaining respectively first resource son file and Secondary resource son file; The type of the first resource son file that judgement gets is the first preset kind or the second preset kind, wherein, the resource file that the first preset kind represents is non-visible resource file in web displaying, and the resource file that the second preset kind represents is visible resource file in web displaying; The type of the Secondary resource son file that judgement gets is the first preset kind or the second preset kind; The first preset kind if judge the type of first resource son file, and the type of Secondary resource son file is the second preset kind, to first resource, request is tackled, and after being obtained, the placeholder of Secondary resource son file replaces Secondary resource son file with the second default resource file, wherein, the placeholder of the second default resource file is identical with the placeholder of Secondary resource son file; And if the type of judging Secondary resource son file is the first preset kind, and the type of first resource son file is the second preset kind, to Secondary resource, request is tackled, and after being obtained, the placeholder of first resource son file replaces first resource son file with the 3rd default resource file, wherein, the placeholder of the 3rd default resource file is identical with the placeholder of first resource son file.
Further, the type of obtaining first resource file comprises: obtain the kernel type that produces first resource request; The kernel type that judgement gets is Trident kernel or Webkit kernel; The kernel type getting if judge is Trident kernel, obtains the address information of first resource request and according to the type of address acquisition of information first resource file; And if to judge the kernel type getting be Webkit kernel, directly obtain the type of first resource file.
Further, comprise according to the type of address acquisition of information first resource file: the extension name information of obtaining address information; And extension name information is classified to obtain the type of first resource file.
To achieve these goals, according to a further aspect in the invention, provide a kind of web page element shield assembly, this web page element shield assembly is for carrying out any one web page element screen method that the invention described above provides.
To achieve these goals, according to a further aspect in the invention, provide a kind of web page element shield assembly, having comprised: the first acquiring unit, for Gains resources request; Second acquisition unit, for the first resource request of Gains resources request, wherein, resource file corresponding to first resource request is shielding resource; Processing unit, for loading resource file corresponding to resource request and first resource file being shielded, wherein, first resource file is resource file corresponding to first resource request; And output unit, for exporting resource file after loading with generating web page.
Further, processing unit comprises: obtain subelement, for obtaining the type of first resource file; Judgment sub-unit, for judging that the type getting is the first preset kind or the second preset kind, wherein, the resource file that the first preset kind represents is non-visible resource file in web displaying, and the resource file that the second preset kind represents is visible resource file in web displaying; Interception subelement, while being the first preset kind for judge the type getting in judgment sub-unit, to first resource, request is tackled; And replacement subelement, while being the second preset kind for judging in judgment sub-unit the type getting, obtain the placeholder of first resource file, and replace first resource file with the first default resource file, wherein, the placeholder of the first default resource file is identical with the placeholder getting.
Further, first resource request comprises the request of first resource and the request of Secondary resource, resource file corresponding to first resource request is first resource son file, resource file corresponding to Secondary resource request is Secondary resource son file, processing unit comprises: obtain subelement, for obtaining respectively the type of first resource son file and Secondary resource son file; The first judgment sub-unit, for judging that the type of the first resource son file getting is the first preset kind or the second preset kind, wherein, the resource file that the first preset kind represents is non-visible resource file in web displaying, and the resource file that the second preset kind represents is visible resource file in web displaying; The second judgment sub-unit, for judging that the type of the Secondary resource son file getting is the first preset kind or the second preset kind; First processes subelement, the first preset kind for the type of judging first resource son file in the first judgment sub-unit, and when the type that the second judgment sub-unit is judged Secondary resource son file is the second preset kind, to first resource, request is tackled, and after being obtained, the placeholder of Secondary resource son file replaces Secondary resource son file with the second default resource file, wherein, the placeholder of the second default resource file is identical with the placeholder of Secondary resource son file; And second process subelement, the first preset kind for the type of judging Secondary resource son file in the second judgment sub-unit, and when the type that the first judgment sub-unit is judged first resource son file is the second preset kind, to Secondary resource, request is tackled, and after being obtained, the placeholder of first resource son file replaces first resource son file with the 3rd default resource file, wherein, the placeholder of the 3rd default resource file is identical with the placeholder of first resource son file.
Further, obtain subelement and comprise: the first acquisition module, for obtaining the kernel type that produces first resource request; Judge module, for judging that the kernel type getting is Trident kernel or Webkit kernel; The second acquisition module, while being Trident kernel, obtains the address information of first resource request and according to the type of address acquisition of information first resource file for judge the kernel type getting at judge module; And the 3rd acquisition module, while being Webkit kernel for judge the kernel type getting at judge module, directly obtain the type of first resource file.
Further, the second acquisition module comprises: obtain submodule, for obtaining the extension name information of address information; And classification submodule, for extension name information being classified to obtain the type of first resource file.
By the present invention, adopt Gains resources request; First resource request in Gains resources request, wherein, resource file corresponding to first resource request is shielding resource; Load resource file corresponding to resource request and first resource file is shielded, wherein, first resource file is resource file corresponding to first resource request; And output load after resource file with generating web page.By resource request being processed before the corresponding resource file of resource request is loaded, to determine the corresponding resource request of resource that needs shielding, and then mask the resource file that needs shielding in loading resource file, realize before loading resource and resource request having been processed, to avoid any unnecessary resource of browser downloads, solve the problem that in prior art, the screen method of web page element easily causes webpage loading velocity to reduce, and then reached the effect that improves webpage loading velocity.
Accompanying drawing explanation
The accompanying drawing that forms the application's a part is used to provide a further understanding of the present invention, and schematic description and description of the present invention is used for explaining the present invention, does not form inappropriate limitation of the present invention.In the accompanying drawings:
Fig. 1 is according to the process flow diagram of the web page element screen method of the embodiment of the present invention;
Fig. 2 carries out the definite process flow diagram of resource type according to the screen method of the embodiment of the present invention;
Fig. 3 is the process flow diagram dissimilar resource file being shielded according to the screen method of the embodiment of the present invention;
Fig. 4 carries out web page element according to the screen method of the embodiment of the present invention to load the process flow diagram of exporting; And
Fig. 5 is according to the schematic diagram of the web page element shield assembly of the embodiment of the present invention.
Embodiment
It should be noted that, in the situation that not conflicting, the feature in embodiment and embodiment in the application can combine mutually.Describe below with reference to the accompanying drawings and in conjunction with the embodiments the present invention in detail.
The embodiment of the present invention provides a kind of web page element screen method, below web page element screen method that the embodiment of the present invention is provided be specifically introduced:
Fig. 1 is the process flow diagram of the web page element screen method that provides according to the embodiment of the present invention, and as shown in Figure 1, the web page element screen method of this embodiment comprises the steps that S102 is to step S108:
S102: Gains resources request, particularly, in the time that user opens webpage by browser, first browser can produce resource request, afterwards again by resource request being responded to obtain the resource file corresponding with resource request.
S104: the first resource request in Gains resources request, wherein, resource file corresponding to first resource request is shielding resource, particularly, both can carry out according to actual needs self-defined setting to obtaining of first resource request, also can adopt the method for any one screening resource request in prior art, finally reach the resource request that filters out the resource file that needs shielding, the resource request of the resource file to needs shielding adopts " first resource request " such descriptive language herein, just for the resource request of the resource file of needs shielding and the resource request of the resource file that does not need shielding are distinguished, not that the order of resource request is limited.
S106: load resource file corresponding to resource request and first resource file is shielded, wherein, first resource file is resource file corresponding to first resource request,, after step S104 completes the processing of resource request, then carry out the loading of related resource file.
S108: the resource file after output loads is with generating web page, particularly, browser after first resource file is shielded, export load after resource file to browser front end, wherein, so-called resource file refers to the file that comprises and show needs loading in webpage, after the viewed device of resource file loads and shows in webpage, just be called web page element, , resource file and web page element are the address at different times to the identical object of same essence, this object is called resource file before viewed device loads, after loading, viewed device is called web page element.
The web page element screen method that the embodiment of the present invention provides by processing resource request before the corresponding resource file of resource request is loaded, to determine the corresponding resource request of resource that needs shielding, and then mask the resource file that needs shielding in loading resource file, realize before loading resource and resource request having been processed, to avoid any unnecessary resource of browser downloads, solve the problem that in prior art, the screen method of web page element easily causes webpage loading velocity to reduce, and then reach the effect that improves webpage loading velocity.
Further, in step S106, in the time that first resource file is shielded, for dissimilar resource file, concrete screen method is not identical, particularly, can realize in the following manner the shielding to first resource file:
First, type to first resource file is obtained, particularly, in the time that user passes through the browser Web page loading of different kernels, can produce resource request by the kernel of browser, and for the acquisition methods difference of the resource file type of the corresponding resource request of different kernel browsers, now, can first obtain and judge that the kernel type of generation resource request is Webkit kernel or Trident kernel producing the kernel type of resource request, so-called Trident kernel is exactly the kernel that IE browser uses, also be the kernel that a lot of browsers use, be commonly called IE kernel.The common browser of Trident kernel has: IE6, IE7, IE8(Trident 4.0), IE9(Trident 5.0), IE10(Trident 6.0); Window on the World, 360 secure browsers, proud trip; Search dog browser; The TT of Tengxun; A Yun browser (earlier version), Baidu's browser (earlier version), Rising's secure browser etc.; So-called WebKit kernel is a browser engine of increasing income, it is burning the hotest current browser kernel, the browser of common WebKit kernel has: Apple Safari (Win/Mac/iPhone/iPad), Symbian mobile phone browser, Android default browser, cheetah browser is a double-core browser that simultaneously possesses Trident kernel and WebKit kernel.It is the situation of Webkit kernel for browser kernel, when browser produces resource request by Webkit kernel loads webpage, can make modification at encapsulated layer, it is adjusted back to processing function by the function such as ResourceDispatcherHostImpl::OnRequestResource, ResourceDispatcherHostImpl::BeginRequest in the time of request resource, due to Webkit kernel in inner predefine ResourceType, so resource type corresponding to the resource request producing for Webkit kernel browser can directly acquire, and be the situation of Trident kernel for browser kernel, obtaining of resource type corresponding to resource request that this browser kernel is produced, can be by program registration " the asynchronous agreement of inserting " (Asynchronous Pluggable Protocol), make all resources of this kernel requests via COInetProt::StartEx, the functions such as CInternetProtocolFilter::Start are adjusted back to program, obtain the address information of all resource request with this, and (comprise image resource by the type that obtains resource file of classifying of the extension name information to this address information, web page resources, style sheet resource, script resource and embedded object resource etc.), wherein, for the resource type of Webkit kernel browser and Trident resource request that kernel browser generates to obtain flow process shown in Figure 2.
Secondly, the type of the first resource file getting and two default types are contrasted to determine to specifically which type of type of first resource file, these two default types are the first preset kind and the second preset kind, wherein, the resource file that the first preset kind represents is sightless resource file while demonstration in webpage, is visible resource file when the resource file that the second preset kind represents shows in webpage;
Finally, according to above-mentioned comparing result, first resource file is specifically processed, wherein, identical with the first preset kind if the type of first resource file is determined in contrast, directly to first resource, request is tackled; If it is identical with the second preset kind that the type of first resource file is determined in contrast, now the placeholder of first resource file corresponding to first resource request is obtained, then from presetting database, call a default resource file and replace first resource file, the satisfied condition of default resource file of calling is that the placeholder of this default resource file calling is identical with the placeholder of first resource file.
It should be noted that, in the time that first resource file comprises multiple resource son file, adopt equally aforesaid way to contrast the type of each son file, then the resource request of resource son file identical with the first preset kind type is tackled, adopt the default file of identical placeholder to replace resource son file identical with the second preset kind type.The flow process of wherein, the shielding to first resource file (interception and/or replacement) is shown in Figure 3.Resource file for interception and/or after replacing (, need the resource file of shielding) when the output of resource file after step S108 loads, shield the output of resource according to the flow process shown in Fig. 4, particularly, as shown in Figure 4, when resource file after loading is exported, can generate the CSS (cascading style sheet) attribute selector switch (CSS Selector) of the resource file attribute after corresponding interception and/or replacement, and by the element setting { display:none! choosing Important; Hide attribute, and generating complete style rule, this section of style rule will dynamically be spliced to JavaScript code, to inject webpage HTML code head, when the page complete load time, JavaScript code can be automatically performed, complete interception and/or replace web page element hide.
By the type of need shielding resource file is contrasted, accurately to determine the visible resource file and the non-visible resource file that need in shielding resource file, and then adopt different processing means to process for dissimilar resource file, by the resource request of the resource file of non-visible type in need shielding resource file is tackled, avoid downloading any unnecessary resource, and then reached and avoid taking the drawback that loading velocity that network traffics cause reduces; By the resource file of visible type in need shielding resource file is replaced with the default resource file of identical placeholder, avoid resource file to be blocked rear blank demonstration of webpage of causing because of image placeholder or web page frame conductively-closed, and then reached lifting webpage aesthetics.
The embodiment of the present invention also provides a kind of web page element shield assembly, the web page element screen method that this web page element shield assembly can provide in order to carry out embodiment of the present invention foregoing, below web page element shield assembly that the embodiment of the present invention is provided be specifically introduced:
Fig. 5 is according to the schematic diagram of the web page element shield assembly of the embodiment of the present invention, and as shown in Figure 5, the web page element shield assembly of this embodiment comprises the first acquiring unit 10, second acquisition unit 20, processing unit 30 and output unit 40.
Particularly, the first acquiring unit 10 is for obtaining the resource request of sending from browser kernel;
Second acquisition unit 20 is for the first resource request of Gains resources request, wherein, resource file corresponding to first resource request is shielding resource, particularly, second acquisition unit 20 can be a unit that resource request is screened to judgement, its specific implementation principle both can have been carried out self-defined setting according to actual needs, can be also the unit of any one screening resource request method in application prior art, finally reached the resource request that filters out the resource file that needs shielding.
Processing unit 30 is for loading resource file corresponding to resource request and first resource file being shielded, wherein, first resource file is resource file corresponding to first resource request,, processing unit 30 carries out the loading of related resource file after second acquisition unit 20 completes the processing of resource request again.
Output unit 40 is for exporting resource file after loading with generating web page, particularly, browser after first resource file is shielded, export load after resource file to browser front end, wherein, so-called resource file refers to the file that comprises and show needs loading in webpage, after the viewed device of resource file loads and shows in webpage, just be called web page element, , resource file and web page element are the address at different times to the identical object of same essence, this object is called resource file before viewed device loads, after loading, viewed device is called web page element.
The web page element shield assembly that the embodiment of the present invention provides by processing resource request before the corresponding resource file of resource request is loaded, to determine the corresponding resource request of resource that needs shielding, and then mask the resource file that needs shielding in loading resource file, realize before loading resource and resource request having been processed, to avoid any unnecessary resource of browser downloads, solve the problem that in prior art, the screen method of web page element easily causes webpage loading velocity to reduce, and then reach the effect that improves webpage loading velocity.
Further, processing unit 30 is in the time shielding first resource file, and for dissimilar resource file, concrete screen method is not identical, particularly, can realize the shielding to first resource file by following subelement:
First, by obtaining subelement, the type of first resource file is obtained, particularly, in the time that user passes through the browser Web page loading of different kernels, can produce resource request by the kernel of browser, and for the acquisition methods difference of the resource file type of the corresponding resource request of different kernel browsers, now, can first be obtained the kernel type that produces resource request by an acquisition module, then be Webkit kernel or Trident kernel by the kernel type of judge module judgement generation resource request, it is the situation of Webkit kernel for browser kernel, when browser produces resource request by Webkit kernel loads webpage, can make modification at encapsulated layer, make it in the time of request resource, pass through ResourceDispatcherHostImpl::OnRequestResource, the functions such as ResourceDispatcherHostImpl::BeginRequest are adjusted back to processing function, due to Webkit kernel in inner predefine ResourceType, so resource type corresponding to the resource request producing for Webkit kernel browser can directly be acquired by an acquisition module, and be the situation of Trident kernel for browser kernel, obtaining of resource type corresponding to resource request that this browser kernel is produced, can be by program registration " the asynchronous agreement of inserting " (Asynchronous Pluggable Protocol), make all resources of this kernel requests via COInetProt::StartEx, the functions such as CInternetProtocolFilter::Start are adjusted back to program, realize with this address information that is obtained all resource request by acquisition module, and (comprise image resource by the type that obtains resource file of classifying of the extension name information to this address information, web page resources, style sheet resource, script resource and embedded object resource etc.).
Secondly, by judgment sub-unit, the type of the first resource file getting and two default types are contrasted to specifically which type of type that judges to determine first resource file, these two default types are the first preset kind and the second preset kind, wherein, the resource file that the first preset kind represents is sightless resource file while demonstration in webpage, is visible resource file when the resource file that the second preset kind represents shows in webpage;
Finally, according to above-mentioned comparing result, first resource file is specifically processed, wherein, identical with the first preset kind if the type of first resource file is determined in contrast, by tackle subelement directly to first resource request tackle; If it is identical with the second preset kind that the type of first resource file is determined in contrast, now by replacing subelement, the placeholder of first resource file corresponding to first resource request is obtained, then from presetting database, call a default resource file and replace first resource file, the satisfied condition of default resource file of calling is that the placeholder of this default resource file calling is identical with the placeholder of first resource file.
It should be noted that, in the time that first resource file comprises multiple resource son file, adopt equally aforesaid way to the type of each son file obtain after and preset kind contrast, then the resource request of resource son file identical with the first preset kind type is tackled, adopt the default file of identical placeholder to replace resource son file identical with the second preset kind type.Resource file for interception and/or after replacing (, need the resource file of shielding) when the output of resource file after loading, can generate the CSS (cascading style sheet) attribute selector switch (CSS Selector) of the resource file attribute after corresponding interception and/or replacement, and by the element setting { display:none! choosing Important; Hide attribute, and generating complete style rule, this section of style rule will dynamically be spliced to JavaScript code, to inject webpage HTML code head, when the page complete load time, JavaScript code can be automatically performed, complete interception and/or replace web page element hide.
By the type of need shielding resource file is contrasted, accurately to determine the visible resource file and the non-visible resource file that need in shielding resource file, and then adopt different processing means to process for dissimilar resource file, by the resource request of the resource file of non-visible type in need shielding resource file is tackled, avoid downloading any unnecessary resource, and then reached and avoid taking the drawback that loading velocity that network traffics cause reduces; By the resource file of visible type in need shielding resource file is replaced with the default resource file of identical placeholder, avoid resource file to be blocked rear blank demonstration of webpage of causing because of image placeholder or web page frame conductively-closed, and then reached lifting webpage aesthetics.
From above description, can find out, the present invention has realized before browser kernel loads resource and has caught and ask and process, to avoid downloading any unnecessary resource, reach the effect that promotes loading velocity, simultaneously by according to conductively-closed element, the placeholder in webpage shields the replacement of element, avoid the blank mistake showing of webpage that causes because of element conductively-closed, reach the effect that promotes webpage aesthetics.
It should be noted that, can in the computer system such as one group of computer executable instructions, carry out in the step shown in the process flow diagram of accompanying drawing, and, although there is shown logical order in flow process, but in some cases, can carry out shown or described step with the order being different from herein.
Obviously, those skilled in the art should be understood that, above-mentioned of the present invention each module or each step can realize with general calculation element, they can concentrate on single calculation element, or be distributed on the network that multiple calculation elements form, alternatively, they can be realized with the executable program code of calculation element, thereby, they can be stored in memory storage and be carried out by calculation element, or they are made into respectively to each integrated circuit modules, or the multiple modules in them or step are made into single integrated circuit module to be realized.Like this, the present invention is not restricted to any specific hardware and software combination.
The foregoing is only the preferred embodiments of the present invention, be not limited to the present invention, for a person skilled in the art, the present invention can have various modifications and variations.Within the spirit and principles in the present invention all, any modification of doing, be equal to replacement, improvement etc., within all should being included in protection scope of the present invention.

Claims (10)

1. a web page element screen method, is characterized in that, comprising:
Gains resources request;
Obtain the first resource request in described resource request, wherein, resource file corresponding to described first resource request is shielding resource;
Load resource file corresponding to described resource request and first resource file is shielded, wherein, described first resource file is resource file corresponding to described first resource request; And
Resource file after output loads is with generating web page.
2. web page element screen method according to claim 1, is characterized in that, described first resource file is shielded and comprised:
Obtain the type of described first resource file;
The type that judgement gets is the first preset kind or the second preset kind, wherein, the resource file that described the first preset kind represents is non-visible resource file in web displaying, and the resource file that described the second preset kind represents is visible resource file in web displaying;
The type getting if judge is described the first preset kind, described first resource request is tackled; And
The type getting if judge is described the second preset kind, obtain the placeholder of described first resource file, and replace described first resource file with the first default resource file, wherein, the placeholder of the described first default resource file is identical with the placeholder getting.
3. web page element screen method according to claim 1, it is characterized in that, described first resource request comprises the request of first resource and the request of Secondary resource, resource file corresponding to described first resource request is first resource son file, resource file corresponding to described Secondary resource request is Secondary resource son file, and described first resource file is shielded and comprised:
Obtain respectively the type of described first resource son file and described Secondary resource son file;
The type of the described first resource son file that judgement gets is the first preset kind or the second preset kind, wherein, the resource file that described the first preset kind represents is non-visible resource file in web displaying, and the resource file that described the second preset kind represents is visible resource file in web displaying;
The type of the described Secondary resource son file that judgement gets is described the first preset kind or described the second preset kind;
Described the first preset kind if judge the type of described first resource son file, and the type of described Secondary resource son file is described the second preset kind, to described first resource, request is tackled, and after being obtained, the placeholder of described Secondary resource son file replaces described Secondary resource son file with the second default resource file, wherein, the placeholder of the described second default resource file is identical with the placeholder of described Secondary resource son file; And
Described the first preset kind if judge the type of described Secondary resource son file, and the type of described first resource son file is described the second preset kind, to described Secondary resource, request is tackled, and after being obtained, the placeholder of described first resource son file replaces described first resource son file with the 3rd default resource file, wherein, the placeholder of the described the 3rd default resource file is identical with the placeholder of described first resource son file.
4. web page element screen method according to claim 2, is characterized in that, the type of obtaining described first resource file comprises:
Obtain the kernel type that produces described first resource request;
The kernel type that judgement gets is Trident kernel or Webkit kernel;
The kernel type getting if judge is described Trident kernel, obtains the address information of described first resource request and obtains the type of described first resource file according to described address information; And
The kernel type getting if judge is described Webkit kernel, directly obtains the type of described first resource file.
5. web page element screen method according to claim 4, is characterized in that, the type of obtaining described first resource file according to described address information comprises:
Obtain the extension name information of described address information; And
Described extension name information is classified to obtain to the type of described first resource file.
6. a web page element shield assembly, is characterized in that, comprising:
The first acquiring unit, for Gains resources request;
Second acquisition unit, for obtaining the first resource request of described resource request, wherein, resource file corresponding to described first resource request is shielding resource;
Processing unit, for loading resource file corresponding to described resource request and first resource file being shielded, wherein, described first resource file is resource file corresponding to described first resource request; And
Output unit, for exporting resource file after loading with generating web page.
7. web page element shield assembly according to claim 6, is characterized in that, described processing unit comprises:
Obtain subelement, for obtaining the type of described first resource file;
Judgment sub-unit, for judging that the type getting is the first preset kind or the second preset kind, wherein, the resource file that described the first preset kind represents is non-visible resource file in web displaying, and the resource file that described the second preset kind represents is visible resource file in web displaying;
Interception subelement, while being described the first preset kind, tackles described first resource request for judging in described judgment sub-unit the type getting; And
Replace subelement, while being described the second preset kind for judging in described judgment sub-unit the type getting, obtain the placeholder of described first resource file, and replace described first resource file with the first default resource file, wherein, the placeholder of the described first default resource file is identical with the placeholder getting.
8. web page element shield assembly according to claim 6, it is characterized in that, described first resource request comprises the request of first resource and the request of Secondary resource, resource file corresponding to described first resource request is first resource son file, resource file corresponding to described Secondary resource request is Secondary resource son file, and described processing unit comprises:
Obtain subelement, for obtaining respectively the type of described first resource son file and described Secondary resource son file;
The first judgment sub-unit, for judging that the type of the described first resource son file getting is the first preset kind or the second preset kind, wherein, the resource file that described the first preset kind represents is non-visible resource file in web displaying, and the resource file that described the second preset kind represents is visible resource file in web displaying;
The second judgment sub-unit, for judging that the type of the described Secondary resource son file getting is described the first preset kind or described the second preset kind;
First processes subelement, described the first preset kind for the type of judging described first resource son file in described the first judgment sub-unit, and when the type that described the second judgment sub-unit is judged described Secondary resource son file is described the second preset kind, to described first resource, request is tackled, and after being obtained, the placeholder of described Secondary resource son file replaces described Secondary resource son file with the second default resource file, wherein, the placeholder of the described second default resource file is identical with the placeholder of described Secondary resource son file; And
Second processes subelement, described the first preset kind for the type of judging described Secondary resource son file in described the second judgment sub-unit, and when the type that described the first judgment sub-unit is judged described first resource son file is described the second preset kind, to described Secondary resource, request is tackled, and after being obtained, the placeholder of described first resource son file replaces described first resource son file with the 3rd default resource file, wherein, the placeholder of the described the 3rd default resource file is identical with the placeholder of described first resource son file.
9. web page element shield assembly according to claim 7, is characterized in that, described in obtain subelement and comprise:
The first acquisition module, for obtaining the kernel type that produces described first resource request;
Judge module, for judging that the kernel type getting is Trident kernel or Webkit kernel;
The second acquisition module, while being described Trident kernel, obtaining the address information of described first resource request and obtains the type of described first resource file according to described address information for judge the kernel type getting at described judge module; And
The 3rd acquisition module, while being described Webkit kernel, directly obtains the type of described first resource file for judge the kernel type getting at described judge module.
10. web page element shield assembly according to claim 9, is characterized in that, described the second acquisition module comprises:
Obtain submodule, for obtaining the extension name information of described address information; And
Classification submodule, for classifying to obtain the type of described first resource file to described extension name information.
CN201210446096.5A 2012-11-08 2012-11-08 Webpage element shielding method and device Pending CN103810193A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201210446096.5A CN103810193A (en) 2012-11-08 2012-11-08 Webpage element shielding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201210446096.5A CN103810193A (en) 2012-11-08 2012-11-08 Webpage element shielding method and device

Publications (1)

Publication Number Publication Date
CN103810193A true CN103810193A (en) 2014-05-21

Family

ID=50706976

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201210446096.5A Pending CN103810193A (en) 2012-11-08 2012-11-08 Webpage element shielding method and device

Country Status (1)

Country Link
CN (1) CN103810193A (en)

Cited By (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104133865A (en) * 2014-07-17 2014-11-05 可牛网络技术(北京)有限公司 Advertisement filtering method and device
CN104182505A (en) * 2014-08-19 2014-12-03 小米科技有限责任公司 Webpage rearrangement method and device
CN106028089A (en) * 2016-06-24 2016-10-12 武汉斗鱼网络科技有限公司 Method and device for shielding advertisement put on live video image
CN108153565A (en) * 2016-12-02 2018-06-12 阿里巴巴集团控股有限公司 The method and device of page info is provided
CN108647066A (en) * 2018-03-23 2018-10-12 深圳航天智慧城市系统技术研究院有限公司 The method that the pop-up html pages cover citymaker d engines in a browser
CN108683666A (en) * 2018-05-16 2018-10-19 新华三信息安全技术有限公司 A kind of web page identification method and device
US10521106B2 (en) 2017-06-27 2019-12-31 International Business Machines Corporation Smart element filtering method via gestures
CN111813468A (en) * 2015-04-03 2020-10-23 阿里巴巴集团控股有限公司 Method and device for shielding webpage operation and electronic equipment

Cited By (9)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104133865A (en) * 2014-07-17 2014-11-05 可牛网络技术(北京)有限公司 Advertisement filtering method and device
CN104182505A (en) * 2014-08-19 2014-12-03 小米科技有限责任公司 Webpage rearrangement method and device
CN111813468A (en) * 2015-04-03 2020-10-23 阿里巴巴集团控股有限公司 Method and device for shielding webpage operation and electronic equipment
CN106028089A (en) * 2016-06-24 2016-10-12 武汉斗鱼网络科技有限公司 Method and device for shielding advertisement put on live video image
CN108153565A (en) * 2016-12-02 2018-06-12 阿里巴巴集团控股有限公司 The method and device of page info is provided
US10521106B2 (en) 2017-06-27 2019-12-31 International Business Machines Corporation Smart element filtering method via gestures
US10956026B2 (en) 2017-06-27 2021-03-23 International Business Machines Corporation Smart element filtering method via gestures
CN108647066A (en) * 2018-03-23 2018-10-12 深圳航天智慧城市系统技术研究院有限公司 The method that the pop-up html pages cover citymaker d engines in a browser
CN108683666A (en) * 2018-05-16 2018-10-19 新华三信息安全技术有限公司 A kind of web page identification method and device

Similar Documents

Publication Publication Date Title
CN103810193A (en) Webpage element shielding method and device
US9684636B2 (en) Ad blocking page display method and device
CN109491744A (en) A kind of webpage capture system and method
US8527504B1 (en) Data network content filtering using categorized filtering parameters
CN107256232B (en) Information recommendation method and device
CN105095280B (en) Browser caching method and device
CN103873918B (en) Image processing method, device and terminal
US10542123B2 (en) System and method for generating and monitoring feedback of a published webpage as implemented on a remote client
US20140100963A1 (en) Method, System and Device For Filtering Mobile Terminal Webpage Advertisements
CN104360882B (en) Display methods and device are carried out to picture in webpage in a kind of browser
CN106021421B (en) method and device for accelerating webpage rendering
US20130212465A1 (en) Postponed rendering of select web page elements
WO2015143956A1 (en) Method and apparatus for blocking advertisement in web page
CN105786924B (en) Webpage night mode processing method and device and mobile terminal
CN105677654B (en) Advertisement filtering method and device
CN102436455A (en) Method and system for browsing characters as well as client browser
CN105205080B (en) Redundant file method for cleaning, device and system
CN107040584B (en) Method and device for downloading picture by client
CN104978358B (en) The method and intercepting page segment of desktop presentation web page fragments are to desktop presentation system
CN104035753A (en) Double-WebView customized page display method and system
CN106033450B (en) Advertisement blocking method and device and browser
EP3016012A1 (en) Method and device for marking terminal
CN104462283A (en) Method, device and client for requesting webpage elements in mobile terminal
CN104731815B (en) A kind of method for drafting and device of web page element
US11870808B1 (en) Mobile device security application for malicious website detection based on representative image

Legal Events

Date Code Title Description
C06 Publication
PB01 Publication
C10 Entry into substantive examination
SE01 Entry into force of request for substantive examination
RJ01 Rejection of invention patent application after publication
RJ01 Rejection of invention patent application after publication

Application publication date: 20140521