Closed Bug 137856 Opened 22 years ago Closed 22 years ago

javascript does not correctly detect flash and forward url

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED WORKSFORME

People

(Reporter: mozbugzilla2021, Assigned: arun)

References

()

Details

(Whiteboard: [flash])

From Bugzilla Helper:
User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.0; en-US; rv:0.9.9+)
Gecko/20020415
BuildID:    2002041503

When going to a website created with, what I believe, is Dreamweaver, and it
requires Flash and/or Director, and it has a Flash check written by the "coders"
at Macromedia, it does nothing, rather than forwarding to the site, even if
Flash is installed. Regardless of whether this is a bug in the Javascript engine
or if it's just terrible code (I vote for the latter), something needs to be
fixed or a workaround needs to be made for this specific problem, as,
unfortunately, there are a LOT of websites created with WYSIWYG editors that
output poor code like this.

Reproducible: Always
Steps to Reproduce:
Go to site. See it not load.

Actual Results:  No loading of site.

Expected Results:  Loaded the site (by fowarding to the URL the Javascript
specified).

This happens both with and without 'allow new windows to be opened with
javascript' checked. Also happens at http://www.sputnik7.com. Still, this could
be a problem with the popup remover -- it should only remove popups, not also
remove Javascript redirects within the site.

And, err, sorry about the bad write-up; there isn't a whole lot of info to go on.

Here's the bad code:

<html>
<head>
<title>Welcome to Monte Cristo website</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<script language="JavaScript">
<!--
function MM_checkPlugin(plgIn, theURL, altURL, autoGo) { //v4.0
  var ok=false; document.MM_returnValue = false;
  with (navigator) if (appName.indexOf('Microsoft')==-1 || (plugins &&
plugins.length)) {
    ok=(plugins && plugins[plgIn]);
  } else if (appVersion.indexOf('3.1')==-1) { //not Netscape or Win3.1
    if (plgIn.indexOf("Flash")!=-1 && window.MM_flash!=null) ok=window.MM_flash;
    else if (plgIn.indexOf("Director")!=-1 && window.MM_dir!=null) ok=window.MM_dir;
    else ok=autoGo; }
  if (!ok) theURL=altURL; if (theURL) window.location=theURL;
}
//-->
</script>
</head>

<body bgcolor="#000000"                                                        
                                             >
</body><script> window.open=NS_ActualOpen; </script>

<script name="Used by MM_checkPlugin" language="javascript">
<!--
with (navigator) if (appName.indexOf('Microsoft')!=-1 &&
appVersion.indexOf('Mac')==-1) document.write(''+
'<scr'+'ipt language="VBScript">\nOn error resume next\n'+
'MM_dir = IsObject(CreateObject("SWCtl.SWCtl.1"))\n'+
'MM_flash = NOT
IsNull(CreateObject("ShockwaveFlash.ShockwaveFlash"))\n</scr'+'ipt>');
//-->
</script>
</html>
to plugins
Assignee: rogerl → beppe
Component: JavaScript Engine → Plug-ins
QA Contact: pschwartau → shrir
bad  coding on websites calls for the mighty evangelism assistance in guiding 
these people to write healthy code. Susie, could you pls take a look? Thx!
I am not JS-savvy, but in case you didn't know, Flash still does not support
scriptability with Gecko. This is a change that Macromedia needs to make in the
product and Arun is evangelizing them on this. 

If you can tell that's what they're doing please mark this invalid.
Assigning to Arun in case he has a chance to take a look.
Assignee: beppe → aruner
Whiteboard: [flash]
WFM, win98, build 2002041718

The code isn't related to scriptability between Flash and Gecko. It just uses
the navigator.plugins array to see if it has one named "Shockwave Flash", it's
just the typical code to detect plugins.

Colin Snover: does the Flash plugin appears if you type about:plugins in the url
bar?
Yes, both "Shockwave Flash" (5.0 r41) and "Shockwave for Director" (8.5) are
listed in about:plugins. Flash works fine on sites that don't have this code on
them.
The page loads fine for me on Mac OS X using Mozilla 1.1a.
WFM. Mozilla 1.0.

Marking as such.
Status: UNCONFIRMED → RESOLVED
Closed: 22 years ago
Resolution: --- → WORKSFORME
This was a problem with Zone Labs ZoneAlarm. Apologies.
v
Status: RESOLVED → VERIFIED
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.