CN104008211A - Advertisement intercepting method and device - Google Patents

Advertisement intercepting method and device Download PDF

Info

Publication number
CN104008211A
CN104008211A CN201410283500.0A CN201410283500A CN104008211A CN 104008211 A CN104008211 A CN 104008211A CN 201410283500 A CN201410283500 A CN 201410283500A CN 104008211 A CN104008211 A CN 104008211A
Authority
CN
China
Prior art keywords
target web
url
blocking
file
resource
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
CN201410283500.0A
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.)
Conew Network Technology Beijing Co Ltd
Original Assignee
Conew Network Technology Beijing 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 Conew Network Technology Beijing Co Ltd filed Critical Conew Network Technology Beijing Co Ltd
Priority to CN201410283500.0A priority Critical patent/CN104008211A/en
Publication of CN104008211A publication Critical patent/CN104008211A/en
Pending legal-status Critical Current

Links

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

Landscapes

  • Engineering & Computer Science (AREA)
  • Databases & Information Systems (AREA)
  • Theoretical Computer Science (AREA)
  • Data Mining & Analysis (AREA)
  • Physics & Mathematics (AREA)
  • General Engineering & Computer Science (AREA)
  • General Physics & Mathematics (AREA)
  • Information Transfer Between Computers (AREA)

Abstract

The embodiment of the invention discloses an advertisement intercepting method. The method comprises the steps that a target webpage is requested to be accessed; a source code of the target webpage is obtained; in the process of analyzing the source code of the target webpage, if a URL is included in the source code of the target webpage, whether preset advertisement characters are included in the URL or not is determined; if the preset advertisement characters are not included, the URL is accessed, corresponding resources are obtained, and the target webpage is rendered; if the preset advertisement characters are included, accessing to the URL is abandoned. According to the advertisement intercepting method, in the process of analyzing the webpage, accessing to the URL including the preset advertisement characters is abandoned, and thus advertisement interception can be achieved even a user opens the webpage for the first time. Furthermore, according to the advertisement intercepting method and device, compared with the prior art, the advertisement cannot be loaded and displayed first, the time for analyzing and rendering the advertisement is saved, and the webpage loading speed is improved.

Description

