JangoSteve / remotipart

Rails jQuery file uploads via standard Rails "remote: true" forms.
http://os.alfajango.com/remotipart
Other
1k stars 215 forks source link

Make Firefox `load` again #165

Closed TALlama closed 8 years ago

TALlama commented 8 years ago

Firefox 49 changed their behavior such that <iframe>s with invalid src attributes never fire load events. This causes remotipart and its src="javascript:false" to never finish its setup, and because remotipart has already cancelled the ajax:aborted:file event, no submission is ever sent to the server.

This changes the src to the more-standard about:blank, which makes Firefox send load events like it used to.

Note that I also reported this bug to Mozilla: https://bugzilla.mozilla.org/show_bug.cgi?id=1307283

mshibuya commented 8 years ago

Thanks for your work!

StephaneRob commented 8 years ago

@TALlama @mshibuya actually it doesn't seem to work with src="about:blank;" (with semicolon) but looks good without semicolon src="about:blank". #163 #164

TALlama commented 8 years ago

@StephaneRob when does the semicolon version get used? On subsequent uploads after the first?

StephaneRob commented 8 years ago

@TALlama I think semicolon version should not be used with about:blank.

TALlama commented 8 years ago

@StephaneRob sure, but what does that break? When does that value matter?

TALlama commented 8 years ago

@StephaneRob okay, I see the issue, now; I left the semicolon in both places. Fixing…

StephaneRob commented 8 years ago

Thanks @TALlama, about:blank; (with semicolon) is just an invalid src.

TALlama commented 8 years ago

@StephaneRob see #166

praveenkumarsinha commented 8 years ago

Its still failing about:blank[;](with or without) in firefox 49.0 (ubuntu 16.04)

Its my bad.. i missed iframe = $("<iframe src='about:blank' name='" + name +

its working great now

TALlama commented 8 years ago

@praveenkumarsinha yes, see #166 for the fixed version, which is likely what you've replicated.