Posterous theme by Cory Watilo

Web 2.0 Pop Up Blocker

Remember those annoying pop ups? You don't notice them as much now-a-days as all modern browsers come with a pop-up blocker which disbales them.

These pop ups are basically created by calling window.open() from JavaScript.

Some of the reason why sites do not use them anymore are:

  1. They can be easily bypasssed with a pop-up blocker
  2. They are still annoying and as such, provide a bad user experience

Enter Web 2.0 style Pop Ups! These popups do not use window.open(), rather they rely on overlaying divs on top of the page. Something like this:

Overlay_example

Now these cannot be easily bypassed by pop up blockers as they are not real "pop-ups". They are still annoying as:

  • They block real content
  • They require you to find the tiny, obscure, almost hidden "X" or "close" button and click it.
  • The "X" or "close" click can be used to launch a real pop-up window or execute other malicious code. The browser will not block it as it is initiated by you.

After being annoyed for a while, I decide to create a bookmarklet to tackle this menace. A bookmarklet is similar to a bookmark, but instead of launching a web page, it executes javascript code.

To use it,

  1. Create a new bookmark
  2. In the URL field, copy/paste the code below:
    javascript:(function(e,a,g,h,f,c,b,d){if(!(f=e.jQuery)||g>f.fn.jquery||h(f)){c=a.createElement("script");c.type="text/javascript";c.src="http://ajax.googleapis.com/ajax/libs/jquery/"+g+"/jquery.min.js";c.onload=c.onreadystatechange=function(){if(!b&&(!(d=this.readyState)||d=="loaded"||d=="complete")){h((f=e.jQuery).noConflict(1),b=1);f(c).remove()}};a.documentElement.childNodes[0].appendChild(c)}})(window,document,"1.3.2",function($,L){$('div[name*="overlay"]').hide();$('div[id*="overlay"]').hide();$('div[style*="z-index"]').each(function(){if($(this).css("z-index")>1000){$(this).hide()}});$('iframe[style*="z-index"]').each(function(){if($(this).css("z-index")>1000){$(this).hide()}});});
  3. Click Ok to Save the bookmark
  4. Drag the button below to your bookmark bar. (Read my update below)
  5. When you visit a page that uses these overlays, simply click on the bookmark to safely clear them out. 

Alternately,

  1. Visit http://jsfiddle.net/2nQZ7/embedded/result/
  2. Drag the "Pop Ups Gone" link to your bookmark bar

Standalone version (v1.0): **Update**: I realized that none of the blogging platforms allow you to create a bookmarklet that you can drag onto your bookmarks bar (sigh).

Here's the code that it executes:

$('div[name*="overlay"]').hide();  /* hide any divs with the name 'overlay' in them */
$('div[id*="overlay"]').hide();  /* hide any divs with the id 'overlay' in them */
$('div[style*="z-index"]').each(function(){  /* hide any divs with z-index > 1000 */
 if($(this).css("z-index")>1000){$(this).hide()}});
$('iframe[style*="z-index"]').each(function(){  /* hide any iframes with z-index > 1000 */
 if($(this).css("z-index")>1000){$(this).hide()}});

It uses jQuery and will try to load jQuery (safely, no conflict mode) if the web page doesn't use it already. Thanks to Ben Alman's nice jQuery bookmarklet generator!

Please send your comments/feedback. If you don't find it working on any site, leave me a comment including the site URL and I'll try to fix it. 

Grand Opening...

Alright! After years of fighting it, here I am - another drop in the ocean of bloggers.

Writer's block - yeah right. Not a writer definitely but yeah, had that and I'm pinning all the blame on that. That's why, that's why I never wrote anything online!

Now, what do I write about? I thought about plenty of things to blog about but then, I didn't have a blog and now all those bright ideas are hazy at best.

Among other things, let me start by saying why I chose Posterous above others.

I tried blogger and wordpress. They seemed nice and seem to have a really solid platform for blogging with all the features that you may want. After all, their popularity speaks for themselves. I read a lot of comparisions[1] to decide which one to settle on. Even asked about it on forums such as codeproject[2]. Each had its own list of pros and cons.

After carefully reading (alright, after reading between the lines) and playing around with them, I concluded that:

  • as a beginner, I needed something simpler. Something that can get me off ground quickly. 
  • since these services have been around for long, all the names that I tried were already taken!
  • themes - oh my god!! So many options. I customized so much that all I was doing was customizing rather than writing. Its my own fault, I know...
  • nobody sent me mails asking to write. Rich told me - "If you can send an email, you can get your first post on Posterous". I think I needed that extra nudge.
  • posterous has a nice and simple UI. I got here via some of the links I clicked on online articles and I said to myself - hey, that looks cool! The site design felt more like Web 2.0 and caught my eye.
  • finally, I liked the theme here (yay!!). This time I took extra precaution to not go to the customization loop.

This is not to discount what blogger and wordpress are offering. I'm pretty sure that someday I'll definitely start using them. But until then, I want to try Posterous.

So there you go. My first blog post! Yay!!

 

References:

[1] Comparision between Blogger and Wordpress service

     http://pulsed.blogspot.com/2007/07/blogger-wordpress-chart.html

     http://www.professorbeej.com/2010/05/post-mortem-blogger-vs-wordpress.html

     http://www.basilsblog.net/2011/01/blogger-vs-wordpress-vs-wordpresscom.html

[2] CP Lounge post - My fav online hangout place!

     http://www.codeproject.com/Messages/3676274/Best-Blogging-Service-modified.aspx