DOMWindowCreated not fired for non chrome:// URLs in chrome docshell

NEW
Unassigned

Status

()

Core
DOM: Core & HTML
5 years ago
5 years ago

People

(Reporter: Matthew Gertner, Unassigned)

Tracking

Firefox Tracking Flags

(Not tracked)

Details

(Reporter)

Description

5 years ago
See http://mxr.mozilla.org/mozilla-central/source/dom/base/nsGlobalWindow.cpp#2378:

2378     if (itemType != nsIDocShellTreeItem::typeChrome ||
2379         nsContentUtils::IsSystemPrincipal(mDoc->NodePrincipal())) {
2380       newInnerWindow->mHasNotifiedGlobalCreated = true;
2381       nsContentUtils::AddScriptRunner(
2382         NS_NewRunnableMethod(this, &nsGlobalWindow::DispatchDOMWindowCreated));

Apparently the purpose of the if statement is to prevent about:blank from firing DOMWindowCreated in a chrome docshell. It has the (presumably unwanted) side effect of prevent DOMWindowCreated from being fired e.g. for resource:// URLs or custom protocol handlers.
Or any other sort of scheme!

Sicking, what was the actual intended behavior here?  Why is this code not checking for initial about:blank, or at least about:blank, if that's what it wants to suppress?
You need to log in before you can comment on or make changes to this bug.