Closed Bug 115519 Opened 23 years ago Closed 23 years ago

navigator.plugins["Shockwave Flash"] always returns null on Japanese

Categories

(Core Graveyard :: Plug-ins, defect)

defect
Not set
normal

Tracking

(Not tracked)

VERIFIED FIXED
mozilla0.9.8

People

(Reporter: kazhik, Assigned: ftang)

References

Details

Attachments

(2 files, 1 obsolete file)

navigator.plugins["Shockwave Flash"] returns null even if Shockwave Flash
is installed.

http://developer.netscape.com/docs/manuals/js/client/jsref/plugin.htm
navigator.plugins["Shockwave Flash"] does not return null for me on WinXP in
recent nightlies and in build 2001120603. What build are you using?

navigator.plugins["Shockwave"] == null, but this is the same behavior as 4.x.

2001121608/Win2k shows the testcase as follows.

***********************************
name description filename length
Shockwave Flash Shockwave Flash 5.0 r41 G:\Mozilla\bin\plugins\NPSWF32.dll 2
QuickTime Plug-in 5.0.2 The QuickTime Plugin allows you to view a wide variety
of multimedia content in Web pages. For more information, visit the QuickTime
Web site. G:\Mozilla\bin\plugins\npqtplugin5.dll 5
QuickTime Plug-in 5.0.2 The QuickTime Plugin allows you to view a wide variety
of multimedia content in Web pages. For more information, visit the QuickTime
Web site. G:\Mozilla\bin\plugins\npqtplugin4.dll 6
QuickTime Plug-in 5.0.2 The QuickTime Plugin allows you to view a wide variety
of multimedia content in Web pages. For more information, visit the QuickTime
Web site. G:\Mozilla\bin\plugins\npqtplugin3.dll 3
QuickTime Plug-in 5.0.2 The QuickTime Plugin allows you to view a wide variety
of multimedia content in Web pages. For more information, visit the QuickTime
Web site. G:\Mozilla\bin\plugins\npqtplugin2.dll 6
QuickTime Plug-in 5.0.2 The QuickTime Plugin allows you to view a wide variety
of multimedia content in Web pages. For more information, visit the QuickTime
Web site. G:\Mozilla\bin\plugins\npqtplugin.dll 6
Java Plug-in Java Plug-in 1.3.0_01 for Netscape Navigator (DLL Helper)
G:\Mozilla\bin\plugins\NPOJI600.dll 1
Mozilla Default Plug-in Default Plug-in G:\Mozilla\bin\plugins\npnul32.dll 1
Java Plug-in Java Plug-in 1.3.0_01 for Netscape Navigator (DLL Helper)
G:\Mozilla\bin\plugins\NPJava130_01c.dll 6
Java Plug-in Java Plug-in 1.3.0_01 for Netscape Navigator (DLL Helper)
G:\Mozilla\bin\plugins\NPJava130_01b.dll 6
Java Plug-in Java Plug-in 1.3.0_01 for Netscape Navigator (DLL Helper)
G:\Mozilla\bin\plugins\NPJava130_01a.dll 6
Java Plug-in Java Plug-in 1.3.0_01 for Netscape Navigator (DLL Helper)
G:\Mozilla\bin\plugins\NPJava130_01.dll 2

navigator.mimeTypes["application/x-shockwave-flash"] != null

navigator.plugins["Shockwave Flash"] == null

navigator.plugins["Shockwave"] == null

navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin != null
name description filename length
Shockwave Flash Shockwave Flash 5.0 r41 G:\Mozilla\bin\plugins\NPSWF32.dll 2
***********************************
Same build ID:
http://ftp.mozilla.org/pub/mozilla/nightly/2001-12-16-11-trunk/mozilla-win32.zip
...but it seems to work for me on WinXP. I will try on another machine tomorrow,
can you as well?

