473,230 Members | 1,581 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,230 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 3530


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...
3
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 3 Jan 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). For other local times, please check World Time Buddy In...
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 7 Feb 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:30 (7.30PM). In this month's session, the creator of the excellent VBE...
0
by: fareedcanada | last post by:
Hello I am trying to split number on their count. suppose i have 121314151617 (12cnt) then number should be split like 12,13,14,15,16,17 and if 11314151617 (11cnt) then should be split like...
0
by: stefan129 | last post by:
Hey forum members, I'm exploring options for SSL certificates for multiple domains. Has anyone had experience with multi-domain SSL certificates? Any recommendations on reliable providers or specific...
0
Git
by: egorbl4 | last post by:
Скачал я git, хотел начать настройку, а там вылезло вот это Что это? Что мне с этим делать? ...
1
by: davi5007 | last post by:
Hi, Basically, I am trying to automate a field named TraceabilityNo into a web page from an access form. I've got the serial held in the variable strSearchString. How can I get this into the...
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
by: Aftab Ahmad | last post by:
Hello Experts! I have written a code in MS Access for a cmd called "WhatsApp Message" to open WhatsApp using that very code but the problem is that it gives a popup message everytime I clicked on...
0
by: Aftab Ahmad | last post by:
So, I have written a code for a cmd called "Send WhatsApp Message" to open and send WhatsApp messaage. The code is given below. Dim IE As Object Set IE =...

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.