mirror of
https://github.com/electron/electron.git
synced 2026-01-25 07:18:18 -05:00
Destroy web contents when preventing default
This commit is contained in:
@@ -419,9 +419,11 @@ void WebContents::AddNewContents(content::WebContents* source,
|
||||
v8::Locker locker(isolate());
|
||||
v8::HandleScope handle_scope(isolate());
|
||||
auto api_web_contents = CreateFrom(isolate(), new_contents);
|
||||
Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
|
||||
if (Emit("-add-new-contents", api_web_contents, disposition, user_gesture,
|
||||
initial_rect.x(), initial_rect.y(), initial_rect.width(),
|
||||
initial_rect.height());
|
||||
initial_rect.height())) {
|
||||
api_web_contents->DestroyWebContents();
|
||||
}
|
||||
}
|
||||
|
||||
content::WebContents* WebContents::OpenURLFromTab(
|
||||
|
||||
Reference in New Issue
Block a user