name description filename length
Adobe Acrobat Adobe Acrobat Plug-In Version 5.00 for Netscape C:\Program
Files\Netscape\Communicator\Program\Plugins\nppdf32.dll 1
Shockwave for Director Macromedia Shockwave for Director Netscape plug-in,
version 8.5 C:\Program Files\Netscape\Communicator\Program\Plugins\np32dsw.dll 1
Shockwave Flash Shockwave Flash 5.0 r41 C:\Documents and
Settings\peterlubczynski\Desktop\mozilla-win32\bin\plugins\npswf32.dll 2
Mozilla Default Plug-in Default Plug-in C:\Documents and
Settings\peterlubczynski\Desktop\mozilla-win32\bin\plugins\npnul32.dll 1

navigator.mimeTypes["application/x-shockwave-flash"] != null

navigator.plugins["Shockwave Flash"] != null

navigator.plugins["Shockwave"] == null

navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin != null
name description filename length
Shockwave Flash Shockwave Flash 5.0 r41 C:\Program
Files\Netscape\Communicator\Program\Plugins\npswf32.dll 2

==============
Hm...actually, I wonder if it's Quicktime that's getting in the way. Quicktime 5
can play Flash files. What happens if Quicktime and/or other plugins are removed?
> What happens if Quicktime and/or other plugins are removed?

I removed Java plugin and quicktime plugin, and got the same result.
I tried this testcase on winNT, 98,XP, placed the flash plugin in every possible 
location, used the same build(as well as 1217 commercial trunk) Peter has 
mentioned here....but I 'never see' 'navigator.plugins["Shockwave Flash"]  
returning NULL. 
We found this is a locale problem.
if LC_ALL is C, navigator.plugins["Shockwave Flash"] returns non-null.
if LC_ALL is ja_JP.eucJP, navigator.plugins["Shockwave Flash"] returns null.
cc:ing ftang for advice

What is LC_ALL?
LC_ALL is environment variable for locale setting.

You can change your locale setting on control panel. Maybe your 
current setting is English.
KOIKE Kazuhiko 2001-12-21 15:18 ---
Are you on Linux? can you reproduce this on Window or Mac ?
We can always reproduce this on Japanese environments of Win2k, 98, NT, Mac,
Linux and Free BSD.
This problem occurrs in Mozilla 0.9.6 and later.

And Netscape 4.7/Mac shows testcase2 as follows.
-----
navigator.plugins's properties
 Headspace Beatnik Helper Stub Plugin V1.0.1 
                                                  [object Plugin] 
                 Default Plug-in 
                                                  [object Plugin] 
                  iTools Plug In 
                                                  [object Plugin] 
            Shockwave for Director 
                                                  [object Plugin] 
                   PDFViewer 
                                                  [object Plugin] 
            QuickTime Plug-in 5.0.2 
                                                  [object Plugin] 
                Shockwave Flash 
                                                  [object Plugin] 
-----

But Mozilla 2001122508/Mac shows like this.
-----
navigator.plugins's properties
length 6
item function item() { [native code] }
namedItem function namedItem() { [native code] }
refresh function refresh() { [native code] }
-----
Attached file testcase2
Mistake.  
I'm so sorry for confusing you.

On 2001122507/FreeBSD 4.4-RELEASE,
if LANG is C, navigator.plugins["Default Plugin"] returns non-null.
If LANG is ja_JP.EUC, navigator.plugins["Default Plugin"] returns null.

But Netscape 4.72/FreeBSD shows testcase2 as follows in either case,
navigator.plugins["Default Plugin"] == null
navigator.plugins["Shockwave Flash"] != null 

The trouble with us is that some Web site detects browser by using
navigator.plugins["Shockwave Flash"].

Sorry for my poor English too.
on my redhat 7.2 
if "setenv LANG C" and then run mozilla, navigator.plugins["Default Plugin"]
returns non-null.
If "setenv LANG ja_JP" and then run mozilla, navigator.plugins["Default Plugin"]
returns null.

