Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Druid's way to advertise

2025-01-19 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Internet Technology >

Share

Shulou(Shulou.com)06/02 Report--

This article mainly explains "how to advertise Druid". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Let's let the editor take you to learn "the method of Druid advertising".

How to locate Advertising Code in Druid

Let's first locate the logic generated by advertising on the page.

Clue 1. Since advertisements do not appear when the page loads, there must be an asynchronous way to load them.

Clue 2. Because every page is called, it is generally encapsulated in a js.

On the Druid main page, press F12 and you can see that the page references the following js file

After checking one by one, it is found that the advertising code exists in common.js.

Line 30

BuildFooter: function () {var html ='+'+'

'+' powered by AlibabaTech & sandzhang & melin & shrek.wang'+'+'; $(document.body) .append (html);} Delete the ad code

At present, under the premise that the source code cannot be changed, we can modify the return content of common.js through the Filter filter.

Determine whether the current path ends with / druid/js/common.js in Filter

Gets what should be returned by the current file path

Delete the code related to advertising and construct new content

Return the new content to the foreground

If (requestUrl.contains ("/ druid/js/common.js")) {/ / filter / druid/js/common.js path to replace the ad code with chain.doFilter (request, response); response.resetBuffer (); / / get the common file content String text = Utils.readFromResource ("support/http/resources/js/common.js") / / regular expression deletes the content between and, including footer itself text = text.replaceAll ("[^%] *", ""); / / returns the new content to the foreground page response.getWriter () .write (text);}

After rerunning the code and visiting druid/js/common.js, you will find that the advertising code is gone.

BuildFooter: function () {var html ='; $(document.body) .append (html);}

Visit the relevant Druid page at this time, found that there is no advertising, done!

At this point, I believe you have a deeper understanding of "Druid advertising method", might as well come to the actual operation of it! Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Internet Technology

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report