A kind of Ad blocking method and device
Technical field
The present invention relates to Internet technical field, particularly a kind of Ad blocking method and device.
Background technology
Along with the development of browser correlation technique, increasing user is by browser browsing page obtaining information.But on webpage, there is a large amount of advertisements, the online that has affected user is experienced.
User clicks target web, and target web can first be played up displaying, and advertisement also can first loaded and displayed.Ad blocking method of the prior art, click behavior by recording user to advertisement in target web, in the time that user opens identical webpage or application program again, according to local record, can know that user once closed this advertisement, therefore, can stop carrying advertisement or hiding advertisement, thereby realize the interception of advertisement.
But, in the time that user opens webpage for the first time, because this locality does not have relevant record, therefore, adopt above-mentioned prior art cannot realize the interception to advertisement.
Summary of the invention
Embodiments of the invention provide a kind of Ad blocking method and device, can, in the time that user opens webpage for the first time, realize Ad blocking.
For achieving the above object, the embodiment of the present invention adopts following technical scheme:
A first aspect of the present invention, provides a kind of Ad blocking method, and the method comprises:
Request access target web;
Obtain the source code of target web;
Resolving in the process of target web source code, if comprise URL in the source code of target web, determine whether above-mentioned URL comprises predetermined advertisement character;
If do not comprise predetermined advertisement character, access described URL, obtain corresponding resource, play up described target web;
If comprise advertisement character, abandon accessing described URL.
In conjunction with a first aspect of the present invention, in a kind of possible implementation, comprise advertisement character if described, abandon accessing described URL, comprising:
Replace with the file of presetting the resource that described URL is corresponding, in the attribute of described default file, add not display properties, play up described target web.
In conjunction with a first aspect of the present invention and above-mentioned mode in the cards, in the possible implementation of another kind, describedly replace with the file of presetting the resource that described URL is corresponding, in the attribute of described default file, add not display properties, play up described target web, comprising:
Replace with the file of presetting the resource that described URL is corresponding, the mime type of default file is set to preset kind;
Detect the mime type of default file, if described mime type is preset kind, by adding not display properties in the attribute of described default file, play up described target web.
In conjunction with a first aspect of the present invention and above-mentioned mode in the cards, in the possible implementation of another kind, described default file is a pictures.
A second aspect of the present invention, provides a kind of Ad blocking device, and this device comprises:
Request sending module: for request access target web;
Source code acquisition module: for obtaining the source code of target web;
Advertisement character judge module: for the process resolving target web source code, if comprise URL in the source code of target web, determine whether above-mentioned URL comprises predetermined advertisement character;
Resource acquisition and rendering module: if do not comprise predetermined advertisement character, access described URL, obtain corresponding resource, play up described target web;
Ad blocking module: if comprise advertisement character, abandon accessing described URL.
In conjunction with a second aspect of the present invention, in a kind of possible implementation, described Ad blocking module comprises:
The first Ad blocking submodule: replace with the file of presetting the resource that described URL is corresponding, add not display properties in the attribute of described default file, play up described target web.
In conjunction with a second aspect of the present invention and above-mentioned mode in the cards, in the possible implementation of another kind, described Ad blocking module comprises the second Ad blocking submodule:
Replace with the file of presetting the resource that described URL is corresponding, the mime type of default file is set to preset kind;
Detect the mime type of default file, if described mime type is preset kind, by adding not display properties in the attribute of described default file, play up described target web.
In conjunction with a second aspect of the present invention and above-mentioned mode in the cards, in the possible implementation of another kind, in described Ad blocking module, described default file is a pictures.
A kind of Ad blocking method and device that the present embodiment provides, in webpage resolving, abandon the URL that access comprises predetermined advertisement character, even make user open for the first time webpage, also can realize Ad blocking.Further, above-mentioned Ad blocking method and apparatus, compared with prior art, advertisement can first loaded and displayed, has saved advertisement parsing and render time, has improved webpage loading velocity.
Brief description of the drawings
In order to be illustrated more clearly in the embodiment of the present invention or technical scheme of the prior art, to the accompanying drawing of required use in embodiment or description of the Prior Art be briefly described below, apparently, accompanying drawing in the following describes is only some embodiments of the present invention, for those of ordinary skill in the art, do not paying under the prerequisite of creative work, can also obtain according to these accompanying drawings other accompanying drawing.
The schematic flow sheet of a kind of Ad blocking method that Fig. 1 provides for the embodiment of the present invention;
The schematic flow sheet of the another kind of Ad blocking method that Fig. 2 provides for the embodiment of the present invention;
The schematic flow sheet of the another kind of Ad blocking method that Fig. 3 provides for the embodiment of the present invention;
The schematic diagram of a kind of Ad blocking device that Fig. 4 provides for the embodiment of the present invention;
The schematic diagram of the another kind of Ad blocking device that Fig. 5 provides for the embodiment of the present invention;
The schematic diagram of the another kind of Ad blocking device that Fig. 6 provides for the embodiment of the present invention.
Embodiment
Below in conjunction with the accompanying drawing in the embodiment of the present invention, the technical scheme in the embodiment of the present invention is clearly and completely described, obviously, described embodiment is only the present invention's part embodiment, instead of whole embodiment.Based on the embodiment in the present invention, those of ordinary skill in the art, not making the every other embodiment obtaining under creative work prerequisite, belong to the scope of protection of the invention.
Below by specific embodiment, the present invention is described in detail.
One embodiment of the invention provides a kind of Ad blocking method, and as shown in Figure 1, the method comprises:
101, request access target web;
102, obtain the source code of target web;
Browser sends web access requests according to user access request to server, server receives after described web access requests, can resolve described web access requests, and return to HTML (Hyper Text Mark-up Language, the HTML (Hypertext Markup Language)) source code of corresponding target web.
103, resolving in the process of target web source code, if comprise URL (Uniform Resource Locator, URL(uniform resource locator)) in the source code of target web, determine whether above-mentioned URL comprises predetermined advertisement character; If do not comprise predetermined advertisement character, carry out S104; If comprise advertisement character, carry out S105;
For example, above-mentioned predetermined advertisement character can be " AD ", " advertisement ", " adv " or " advertisement " etc.
104, access described URL, obtain corresponding resource, play up described target web;
105, abandon accessing described URL.
A kind of Ad blocking method that the present embodiment provides, in webpage resolving, abandons the URL that access comprises predetermined advertisement character, therefore, even user opens webpage for the first time, also can realize Ad blocking.Further, above-mentioned Ad blocking method, compared with method of the prior art, advertisement can first loaded and displayed, has saved advertisement parsing and render time, has improved webpage loading velocity.
Optionally, another embodiment of the present invention provides a kind of Ad blocking method, and as shown in Figure 2, after above-mentioned 105, this Ad blocking method can also comprise:
206, replace with the file of presetting the resource that described URL is corresponding, in the attribute of described default file, add not display properties, play up described target web.
Optionally, above-mentioned default file, can be a self-defining picture, for example, and transparent picture etc.Not display properties of described interpolation can add <display:none> attribute in the attribute information of this picture.
In the time that the kernel of browser is played up target web, if detect in the attribute information of described default file and comprise not display properties, on target web position corresponding to described default file, browser kernel can be played up other elements of target web, now, other elements of target web can cover on the position that described default file is corresponding, avoid occurring that white phenomenon appears staying in former location advertising.
Optionally, another embodiment of the present invention provides a kind of Ad blocking method, and as shown in Figure 3, above-mentioned 206 can comprise:
306A, replace with the file of presetting the resource that described URL is corresponding, the MIME of default file (Multipurpose Internet Mail Extensions, the expansion of multi-usage internet mail) type is set to preset kind.
The mime type of 306B, the default formatted file of detection, if described mime type is preset kind, by adding not display properties in the attribute of described default file, plays up described target web.
For example, detect the mime type of default file, if this mime type is self-defining Image/Adblock type, will in the style of Element element corresponding default file, add <display:none> attribute.
In the style of the Element element that described default file is corresponding, add after <display:none> attribute, browser is just no longer played up default file, therefore in the webpage of having played up, also can not show the picture corresponding with picture access request again.
One embodiment of the invention provides a kind of Ad blocking device, and as shown in Figure 4, this device comprises:
Request sending module 401: for request access target web;
Source code acquisition module 402: for obtaining the source code of target web;
Advertisement character judge module 403: resolving in the process of target web source code, if comprise URL in the source code of target web, for determining whether above-mentioned URL comprises predetermined advertisement character;
Resource acquisition and rendering module 404: if do not comprise predetermined advertisement character, for accessing described URL, obtain corresponding resource, play up described target web;
Ad blocking module 405: if comprise advertisement character, for abandoning accessing described URL.
Another embodiment of the present invention provides a kind of web page display device, and as shown in Figure 5, in described device, described Ad blocking module 405 comprises:
The first Ad blocking submodule 405A: for replacing with the file of presetting the resource that described URL is corresponding, add not display properties in the attribute of described default file, play up described target web.
Another embodiment of the present invention provides a kind of web page display device, and as shown in Figure 6, in described device, described Ad blocking module comprises:
The second Ad blocking submodule 405B: for replacing with the file of presetting the resource that described URL is corresponding, the mime type of default file is set to preset kind; Detect the mime type of default file, if described mime type is preset kind, by adding not display properties in the attribute of described default file, play up described target web.
In above-mentioned possible enforcement, described default file can be a pictures.
For device embodiment, because it is corresponding with embodiment of the method, therefore, embodiment of the method part complements one another with device embodiment part.In addition, for convenience of description, while describing above device, divide modules with function and be described, in the time that enforcement is of the present invention, the function of each module can be realized in same or multiple software and/or hardware, do not limit at this.
It should be noted that, in this article, relational terms such as the first and second grades is only used for an entity or operation to separate with another entity or operational zone, and not necessarily requires or imply and between these entities or operation, have the relation of any this reality or sequentially.And, term " comprises ", " comprising " or its any other variant are intended to contain comprising of nonexcludability, thereby the process, method, article or the equipment that make to comprise a series of key elements not only comprise those key elements, but also comprise other key elements of clearly not listing, or be also included as the intrinsic key element of this process, method, article or equipment.The in the situation that of more restrictions not, the key element being limited by statement " comprising ... ", and be not precluded within process, method, article or the equipment that comprises described key element and also have other identical element.
Each embodiment in this instructions all adopts relevant mode to describe, between each embodiment identical similar part mutually referring to, what each embodiment stressed is and the difference of other embodiment.Especially,, for device embodiment, because it is substantially similar in appearance to embodiment of the method, so description is fairly simple, relevant part is referring to the part explanation of embodiment of the method.
One of ordinary skill in the art will appreciate that all or part of step realizing in said method embodiment is can carry out the hardware that instruction is relevant by program to complete, described program can be stored in computer read/write memory medium, here the alleged storage medium obtaining, as: ROM/RAM, magnetic disc, CD etc.
The foregoing is only preferred embodiment of the present invention, be not intended to limit protection scope of the present invention.All any amendments of doing within the spirit and principles in the present invention, be equal to replacement, improvement etc., be all included in protection scope of the present invention.

