How to block UC mandatory spam ads embedded on your site page

Source: Internet
Author: User

Do not know when people on the phone with the UC browser, there is no notice at the bottom of the page sometimes a large number of ads appear randomly

Such as:
In order to avoid the suspicion of advertising, I mainly use CSDN's official website example (in fact, has been everywhere, most of the Web pages have been injected into the ads)

Here a Swoole's official website has been inserted into the

People may think that advertising is too common, there is nothing to say, but this ad is very special.

Because most people do not pay attention to see, will think that this is CSDN put ads, maybe some students will be scolded, but the reality is you misunderstood, this is not CSDN ads, but to commit a cheap UC force injected into the CSDN page of the ad code Oh, not just CSDN, many other site content have been hijacked by the UC browser!

This should have lasted for at least one or two months, I've seen it before, but I didn't care much about it, and then because a user on my own site asked me how I started running ads now? Because my website has been doing for several years, has never cast off any ads, understand the discovery is actually UC started to commit cheap, incredibly forced to inject their own ad code into the Code of my Site page.

This everywhere to block AdSense ads UC, incredibly forced to all the webmaster embedded in their own ads to make money, this wo consulted behavior is disgusting to me, so have to write this article.

If the ad in UC is suspended or bounced out of the browser, it's still acceptable, after all, it's UC's own app terminal, which we can't control.

But now the nature is completely different, he actually hijacked Webmaster Web page, injected code into the page content, not through the webmaster's permission, there is no obvious page hint table name is UC own ads, this let a lot of unknown reason users think is webmaster in order to make money to put ads, this compared to break-in robbery what difference ?

Embedded ads are still trivial, today it can be embedded ads, tomorrow may be embedded in your page a variety of scripts, and even can run a fake website dynamic, get a fake news, arbitrary tampering with your Web page information is possible, other people are free to play to think about it, after all, he may have no bottom line, There is nothing to be done about this company without a moral bottom line.

UC to all webmasters forced to inject ad code, I deliberately looked at the UC headlines in the News page, actually did not see the ads ...

He gave us a mandatory advertising, but his products do not run, which, I also have no words ...

Here's a look at how the cheap UC is injected, what code is injected

Because only on the phone to see, more trouble, I test in the local, you can also directly write to an HTML file with the UC browser to access the next to know

In order to verify again, I did a test, randomly saved a CSDN above the article details page of the HTML, and then add the following JS code to view the source, opened in the UC browser to see the injected ads

Note: This ad appears randomly, so it needs to be refreshed several times.

Test, the exaggeration is that UC hijacking and another hijacked advertisement all appeared together ... No language

<script>setTimeout(function(){    alert(document.body.innerHTML);}, 5000);</script>

Note: A delay is required, because he was injected after the normal code was loaded.

For example, an IFRAME is directly written to the current page of the code, after my test, this code should be written every time, just random display content, you can try

Seeing the code for the UC injection, we can find a way to intercept the ads that block UC forced injection.

The simplest is to use CSS, hide it directly

<style type="text/css">    #uc_recommend_ad { display: none !important; }</style>

Or add a border to his ad to clearly see the injection effect

<style type="text/css">    #uc_recommend_ad { border: solid 5px #F00; }</style>

Use JS to remove the container

setTimeout(function () {    //alert(document.body.innerHTML);    var ucad = document.getElementById(‘uc_recommend_ad‘);    if (ucad) {        ucad.parentNode.removeChild(ucad);        alert(‘删除成功‘);    2000);

This page finally clean ~ ~

But the above method now although can be used, but so make a cheap UC, do not know later will not change ID or even remove all kinds of logos, so you want to remove the more difficult, can only use JS to filter.

In the face of this shameless bandit bully behavior, we can still have what way? After all this kind of thing is too much, by the way another thing of a similar nature

Actually very common, but still use CSDN example!

This ad should be CSDN mobile traffic was hijacked after the run, for a long time at least six months to see n times, many web pages have been randomly ejected, but still at large

For this situation, HTTPS should be useful, but it is useless for UC.
Our web page HTML code pairs with the browser is completely unprotected, they want to change how to change, if they have no baseline

Do unto others, come back haunting, I think UC also do not want his official website below, be others put a sell XX advertisement!

How to block UC mandatory spam ads embedded on your site page

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.