on my redhat 7.2 
if "setenv LANG ko_KR" and then run mozilla, navigator.plugins["Default Plugin"]
returns non-null.
if "setenv LANG zh_CN" and then run mozilla, navigator.plugins["Default Plugin"]
returns non-null.
if "setenv LANG zh_TW" and then run mozilla, navigator.plugins["Default Plugin"]
returns non-null.
if "setenv LANG fr_FR" and then run mozilla, navigator.plugins["Default Plugin"]
returns non-null.
if "setenv LANG de_DE" and then run mozilla, navigator.plugins["Default Plugin"]
returns non-null.

notice, all other locale have no problem, just Japanese one have problem on my
Japanse RedHat7.2
Could be a overlocalization problem 

on my japanese linux redhat 7.2

1. setenv LANG C; setenv LC_CTYPE ja_JP return == null
2. setenv LANG ja_JP; setenv LC_CTYPE C return != null
I think the problem is string comparision 
ok, I find out what happen
the DoCharsetConversion in the nsPluginHostImpl.cpp propagate one SUCCESS code
that nsIUnicodeDecoder return (which is not NS_OK) and confused the
code in nsPluginArray.cpp
Not sure why the Japanese converter reutrn that success code. 
0x50000d

This is a unicode conversion problem . reassign to ftang
Assignee: av → ftang
Status: NEW → ASSIGNED
Summary: navigator.plugins["Shockwave Flash"] always returns null → navigator.plugins["Shockwave Flash"] always returns null on Japanese
Target Milestone: --- → mozilla0.9.8
what happen is our japanese converter reutrn more buffer success code too often.
We should only return that code when 
1. we have not read all the source
2. and the mState is not 0.
In other word, if we already read all source and the mState is 0, we should
imply return NS_OK.
Blocks: 104056
the patch pass my buffer test
http://warp/u/ftang/utf8test/buffer.cgi
The patch looks perfectly fine to me in logic. But the code can 
be written as follows, it should be more readable and faster.
   return NS_OK;
 error1:
    *aDestLen = dest-aDest;
-   *aSrcLen = src-(unsigned char*)aSrc;
-   return NS_OK_UDEC_MOREOUTPUT;
+   src++;
+   if((mState == 0) && (src == srcEnd)) {
+     return NS_OK;
+   } else {
+     *aSrcLen = src - aSrc;
+     return NS_OK_UDEC_MOREOUTPUT;
+   }
 }
shanjian- you are right :)
Attachment #62888 - Attachment is obsolete: true
Attached patch patch v2Splinter Review
I tried the patch on Linux and didn't find a problem.
qa-> IQA:teruko
QA Contact: shrir → teruko
frank, else can be omitted because previous if is a return. But I don't think
it will make any difference to compiler. So either way, r=shanjian
Right; I have a slight preference for :

 error1:
    *aDestLen = dest-aDest;
-   *aSrcLen = src-(unsigned char*)aSrc;
-   return NS_OK_UDEC_MOREOUTPUT;
+   src++;
+   if ((mState == 0) && (src == srcEnd))
+     return NS_OK;
+  
+   *aSrcLen = src - (const unsigned char*)aSrc;
+   return NS_OK_UDEC_MOREOUTPUT;
}

Either way, sr=sfraser
Blocks: 104060
No longer blocks: 104056
fix and check in
Status: ASSIGNED → RESOLVED
Closed: 23 years ago
Resolution: --- → FIXED
Changed QA contact to ruixu@netscape.com.
QA Contact: teruko → ruixu
No longer blocks: 104060
Verify fixed with trunk build 2002-01-08 on Windows (9x, NT, 2K and XP), Linux 
and Mac(Classic and X).
Status: RESOLVED → VERIFIED
*** Bug 45359 has been marked as a duplicate of this bug. ***
Product: Core → Core Graveyard
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: