fix: child window may have opener removed (#38910)

This commit is contained in:
Cheng Zhao 2023-06-27 06:04:54 +09:00 committed by GitHub
parent ff6d0df2d5
commit 09669f9d21
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 18 additions and 1 deletions

View file

@ -63,7 +63,7 @@ void ElectronRenderFrameObserver::DidClearWindowObject() {
// Check DidInstallConditionalFeatures below for the background.
auto* web_frame =
static_cast<blink::WebLocalFrameImpl*>(render_frame_->GetWebFrame());
if (has_delayed_node_initialization_ && web_frame->Opener() &&
if (has_delayed_node_initialization_ &&
!web_frame->IsOnInitialEmptyDocument()) {
v8::Isolate* isolate = blink::MainThreadIsolate();
v8::HandleScope handle_scope(isolate);