Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix: session argument of app 'session-created' event #25798

Merged
merged 1 commit into from
Oct 8, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
4 changes: 4 additions & 0 deletions lib/browser/api/app.ts
Original file line number Diff line number Diff line change
Expand Up @@ -135,6 +135,10 @@ for (const name of events) {
});
}

app.on('-session-created' as any, (event, session) => {
app.emit('session-created', session);
});

// Deprecate allowRendererProcessReuse but only if they set it to false, no need to log if
// they are setting it to true
deprecate.removeProperty(app, 'allowRendererProcessReuse', [false]);
3 changes: 1 addition & 2 deletions shell/browser/api/electron_api_session.cc
Original file line number Diff line number Diff line change
Expand Up @@ -950,8 +950,7 @@ gin::Handle<Session> Session::CreateFrom(
ElectronBrowserMainParts::Get()->RegisterDestructionCallback(
base::BindOnce([](Session* session) { delete session; }, handle.get()));

App::Get()->EmitCustomEvent("session-created",
handle.ToV8().As<v8::Object>());
App::Get()->Emit("-session-created", handle.ToV8().As<v8::Object>());

return handle;
}
Expand Down