diff --git a/atom/browser/api/atom_api_web_contents.cc b/atom/browser/api/atom_api_web_contents.cc index 287fc18ac7..b63dd97f1e 100644 --- a/atom/browser/api/atom_api_web_contents.cc +++ b/atom/browser/api/atom_api_web_contents.cc @@ -2030,6 +2030,20 @@ mate::Handle WebContents::FromTabID(v8::Isolate* isolate, void WebContents::OnTabCreated(const mate::Dictionary& options, base::Callback callback, content::WebContents* tab) { + node::Environment* env = node::Environment::GetCurrent(isolate()); + if (!env) { + return; + } + + auto event = v8::Local::Cast( + mate::Event::Create(isolate()).ToV8()); + + mate::EmitEvent(isolate(), + env->process_object(), + "on-tab-created", + tab, + options); + bool active = true; options.Get("active", &active);