Hide content from linux users


I have some flash code that seems to be affecting users using Firefox v24, Flash 11.1 on linux. Is there anyway I can block this code or remove it from linux users?


I don’t know of any method (although there may be one), but removing content from all Linux users because a certain configuration causes problems seems a bit of an overkill to me.

Firefox is now at version 31, and on Ubuntu 14.04, I have Flash 11.2. Perhaps the simpler solution would just be a polite message suggesting anybody having problems should update their browser/plugin?

Use the Navigator object in Javascript, if you can’t do it serverside.

if (navigator.appVersion.indexOf("Linux")!=-1) {
    // hide your flash object

This obviously isn’t foolproof. User Agents are easy to spoof.

More Info:


Thanks for the replies. The reason I need to hide it is because linux users are getting errors/pages are not loading therefore conversions are dropping.

@mawbun Thanks, but I am not sure how I actually hide the code. Do I do something using .hide() ?

You should have the flash element wrapped in a container div and you would just hide that entire div.

if (navigator.appVersion.indexOf("Linux")!=-1) {

Or if you’re using jQuery

$(function() {
    if (navigator.appVersion.indexOf("Linux")!=-1) {

Thanks again for the reply.

There is no div that I know of wrapping the flash. The flash JS is in a .js file being called on the page. I am not sure if it is actually being used on the page, but it seems linux doesn’t like it. Is there a way I can hide it within the JS rather than an element?

Have you tried to determine how many Linux users are affected by this? And what percentage of them would have converted if the problem didn’t arise?

If the numbers are anything other than trivial, the obvious solution is to get rid of the offending Flash component completely. I don’t know what benefit the Flash is adding to your site. But I have to ask if the benefit is so great that it justifies the lost sales?


I’m not sure how you’re putting it on your page. It should be wrapped in a div.

I am not sure if it is actually being used on the page, but it seems Linux doesn’t like it. Is there a way I can hide it within the JS rather than an element?

I agree with Mikl, if you don’t need just remove it all together. Flash just needs to die.

It is basically this code that is in a JS file:

LoadFlash : function(flash_path, width, height){
		document.write('<object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0" width="'+ width +'" height="'+ height +'">');
		document.write('<param name="movie" value="'+ flash_path +'"/><param name="quality" value="best"/><param name="wmode" value="transparent"/><param name="play" value="true"/><embed pluginspage="http://www.macromedia.com/go/getflashplayer" src="'+ flash_path +'" type="application/x-shockwave-flash" wmode="transparent" quality="best" play="true" width="'+ width +'" height="'+ height +'"></embed>');

There is a lot of pages/code so Ideally I would like to just hide it from Linux users for now to see if it makes a difference.

For further reference, it would be useful to know hoe to exclude script from specific OS.

Thanks :slight_smile:

Are you sure it’s the flash at fault and not the antiquated document.write