From 345a28490a26f136fac5e31e675dbc2e5990184c Mon Sep 17 00:00:00 2001 From: Henri Sivonen Date: Wed, 2 Sep 2020 09:27:36 +0000 Subject: [PATCH] Bug 1662103 - Make .close() a no-op on OOP iframes. r=farre Differential Revision: https://phabricator.services.mozilla.com/D88983 --- docshell/base/BrowsingContext.cpp | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/docshell/base/BrowsingContext.cpp b/docshell/base/BrowsingContext.cpp index 771999ae6bca..e326d815008c 100644 --- a/docshell/base/BrowsingContext.cpp +++ b/docshell/base/BrowsingContext.cpp @@ -1835,6 +1835,11 @@ void BrowsingContext::Close(CallerType aCallerType, ErrorResult& aError) { return; } + if (IsFrame()) { + // .close() on frames is a no-op. + return; + } + if (GetDOMWindow()) { nsGlobalWindowOuter::Cast(GetDOMWindow()) ->CloseOuter(aCallerType == CallerType::System);