Claims (10)

1. an Ad blocking method, is characterized in that, described method comprises:
Request access target web;
Obtain the source code of target web;
Resolving in the process of target web source code, if comprise uniform resource position mark URL in the source code of target web, determine whether above-mentioned URL comprises predetermined advertisement character;
If do not comprise predetermined advertisement character, access described URL, obtain corresponding resource, play up described target web;
If comprise advertisement character, abandon accessing described URL.
2. Ad blocking method as claimed in claim 1, is characterized in that: comprise advertisement character if described, abandon accessing described URL, comprising:
Replace with the file of presetting the resource that described URL is corresponding, in the attribute of described default file, add not display properties, play up described target web.
3. Ad blocking method as claimed in claim 2, is characterized in that: describedly replace with the file of presetting the resource that described URL is corresponding, add not display properties in the attribute of described default file, play up described target web, comprising:
Replace with the file of presetting the resource that described URL is corresponding, the multi-usage internet mail expansion mime type of default file is set to preset kind;
Detect the mime type of default file, if described mime type is preset kind, by adding not display properties in the attribute of described default file, play up described target web.
4. Ad blocking method as claimed in claim 2 or claim 3, is characterized in that: described default file is self-defining picture.
5. Ad blocking method as claimed in claim 3, is characterized in that: described default type is Image/Adblock type.
6. an Ad blocking device, is characterized in that, this device comprises:
Request sending module: for request access target web;
Source code acquisition module: for obtaining the source code of target web;
Advertisement character judge module: resolving in the process of target web source code, if comprise uniform resource position mark URL in the source code of target web, for determining whether above-mentioned URL comprises predetermined advertisement character;
Resource acquisition and rendering module: if do not comprise predetermined advertisement character, for accessing described URL, obtain corresponding resource, play up described target web;
Ad blocking module: if comprise advertisement character, for abandoning accessing described URL.
7. Ad blocking device as claimed in claim 6, is characterized in that: described Ad blocking module comprises:
The first Ad blocking submodule: for replacing with the file of presetting the resource that described URL is corresponding, add not display properties in the attribute of described default file, play up described target web.
8. Ad blocking device as claimed in claim 6, is characterized in that: described Ad blocking module comprises:
The second Ad blocking submodule: for replacing with the file of presetting the resource that described URL is corresponding, the multi-usage internet mail expansion mime type of default file is set to preset kind; Detect the mime type of default file, if described mime type is preset kind, by adding not display properties in the attribute of described default file, play up described target web.
9. Ad blocking device as claimed in claim 7 or 8, is characterized in that: described default file is self-defining picture.
10. Ad blocking device as claimed in claim 8, is characterized in that: described default type is Image/Adblock type.
CN201410283500.0A 2014-06-23 2014-06-23 Advertisement intercepting method and device Pending CN104008211A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201410283500.0A CN104008211A (en) 2014-06-23 2014-06-23 Advertisement intercepting method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201410283500.0A CN104008211A (en) 2014-06-23 2014-06-23 Advertisement intercepting method and device

