473,322 Members | 1,352 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,322 software developers and data experts.

Flash detection Javascript doesn't work in Firefox

Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working. A few browsers are referenced in
the script so I presume that Firefox needs to be added somewhere --
does anyone know how I could update this to be supported by Firefox?
Thanks!

<SCRIPT TYPE="text/JavaScript">
<!--
var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin :
0;
if ( plugin ) {
var words = navigator.plugins["Shockwave
Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}
else if (navigator.userAgent && navigator.userAgent.indexOf("MSIE")>=0
&& (navigator.appVersion.indexOf("Win") != -1)) {
document.write('<SCR' + 'IPT LANGUAGE=VBScript\> \n'); //FS
hide this from IE4.5 Mac by splitting the tag
document.write('on error resume next \n');
document.write('MM_FlashCanPlay = (
IsObject(CreateObject("ShockwaveFlash.ShockwaveFla sh." &
MM_contentVersion)))\n');
document.write('</SCR' + 'IPT\> \n');
}
if ( MM_FlashCanPlay ) {
document.write('<OBJECT
classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"');
document.write('
codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,0,0"
');
document.write(' ID="flash5" WIDTH=308 HEIGHT=68 ALIGN="">');
document.write(' <PARAM NAME=movie VALUE="/flash/logo.swf">
<PARAM NAME=loop VALUE=false> <PARAM NAME=quality VALUE=high> <PARAM
NAME=bgcolor VALUE=#4A3476> ');
document.write(' <EMBED src="/flash/logo.swf" loop=false
quality=high bgcolor=#4A3476 ');
document.write(' swLiveConnect=FALSE WIDTH=306 HEIGHT=68
NAME="flash5" ALIGN=""');
document.write(' TYPE="application/x-shockwave-flash"
PLUGINSPAGE="http://www.macromedia.com/go/getflashplayer">');
document.write(' </EMBED>');
document.write(' </OBJECT>');
} else{
document.write('<IMG SRC="/images/logo.gif" HEIGHT=68
WIDTH=306 BORDER=0>');
}
//-->
</SCRIPT><NOSCRIPT><IMG SRC="/images/logo.gif" HEIGHT=68 WIDTH=306
BORDER=0></NOSCRIPT>
Jul 23 '05 #1
6 3533


Cliff R. wrote:
Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working.
var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin :
0;
if ( plugin ) {
var words = navigator.plugins["Shockwave
Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}


That part of the script is the part to check Netscape or other browsers
like Firefox having the navigator.mimeTypes collection so that script
works with Firefox, for instance when I run that part here with Firefox
1.0 and Shockwave Flash player 7.something installed the variable
MM_FlashCanPlay is true.
So what exactly happens for you when you say "doesn't work with
Firefox", any script errors?
What does
about:plugins
show, does that show Shockwave Flash for the MIME type
application/x-shockwave-flash?

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #2
Hi -- when I said it doesn't work in Firefox, I mean that nothing is
showing where the Flash should be. Not the Flash itself or the image
that's supposed to show if there is no Flash player. And I don't see
any script errors, it's just not showing anything. I'm not sure what
all the elements of the script mean because I didn't write it, but I
do know that it's always worked.

But here's the weird thing, I just noticed that it works on some sites
and not on others (meaning the Flash movie does display). For
example, the same script works on http://www.skyblues.com/ but not on
http://www.bluerill.com/ . Any thoughts or help? Thank you!

On Sun, 12 Dec 2004 12:25:40 +0100, Martin Honnen <ma*******@yahoo.de>
wrote:


Cliff R. wrote:
Hi, I use a handy little Javascript Flash detection script on a number
of sites (copied below). Usually works great, but I just started
trying Firefox and it's not working.


var MM_contentVersion = 5;
var plugin = (navigator.mimeTypes &&
navigator.mimeTypes["application/x-shockwave-flash"]) ?
navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin :
0;
if ( plugin ) {
var words = navigator.plugins["Shockwave
Flash"].description.split(" ");
for (var i = 0; i < words.length; ++i)
{
if (isNaN(parseInt(words[i])))
continue;
var MM_PluginVersion = words[i];
}
var MM_FlashCanPlay = MM_PluginVersion >= MM_contentVersion;
}


That part of the script is the part to check Netscape or other browsers
like Firefox having the navigator.mimeTypes collection so that script
works with Firefox, for instance when I run that part here with Firefox
1.0 and Shockwave Flash player 7.something installed the variable
MM_FlashCanPlay is true.
So what exactly happens for you when you say "doesn't work with
Firefox", any script errors?
What does
about:plugins
show, does that show Shockwave Flash for the MIME type
application/x-shockwave-flash?


Jul 23 '05 #3


Cliff R. wrote:
when I said it doesn't work in Firefox, I mean that nothing is
showing where the Flash should be. Not the Flash itself or the image
that's supposed to show if there is no Flash player. And I don't see
any script errors, it's just not showing anything. But here's the weird thing, I just noticed that it works on some sites
and not on others (meaning the Flash movie does display). For
example, the same script works on http://www.skyblues.com/ but not on
http://www.bluerill.com/ .


I see Flash movies on http://www.bluerill.com/ with Firefox 1.0, I
haven't checked how many the page source includes and whether all are
there but there is Flash visible on the page.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #4
Weird, I have Firefox 1.0 also and I'm just seeing 2 empty blue spaces
where the Flash animations should be (there are 2 animations on that
page). I checked to make sure Javascript is enabled and it is. Any
other thoughts on why this might be?

Thank you for your help!
On Sun, 12 Dec 2004 20:31:32 +0100, Martin Honnen <ma*******@yahoo.de>
wrote:


Cliff R. wrote:
when I said it doesn't work in Firefox, I mean that nothing is
showing where the Flash should be. Not the Flash itself or the image
that's supposed to show if there is no Flash player. And I don't see
any script errors, it's just not showing anything.

But here's the weird thing, I just noticed that it works on some sites
and not on others (meaning the Flash movie does display). For
example, the same script works on http://www.skyblues.com/ but not on
http://www.bluerill.com/ .


I see Flash movies on http://www.bluerill.com/ with Firefox 1.0, I
haven't checked how many the page source includes and whether all are
there but there is Flash visible on the page.


Jul 23 '05 #5


Cliff R. wrote:
I have Firefox 1.0 also and I'm just seeing 2 empty blue spaces
where the Flash animations should be (there are 2 animations on that
page). I checked to make sure Javascript is enabled and it is. Any
other thoughts on why this might be?


Not really, other than checking
about:plugins
to see whether Firefox correctly finds the Flash player and the right
version of it.
Then to find out what the problem could be I would start by using static
HTML markup to embed the Flash (e.g. <embed ...>) and see whether that
is rendered by Firefox. Only if it is I would look at the script again
as then it is likely that the script use is the cause of the problem.

--

Martin Honnen
http://JavaScript.FAQTs.com/
Jul 23 '05 #6
i am facing the same problem, did u find the solution?

Jul 23 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

5
by: Mika S. | last post by:
Hi, How can I detect if the Flash plugin is installed? Should be working with the most common browsers and environments. Thanks, Mika
4
by: kevin | last post by:
meta refresh tag is failing , it is supposed to go to the entry1.htm site which is the flash swf file but it doesn't check code please http://members.optusnet.com.au/~kevindauth/ thanks...
6
by: Gustav Medler | last post by:
Hello, there is a known problem with Opera and the execution of content shown in <NOSCRIPT> tag. Everythings works fine, if there is only one simple script like:...
2
by: Oz Kologlu | last post by:
Hi folks, IE and Asp.net 2.0 are doing some pretty bizzare things. Some of our users were getting pretty weary of IE redrawing and "flashing" what is essentially a pretty static page every time...
1
by: dscriv | last post by:
Hello, I have Netscape 8.0.4 (in Firefox mode) and Flash 8.0.24.0. I also have IE and Firefox installed. If I go to this page, which contains a Flash detection movie:...
5
by: The Eclectic Electric | last post by:
I'm very noobish when it comes to Javascript, in fact I wasn't intending to use it at all, but I've got myself distracted by this "problem". I want to use an animated gif as my favicon. This...
8
by: Neo Geshel | last post by:
Greetings. BACKGROUND: My sites are pure XHTML 1.1 with CSS 2.1 for markup. My pages are delivered as application/xhtml+xml for all non-MS web clients, and as text/xml for all MS web...
1
by: critchey1 | last post by:
Hey everyone, i've been playing around with trying to get some scripts to work with detecting whether flash player is installed on your computer or not. I found a flash detection kit on the adobe...
0
by: DolphinDB | last post by:
Tired of spending countless mintues downsampling your data? Look no further! In this article, you’ll learn how to efficiently downsample 6.48 billion high-frequency records to 61 million...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
1
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
0
by: ArrayDB | last post by:
The error message I've encountered is; ERROR:root:Error generating model response: exception: access violation writing 0x0000000000005140, which seems to be indicative of an access violation...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome former...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.