Ubuntu / Linux news and application reviews.

How To Block The Falling Snow On Websites

December is that month of the year when 90% of the blogs teach you how to 'install' falling snow on your website (but they use the method described in this post to disable it for themselves) and about 0.1% tell you how to disable it.

Anyway, let's get started.

You can find a snow.js demo HERE (so you can test to see if you blocked it correctly).

There are two snow scripts (javascript) that I know of, which we are going to block using AdBlock Plus Firefox extension. After installing the extension, right click the AdBlock Plus icon and select "Preferences", scroll down to "Blocking rules", select any blocked item, select "Add New" end enter:

How to Detect AdBlock Plus And Display Website Elements Depending On It Being Enabled or Disabled

AdBlock Plus is a Firefox extension which disables almost all kind of ads for all the websites you visit. It can be set to still display ads for some websites, if the user desires.

I have recently found a way to hide all website content if AdBlock Plus is enabled to hide the ads and only display a message like "Please set AdBlock Plus to display ads for this website", and if the user sets AdBlock Plus to allow ads on that website, the content appears upon refreshing it. But I do not like this because the user uses AdBlock Plus for a reason: he most definitely does not want to see ads, so why make him? You can find a tutorial for this, here, although I do not recommend it!

I'm writing about it because this can be used to fix some layout issues with certain elements being hidden when AdBlock Plus hides the ads. For instance let's say you have a text link ad on your website. That link will be blocked by AdBlock Plus, but if you have some images or text to be displayed next to that link, Adblock Plus will only block the link and that text and/or images will show up and they won't make any sense without the link which can be quite annoying.

How it works

AdBlock Plus hides among others, all the elements that have a name that sounds like an advertisement. That means we can use CSS to hide certain elements on the website and then make them show up by re-writing the CSS through a file called advertisement.js. AdBlock Plus will block the file called "advertisement.js" because it thinks it's an ad, so the elements we've hidden will remain hidden until "advertisement.js" will be allowed to load (when AdBlock Plus is not installed or is set to allow ads to be displayed on that website).

Here is how to use this:

1. Put this above the </head> section of your website:
<style type='text/css'>
#ffix {visibility:hidden;display:none;}
</style>

<noscript>
<style type='text/css'>
#ffix {visibility:visible!important; display:inline!important;}
</style>
</noscript>

2. Create a new empty file called advertisement.js and paste this in it:
document.write('<style type="text/css">#ffix {visibility:visible!important; display:inline!important;}</style>'); 
and then upload that file to a web host.

3. Put the following script above the </head> section of your website (but under the code from step 1):
<script src='http://my_host.com/advertisement.js' type='text/javascript'/>
advertisement.js should be the file you created on step 2; replace http://my_host.com with the website where you uploaded the file.

4. Now to make some CSS elements only show up when AdBlock Plus is not installed or when it allows ads, simply search those CSS elements in your source code and append the id called "ffix" to them.


Example: let's say you want to hide a div which contains your menu from being displayed unless AdBlock Plus allows ads:
<div id="ffix">my menu html code</div>


Yes, it's that easy ;)

AdBlock Plus Tries To Also Please Site Owners

Roughly 5% of Firefox users run a plugin called AdBlock Plus, which effectively blocks all display and text ads on web sites. There can be little doubt that the ethics of using a tool like this can get pretty tricky, though a lot of users do opt to block online ads, and given that this is mostly and all-or-nothing approach, once a user decides to block ads on one site that features exceptionally annoying ads, they will also block ads on every other site as well. Now, AdBlock Plus' developers have proposed a new meta tag that would allow site owners to pop up a notification for AdBlock Plus users, asking them if they want to block ads on a site that, according to the webmaster's own judgment, does not contain any "annoying advertising."

Even AdBlock Plus' developers seem somewhat torn by the problems that their product can cause for webmasters, but, according to their reasoning, giving users an easier way to opt-in to less annoying ads would encourage publishers to opt for less intrusive ads, which would ultimately give users less reasons to use AdBlock Plus in the long run.

The proposed new meta tag would look something like this:

<meta name="advertising" content="ask">

According to the proposal, a pop-up window would appear at the top of the page when a user navigates to a site that implements this tag.

photobucket

Ads Are Getting More Intrusive Again

It is no secret, of course, that most readers do not necessarily like ads - and while we have thankfully moved away from pop-up and pop-under ads on every single site (remember those?), the latest crop of new ads is getting increasingly invasive again. Just yesterday, the New York Times front page was taken over by a giant ad from chipmaker Intel, which covered the text of the front page completely. And the new ad standards (including ads that remain in the page even when a user scrolls up or down) from the Online Publisher Association also call for bigger and more intrusive ads.

Of course, advertisers and publishers have to walk a fine line, where the ads still pay for the content without annoying readers so much that services like AdBlock Plus become a default tool for everybody.

Taking the AdBlock Plus proposal even further, maybe advertisers and site owners could also set different 'noise levels' as well, so that users could decide to automatically block ads that expand, make noise, or feature dancing aliens, but keep static display ads and text ads.

Do Publishers Have an Option?

While content providers have experimented with micropayments in the past, these experiments have generally failed, so at least for the time being, advertising is the most effective way for publishers (including ReadWriteWeb) to monetize their efforts. Content producers and advertisers are obviously aware of products like AdBlock Plus, and as the comments on the AdBlock Plus blog post clearly show, there is a large contingent of users who are adamantly against all forms of advertising on the web.

What do You Think? Give us your opinion in the comments

[via RRW]