How can I test if a user viewing my website can not see some content, and how can I make sure my test works?
<p>I'm using code similar to below:</p>

<pre><code>var image = new Image();
image.src = "http://youtube.com/favicon.ico";
image.onload = function(){
// The user can access youtube
};
image.onerror = function(){
// The user can't access youtube
};
</code></pre>

<p>Which I found here: <a href="http://stackoverflow.com/questions/286021/detecting-if-youtube-is-blocked-by-company-isp/1804634#1804634">http://stackoverflow.com/questions/286021/detecting-if-youtube-is-blocked-by-company-isp/1804634#1804634</a></p>

<p>To test if a user has access to youtube/facebook/twiter, so when I try to embed a video, or a like button. I know if the user can see it. At my workplace whenever I go to a website that uses a like/tweet button etc, I see a small portion of an ugly page telling me that the content is blocked on our network. I don't want the people visiting my site to see this.</p>

<p>The above code works fine for me on my network. But what methods can I use to test it to make sure it will work for everyone, and if it doesn't what code would, as every workplace/network blocks content differently.</p>

<p>Thanks for any answers.</p>
