Closed Bug 347736 Opened 18 years ago Closed 17 years ago

Plugin is not loaded if served as text/plain

Categories

(Core Graveyard :: Plug-ins, defect)

x86
All
defect
Not set
normal

Tracking

(Not tracked)

RESOLVED FIXED

People

(Reporter: martijn.martijn, Assigned: Biesinger)

References

()

Details

(Keywords: regression, testcase)

Attachments

(2 files, 1 obsolete file)

See url, in current trunk builds, I get to see the plugin placeholder, while in current branch builds, the windows media player starts playing.
I think this is a regression from bug 1156.
Between 2005-09-21 and 2005-09-23, it stopped working entirely, because of bug 1156, and when it started working again after a month or so, I get to see the plugin placeholder.

I've tested this with a new profile.

This is what I have in about:plugins
Windows Media Player Plug-in Dynamic Link Library

    File name: npdsplay.dll


    Npdsplay dll

MIME Type 	Description 	Suffixes 	Enabled
application/asx 	Media Files 	* 	Yes
video/x-ms-asf-plugin 	Media Files 	* 	Yes
application/x-mplayer2 	Media Files 	* 	Yes
video/x-ms-asf 	Media Files 	asf,asx,* 	Yes
video/x-ms-wm 	Media Files 	wm,* 	Yes
audio/x-ms-wma 	Media Files 	wma,* 	Yes
audio/x-ms-wax 	Media Files 	wax,* 	Yes
video/x-ms-wmv 	Media Files 	wmv,* 	Yes
video/x-ms-wvx 	Media Files 	wvx,* 	Yes
If I add  type="application/x-mplayer2" to the <embed> tag, then it also works on trunk:
http://wargers.org/mozilla/bug344865/testmovie2.htm
I think this is what causes the videos not to display at this site (and instead show the plugin placeholder):
http://www.filecabi.net/u.php?file=1123299797.wmv
the URL from the URL field and filecabi.net work for me... could you, in a debug build, make a log with NSPR_LOG_MODULES=objlc:5?
(In reply to comment #3)
> the URL from the URL field and filecabi.net work for me... could you, in a
> debug build, make a log with NSPR_LOG_MODULES=objlc:5?

0[3f4488]: OBJLC [1076f28c]: Loading object: URI string=<testmovie.wmv> notify=0
 type=<> forceload=0
0[3f4488]: OBJLC [1076f28c]: Loading object: URI=<103f0908> notify=0 type=<> for
ceload=0
0[3f4488]: OBJLC [1076f28c]: Capabilities: 002b
0[3f4488]: OBJLC [1076f28c]: Channel opened.
0[3f4488]: WARNING: XPCOM objects created/destroyed from static ctor/dtor: 'gAct
ivityTLS != BAD_TLS_INDEX && NS_PTR_TO_INT32(PR_GetThreadPrivate(gActivityTLS))
== 0', file c:/mozilla/mozilla/xpcom/base/nsTraceRefcntImpl.cpp, line 971
WARNING: XPCOM objects created/destroyed from static ctor/dtor: 'gActivityTLS !=
 BAD_TLS_INDEX && NS_PTR_TO_INT32(PR_GetThreadPrivate(gActivityTLS)) == 0', file
 c:/mozilla/mozilla/xpcom/base/nsTraceRefcntImpl.cpp, line 971
0[3f4488]: OBJLC [1076f28c]: OnStartRequest: Content Type=<text/plain> Old type=
0 New Type=4
0[3f4488]: OBJLC [1076f28c]: Unsupported type, falling back
0[3f4488]: OBJLC [1076f28c]: Falling back (Notify=0)
0[3f4488]: OBJLC []: Dispatching PluginNotFound event for content 1076f270
0[3f4488]: OBJLC [1076f28c]: Notifying about state change: (0, 100000) -> (4, 22
0000) (sync=0)
0[3f4488]: OBJLC []: Firing plugin not found event for content 1076f270
--DOMWINDOW == 6

I get that, is that what you wanted?
yeah, thanks. hm... I wonder why this is working for me... and I also wonder whether this is a bug...
oh, haha. Because I'm using seamonkey and the code thinks it loads then nullplugin...
Assignee: nobody → cbiesinger
*** Bug 350958 has been marked as a duplicate of this bug. ***
Going to http://www.newgrounds.com/portal/view/315702 and clicking on Play this game works. It uses javascript to load the game. http://www.thatvideogamesite.com/play.php?id=392 fails. It uses <embed src='http://www.thatvideogamesite.com:81/9b3b8da48ffa550e514f7efc6f8b2424.swf' width='700' height='525' quality='high' loop='false' AllowScriptAccess='never' >
I haven't downloaded the files to make sure they are identical, but it's the same game.
"uses javascript" is kind of misleading. it eventually uses an embed tag too:
<OBJECT width="700" height="525" id="FlashContent" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=8,0,22,0" classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000"><PARAM value="http://uploads.ungrounded.net/315000/315702_3d_logic.swf" name="movie"/><PARAM value="high" name="quality"/><PARAM value="never" name="AllowScriptAccess"/><EMBED width="700" height="525" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" allowscriptaccess="never" name="FlashContent" quality="high" src="http://uploads.ungrounded.net/315000/315702_3d_logic.swf"/></OBJECT>

note that it has a type attribute. Going to look at the other one now...
oh. that was Bug 350958. why mention it again?
Because that bug was marked a duplicate of this bug, so to my understanding they're the same bug, and the only reason that one was resolved is that it was a duplicate of this bug, and so it makes sense to me that here is where further developments should go.

I found a case where what should end up with the same or similar result ends up in a different result, one being the correct result and thought that that might narrow down where the break lies.
ah... ok. I think at this point the only issue in this bug is figuring out exactly what the right behaviour here is.
Flags: blocking1.9?
If markup used to work but no longer does that seems bad, no?
Flags: blocking1.9? → blocking1.9+
OS: Windows XP → All
Summary: Windows media player is not invoked anymore with this testcase → Plugin is not loaded if served as text/plain
So is this basically the

278   // XXX do plugins expect to work via extension too?

comment in IsSupportedPlugin()?
Attached file testcase
This works on branch, but not on trunk.
Blocks: 387188
Attached patch patch (obsolete) — Splinter Review
Can we have regression tests depending on plugins?
Attachment #272696 - Flags: superreview?(bzbarsky)
Attachment #272696 - Flags: review?(bzbarsky)
Comment on attachment 272696 [details] [diff] [review]
patch

>Index: nsObjectLoadingContent.cpp
>+GetExtensionFromURI(nsIURI* uri, nsCString& ext)

So what are these non-nsIURL usecases? External protocol service stuff, I guess, that would be parsed as an nsIURL if we had a handler for it?

>+  if ((caps & eOverrideServerType) && (!aTypeHint.IsEmpty() ||
>+      (aURI && IsPluginEnabledByExtension(aURI, overrideType)))) {

Please indent this as:

  if ((caps & eOverrideServerType) && 
      (!aTypeHint.IsEmpty() ||
       (aURI && IsPluginEnabledByExtension(aURI, overrideType)))) {

I think that's much clearer.

Can we assert that either aTypeHint or overrideType is empty inside the body there?  In fact, I would expect exactly one of them to be empty here.  Please assert that.

The rest looks good, though it might be nice to have curlies around the single-line if/else bodies.

r+sr=bzbarsky with the nits picked.

As for tests, see bug 386676 and bug 372352.  Maybe just file a followup on tests for this and mark it dependent?
Attachment #272696 - Flags: superreview?(bzbarsky)
Attachment #272696 - Flags: superreview+
Attachment #272696 - Flags: review?(bzbarsky)
Attachment #272696 - Flags: review+
(In reply to comment #19)
> So what are these non-nsIURL usecases? External protocol service stuff, I
> guess, that would be parsed as an nsIURL if we had a handler for it?

If you mean "why do I hand-parse the spec" - I just moved that code, originally from nsObjectFrame.cpp, now from Instantiate().

I'll fix the rest.
Attached patch final patchSplinter Review
Attachment #272696 - Attachment is obsolete: true
Checking in nsObjectLoadingContent.cpp;
/cvsroot/mozilla/content/base/src/nsObjectLoadingContent.cpp,v  <--  nsObjectLoadingContent.cpp
new revision: 1.48; previous revision: 1.47
done

filed Bug 388684 for tests
Status: NEW → RESOLVED
Closed: 17 years ago
Resolution: --- → FIXED
Depends on: 427524
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: