Closed Bug 1270790 Opened 9 years ago Closed 9 years ago

Chrome <iframe mozbrowser> cannot load http/https sources

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set
normal

Tracking

()

RESOLVED WONTFIX

People

(Reporter: gerard-majax, Unassigned)

References

Details

(Whiteboard: btpp-followup-2016-05-13)

Attachments

(2 files)

STR: 0. Move mochitest to chrome mochitest 1. <iframe mozbrowser>.src = "http://example.org/" Expected: Page loads and we get load event Actual: Page does not load and we get no load event. Change <iframe mozbrowser>.src to some valid chrome:// URL and it works. Set the iframe as remote with "remote=true" and it works.
This simple test exposes the issue.
Attachment #8749594 - Flags: feedback?(jryans)
It looks like it even sometimes does only work from chrome with the mozbrowserloadend event, not load.
MozReview-Commit-ID: FyLboKvrLWd
Attachment #8749647 - Flags: feedback?(jryans)
Comment on attachment 8749594 [details] [diff] [review] <iframe mozbrower> load event triggering I am not a mozbrowser peer, so let's check with :kanru. I'll keep thinking about the problem as well.
Attachment #8749594 - Flags: feedback?(jryans) → feedback?(kchen)
Attachment #8749647 - Flags: feedback?(jryans) → feedback?(kchen)
Whiteboard: btpp-followup-2016-05-13
So does <iframe mozbrowser> when used in chrome create right kind of docshell?
(In reply to Olli Pettay [:smaug] from comment #5) > So does <iframe mozbrowser> when used in chrome create right kind of > docshell? How to check this? Compare the docshell object between an <iframe mozbrowser> used from chrome against one used from content? Any specific property to check against?
(In reply to Olli Pettay [:smaug] from comment #5) > So does <iframe mozbrowser> when used in chrome create right kind of > docshell? From reading the code, <iframe mozbrowser> always creates content docshells[1]: // Force mozbrowser frames to always be typeContent, even if the // mozbrowser interfaces are disabled. nsCOMPtr<nsIDOMMozBrowserFrame> mozbrowser = do_QueryInterface(mOwnerContent); if (mozbrowser) { bool isMozbrowser = false; mozbrowser->GetMozbrowser(&isMozbrowser); isContent |= isMozbrowser; } [1]: https://dxr.mozilla.org/mozilla-central/rev/e5a10bc7dac4ee2453d8319165c1f6578203eac7/dom/base/nsFrameLoader.cpp#562-570
That is good. I consider it a bug that xul:browser defaults to chrome docshell. Note, load event dispatching is different when crossing chrome boundary. the xul:browser/html:iframe in the boundary does _not_ get its own load event, but the load event propagates from the window object in side the sub-frame to the xul:browser/html:iframe. One needs to use capturing listener to catch it. This all in non-remote case of course. But I have no idea about page not loading issue here.
:gerard-majax, can you capture the load event with a capturing listener, `addEventListener("load", handler, true)`? In a recent test case I wrote, I used a frame script to listen for load in the child, and then sent a message back up to the parent with the message manager, as that seemed to be the most stable way to detect it. That may be another option here.
(In reply to J. Ryan Stinnett [:jryans] (use ni?) from comment #9) > :gerard-majax, can you capture the load event with a capturing listener, > `addEventListener("load", handler, true)`? > > In a recent test case I wrote, I used a frame script to listen for load in > the child, and then sent a message back up to the parent with the message > manager, as that seemed to be the most stable way to detect it. That may be > another option here. no, changing the addEventListener() does nothing.
Status: NEW → RESOLVED
Closed: 9 years ago
Resolution: --- → WONTFIX
Attachment #8749594 - Flags: feedback?(kchen)
Attachment #8749647 - Flags: feedback?(kchen)
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.

Attachment

General

Creator:
Created:
Updated:
Size: