Closed Bug 323553 Opened 19 years ago Closed 2 years ago

Save as Web Page, complete doesn't update the <param name="movie" .../> tag, therefore swf flash elements don't work in other browsers

Categories

(Firefox :: File Handling, defect)

defect
Not set
normal

Tracking

()

RESOLVED INCOMPLETE

People

(Reporter: sigurdb, Unassigned)

References

Details

Attachments

(1 file, 1 obsolete file)

User-Agent:       Mozilla/5.0 (Macintosh; U; PPC Mac OS X; en) AppleWebKit/417.9 (KHTML, like Gecko) Safari/417.8
Build Identifier: Mozilla/5.0 (Macintosh; U; PPC Mac OS X Mach-O; en-US; rv:1.9a1) Gecko/20060115 Firefox/1.6a1

when saving a webpage containing swf flash files via Save as -> Web Page, complete, the saved webpage doesn´t work in other webbrowsers. Firefox updates the <embed src="index.php_files/promoswf.swf" correctly to the new local path but keeps the <param name="movie" .../>unchanged.

<object  ... >
	<param name="movie" value="/Content.Node/promoswf.swf">
	<embed src="index.php_files/promoswf.swf"  ... >
</object>



Reproducible: Always
Blocks: 115634
Hardware Platform:	PC

Operating System:	Windows XP SP2

Build Identifier:
Mozilla/5.0 (Windows; U; Windows NT 5.1; en-US; rv:1.8.0.1) Gecko/20060123 Firefox/1.5.0.1

Reproducibility:	Happens Every Time.

Summary: Confirmed bug on latest available build on a Windows XP SP2 pc.  

Reproduction Steps
------------------
Navigated browser to "http://www.mrmass.com/RUBIES_OF_EVENTIDE/RubiesofEventide.htm" and selected “File” -> “Save Page As” from the menu bar. In the “Save Page As” dialog box select “Web Page, complete” from the “Save as type:” list box and select an empty folder to save the web page to.  Once complete, close Firefox and clear the cache to ensure a fresh load. Double click the RubiesofEventide.htm and ensure the flash animation plays as expected (note: depending on flash player security settings, a warning box may appear asking permission to run the .swf file). Now open the file in a different browser (I used IE 6.0) by right click on the RubiesofEvenTide.htm and selecting “Open With” from the context menu and select the desired browser.  Confirm that the Flash animation will not play.

Analysis
--------
By comparing the page source between the online page and the saved offline page, the cause of the bug can be found (note: line numbers have been added to ease readability).  Notice how in line 15 of the offline code “RubiesofEvenTide_files/” has been pre-appended to the location of the “rubies_of.swf” file; however, this pre-appending does not occur at line 11. If the source is modified so that line 11 reflects the needed path, the flash animation will play as expected in other browsers (for me IE 6.0).

Online Source Code
------------------
01| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
02| <html>
03| <head>
04| <title>Rubies of Eventide</title>
05| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
06| </head>
07|
08| <body bgcolor="#000000" LEFTMARGIN=0 TOPMARGIN=0 MARGINWIDTH=0 MARGINHEIGHT=0>
09| <div align="center">
10|  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" width="1024" height="768">
11|     <param name="movie" value="rubies_of.swf">
12|     <param name="quality" value="high">
13|     <param name=menu value=false>
14|     <param name=quality value=best>
15|     <embed src="rubies_of.swf" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" width="1024" height="768"></embed></object>
16| </div>
17| </body>
18| </html>

Offline Source Code
-------------------
01| <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
02| <html>
03| <head>
04| <title>Rubies of Eventide</title>
05| <meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
06| </head>
07|
08| <body leftmargin="0" topmargin="0" bgcolor="#000000" marginheight="0" marginwidth="0">
09|<div align="center">
10|  <object classid="clsid:D27CDB6E-AE6D-11cf-96B8-444553540000" codebase="http://download.macromedia.com/pub/shockwave/cabs/flash/swflash.cab#version=6,0,29,0" height="768" width="1024">
11|     <param name="movie" value="rubies_of.swf">
12|     <param name="quality" value="high">
13|     <param name="menu" value="false">
14|     <param name="quality" value="best">
15|     <embed src="RubiesofEventide_files/rubies_of.swf" quality="best" pluginspage="http://www.macromedia.com/go/getflashplayer" type="application/x-shockwave-flash" height="768" width="1024"></object>
16| </div>
17| </body>
18| </html>

Actual Results:
	11|	<param name=”movie” value=”rubies_of.swf”>
			.
			.
			.
	15|	<embed src=”RubiesofEventide_files/rubies_of.swf” …

Expected Results: 
	11|	<param name=”movie” value=”RubiesofEventide_files/rubies_of.swf”>
			.
			.
			.
	15|	<embed src=”RubiesofEventide_files/rubies_of.swf” …


Whiteboard: DUPEME
No dupeme exists in Bugzilla close enough to dupe this bug against.  Comfirming based on Greg's work.  Putting this back on the table.
Status: UNCONFIRMED → NEW
Component: General → Download Manager
Ever confirmed: true
Whiteboard: DUPEME
Putting this on the kitchen table with the other groceries, instead of the card table in the garage.
Assignee: nobody → file-handling
Component: Download Manager → File Handling
Product: Firefox → Core
QA Contact: general → ian
Version: unspecified → Trunk
Attached patch Patch v1 (obsolete) — Splinter Review
Patch fixes the problem for me - testcase used: http://www.slackingoff.net/play.php?id=4

Result before patch:
> <param name="movie" value="games/2deep/2deep.swf">

Result after:
> <param name="movie" value="play.php_files/2deep.swf">
Assignee: file-handling → sciguyryan+bugzilla
Status: NEW → ASSIGNED
Attachment #241984 - Flags: review?(bzbarsky)
Attachment #241984 - Attachment is obsolete: true
Attachment #241984 - Flags: review?(bzbarsky)
Uploaded the wrong patch last time - sorry for the bugspam.
Attachment #241988 - Flags: review?(bzbarsky)
Mm....  So how do we know that that for a <param> name="movie" means the value is a URI?  That might be true for Flash, but not in general, I would think.

There's _got_ to be a better solution here.  Maybe.

Note that the <object> tag in question is explicitly flagged as only working with a particular ActiveX Flash implementation; I don't really think we should be second-guessing it one way or another.
(In reply to comment #6)
> Mm....  So how do we know that that for a <param> name="movie" means the value
> is a URI?  That might be true for Flash, but not in general, I would think.
> There's _got_ to be a better solution here.  Maybe.
> Note that the <object> tag in question is explicitly flagged as only working
> with a particular ActiveX Flash implementation; I don't really think we should
> be second-guessing it one way or another.

So you would suggest checking the param's parent object tag to see if the classid matches that of Flash? If the problem is that it _may_ not be a URI couldn't there just be a check to make sure the value attribute is a valid URI before passing it for processing?
I'm not suggesting anything; I see no sane solutions here, since <param> elements may mean arbitrary things to arbitrary plugins.

I'm also not sure what "make sure the value attribute is a valid URI" gives you when we're talking about _relative_ URIs here.  Pretty much anything without spaces in it is a valid relative URI.
The solution is what MacIE did -- store all the data that you know got loaded by the page into a single archive file that uses the original URIs and postdata for keys, effectively "prefilling" the cache when it is opened such that it works exactly like it did the first time.

As a side-effect, having that implemented (where "that"="knowing what files a page needs around") will make doing Web Application cache pinning much easier.
Ian, in this case we don't so much know whether a URL pointed to by a <param> got "loaded by the page".  Especially since we're not actually processing that <object> tag -- we're displaying the fallback content.  If the <embed> URI happens to match, of course, it might happen to work, maybe.  Unless the plugin does loading on its own, bypassing our necko code...
Attachment #241988 - Flags: review?(bzbarsky) → review-
If the <param> element have an attribute valuetype="ref", we will be sure its value is URI.
Unfortunately, almost nobody uses the valuetype="ref"...
Assignee: sciguyryan → file-handling
Status: ASSIGNED → NEW
Summary: Save as Web Page, complete does´t update the <param name="movie" .../> tag, therefore swf flash elements don´t work in other browsers → Save as Web Page, complete doesn't update the <param name="movie" .../> tag, therefore swf flash elements don´t work in other browsers
Assignee: file-handling → nobody
QA Contact: ian → file-handling
Summary: Save as Web Page, complete doesn't update the <param name="movie" .../> tag, therefore swf flash elements don´t work in other browsers → Save as Web Page, complete doesn't update the <param name="movie" .../> tag, therefore swf flash elements don't work in other browsers
Product: Core → Firefox
Version: Trunk → unspecified

Flash is no longer supported

Status: NEW → RESOLVED
Closed: 2 years ago
Resolution: --- → INCOMPLETE
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Created:
Updated:
Size: