Firefox for iOS does not fire a load event on an iframe element that does not have a src attribute.

RESOLVED DUPLICATE of bug 1261457

Status

()

Firefox for iOS
Browser
--
major
RESOLVED DUPLICATE of bug 1261457
2 years ago
2 years ago

People

(Reporter: chris, Assigned: st3fan)

Tracking

unspecified
Other
iOS

Firefox Tracking Flags

(fxios4.0+, fxios-v3.0 affected, fxios-v4.0 affected)

Details

(Reporter)

Description

2 years ago
User Agent: Mozilla/5.0 (Windows NT 10.0; WOW64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/49.0.2623.110 Safari/537.36

Steps to reproduce:

Our application utilises a rich text editor built around jQuery and unfortunately this implementation doesn't work in the iOS version of your Firefox browser:

```
var me = this;
this.$content = $('<iframe style="width: 100%;" frameborder="0"></iframe>').load(function()
{
	initFrame.call(me);
});
```

The key problem here is the load event does not fire. And the load event does not fire here because the iframe has no "src" attribute. If I were to add a "src" attribute, e.g. just pointing to a blank html file, the load event does fire.

This behaviour is totally different from how we have come to expect it to work in other browsers. Chrome and Safari on iOS work as expected. All of the other desktop browsers work as expected, too, including Firefox. I haven't yet tested this on the Android version of iOS.

It's worth noting that the iframe element does not need to have a src attribute in the HTML5 spec. I've also noted that the behaviour doesn't change when adding the srcdoc attribute.

This is also an issue in the Dolphin browser on iOS. FWIW I have created a test case here:

https://xenresources.com/dolphin.html

Note, this should be a completely blank page regardless, but if you visit on Firefox on iOS, nothing will happen. If you visit using any other browser you should get an alert that reads:

"load event fired on iframe"


Actual results:

The load event does not fire on an iframe element when the src attribute is empty or missing.


Expected results:

The load event should fire. A src attribute is not required according to the HTML spec.
(Reporter)

Updated

2 years ago
Severity: normal → critical
(Reporter)

Updated

2 years ago
Severity: critical → major
Thanks for the report. This is also not reproducible in Chrome on iOS (WKWebView).
Status: UNCONFIRMED → NEW
status-fxios-v3.0: --- → affected
status-fxios-v4.0: --- → affected
tracking-fxios: --- → ?
Ever confirmed: true
(Reporter)

Comment 2

2 years ago
(In reply to Aaron Train [:aaronmt] from comment #1)
> Thanks for the report. This is also not reproducible in Chrome on iOS
> (WKWebView).

I just want to clarify. This also was not reproducible in old Chrome on iOS (so before their recent upgrade to WKWebView).

It's interesting Chrome seemingly fixed it in the old UIWebView, but the fact it happens in Firefox and Dolphin does make me wonder if it's actually an Apple bug. I may be able to produce a test case for that, if necessary, and report to Apple, but certainly a workaround would be appreciated if one exists :)
(Assignee)

Updated

2 years ago
Assignee: nobody → sarentz
(Assignee)

Updated

2 years ago
tracking-fxios: ? → 4.0+
(Assignee)

Updated

2 years ago
Flags: needinfo?(sarentz)
(Assignee)

Comment 3

2 years ago
This bug is a duplicate of bug 1261457, which we will release as part of iOS 4.0.

Chris, we are also trying to figure out if this bug warrants a quicker 3.1 bugfix release. Can you give us an indication of urgency? Is using about:blank or frames without a src a very common technique?
Status: NEW → RESOLVED
Last Resolved: 2 years ago
Flags: needinfo?(sarentz) → needinfo?(chris)
Resolution: --- → DUPLICATE
Duplicate of bug: 1261457
(Reporter)

Comment 4

2 years ago
Hi Stefan

Apologies for the dupe report. I had a search but missed it as I was searching for the cause rather than the effect. 

The author of that report is actually one of our customers. I'm a developer of XenForo, they are a user of the XenForo software. 

This issue effects every XenForo customer so it has the potential to be fairly significant. That said, we've only received one report so far. Is this a fairly new bug? We were somewhat surprised we hadn't seen it reported before. 

In terms of your wider user base it can potentially be an issue with any rich text editor, but I think I've specifically only seen it in the Redactor editor (the old version, versions 8-10).

Incidentally we've worked around it in XF 1.5.8 (eta 4-6 weeks away). Thankfully you append FxiOS X.X to the UA string so we can disable the editor for Firefox but obviously this isn't an ideal user experience, though better than literally nothing! 

Chris
Flags: needinfo?(chris)
(Reporter)

Comment 5

2 years ago
Stefan,

I made a comment on the PR that fixes this regarding maybe special casing javascript: too.

Further, I have checked some of the other rich text editors, CKEditor, TinyMCE and Froala and none of them seem to be affected because none of them rely on the load event. It's true that they all tend to rely on either a blank src, no src, or about:blank / javascript: but they don't necessarily rely on the load event on the iframe. This reduces the scope to any application that implements the Redactor I editor which is a fairly popular choice.

Chris
You need to log in before you can comment on or make changes to this bug.