Publications (1)

Publication Number Publication Date
CN104008211A true CN104008211A (en) 2014-08-27

Family

ID=51368868

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201410283500.0A Pending CN104008211A (en) 2014-06-23 2014-06-23 Advertisement intercepting method and device

Country Status (1)

Country Link
CN (1) CN104008211A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126678A (en) * 2016-06-28 2016-11-16 乐视控股(北京)有限公司 A kind of data processing method and device
CN106951238A (en) * 2017-03-09 2017-07-14 北京小米移动软件有限公司 Page display method and device
CN107329750A (en) * 2017-06-26 2017-11-07 厦门美图移动科技有限公司 The recognition methods of advertisement page, jump method and mobile terminal in application program
CN109727048A (en) * 2017-10-31 2019-05-07 北京国双科技有限公司 Data processing method and device
CN112417324A (en) * 2020-05-12 2021-02-26 上海哔哩哔哩科技有限公司 Chrome-based URL (Uniform resource locator) interception method and device and computer equipment

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006036170A1 (en) * 2004-09-15 2006-04-06 Pcsafe, Inc. Methods and systems for filtering urls, webpages, and content
CN102306077A (en) * 2011-08-04 2012-01-04 深圳市万兴软件有限公司 Method for downloading video in Macintosh (MAC) platform browser and browser
US8527504B1 (en) * 2005-09-01 2013-09-03 At&T Intellectual Property Ii, L.P. Data network content filtering using categorized filtering parameters
CN103530560A (en) * 2013-09-29 2014-01-22 北京金山网络科技有限公司 Method, device and client side for advertisement blocking
CN103699665A (en) * 2013-12-27 2014-04-02 贝壳网际(北京)安全技术有限公司 Method and device for filtering web page advertisements

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
WO2006036170A1 (en) * 2004-09-15 2006-04-06 Pcsafe, Inc. Methods and systems for filtering urls, webpages, and content
US8527504B1 (en) * 2005-09-01 2013-09-03 At&T Intellectual Property Ii, L.P. Data network content filtering using categorized filtering parameters
CN102306077A (en) * 2011-08-04 2012-01-04 深圳市万兴软件有限公司 Method for downloading video in Macintosh (MAC) platform browser and browser
CN103530560A (en) * 2013-09-29 2014-01-22 北京金山网络科技有限公司 Method, device and client side for advertisement blocking
CN103699665A (en) * 2013-12-27 2014-04-02 贝壳网际(北京)安全技术有限公司 Method and device for filtering web page advertisements

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张弘: "被你忽视的"Adblock"", 《成功营销》 *
张民: "Microsoft MIME类型研究及应用", 《大众科技》 *

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106126678A (en) * 2016-06-28 2016-11-16 乐视控股(北京)有限公司 A kind of data processing method and device
CN106951238A (en) * 2017-03-09 2017-07-14 北京小米移动软件有限公司 Page display method and device
CN107329750A (en) * 2017-06-26 2017-11-07 厦门美图移动科技有限公司 The recognition methods of advertisement page, jump method and mobile terminal in application program
CN109727048A (en) * 2017-10-31 2019-05-07 北京国双科技有限公司 Data processing method and device
CN109727048B (en) * 2017-10-31 2021-04-23 北京国双科技有限公司 Data processing method and device
CN112417324A (en) * 2020-05-12 2021-02-26 上海哔哩哔哩科技有限公司 Chrome-based URL (Uniform resource locator) interception method and device and computer equipment

Similar Documents

Publication Publication Date Title
US11586801B2 (en) Automatically determining a size for a content item for a web page
JP5571091B2 (en) Providing search results
US8972282B2 (en) Method for transformation of a website
CN102629273B (en) Advertising information pushing method based on browser, device and browser system
CN104166656B (en) The webpage methods of exhibiting and device of traffic statistics
MX2009001640A (en) Enabling web analytics for interactive web applications.
CN104008211A (en) Advertisement intercepting method and device
US20130339139A1 (en) System and method for nonstandard creative content auctioning
US11922465B2 (en) Expandable content items for presenting additional content
US10089120B2 (en) Widgets in digital dashboards
US11164221B2 (en) Native online ad creation
Subić et al. Responsive web design–Are we ready for the new age
CN105630792A (en) Information display method and device as well as information push method and device
CN107391534B (en) Page display method, page file return method, page display device, page file return device and computer storage medium
CN113190321A (en) Method and equipment for application program page pull-up refreshing
US10210001B2 (en) Automatic execution of objects in a user interface
CN105450460B (en) Network operation recording method and system
JP2022545545A (en) Protecting User Privacy in User Interface Data Collection for Native Applications
CN104899287A (en) Webpage display method and device
US20150347431A1 (en) Serving Expandable Content Items
US20170242830A1 (en) Method of identifying a target object on a web page
WO2020134662A1 (en) Heat map drawing method and device
نجلاء عودة et al. Responsive Web Design Trend in Official Ministries and Government Institutions Websites in Palestine
Edgar Speed Metrics Guide
WO2014186716A2 (en) System and method for nonstandard creative content auctioning

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: 20140827