Repository navigation
app: add will-download event to defaultSession - #2650
Conversation
|
Great. 👍 |
d144e9d to
e6a5933
Compare
|
The download manager is session wide, so one download from one WebContents will be populated to all WebContents in current implementation. We can probably make it an event of app.defaultSession.on 'will-download', (event, webContents, item) ->
console.log(item.url, item.mimeType, item.filename); |
|
Adding this event to webview doesn't make much sense, because we can not prevent the default action in webview (renderer's callback is always called asynchronously). |
|
Also we need to remove |
e6a5933 to
aed487e
Compare
|
@zcbenz have made the changes. |
There was a problem hiding this comment.
ObjectTemplateBuilder creates a new ObjectTemplate every time and the call is very expensive, we should just use Dictionary in this case.
|
@deepak1556 You're most awesome! Thanks for looking into this for us. |
There was a problem hiding this comment.
The g_wrap_session should be called in Session::CreateFrom, and _setWrapSession should be implemented in atom_api_session.cc too, so we don't have to call it for every place that creates a session.
Also I still prefer implementing DefaultSession in C++, it would be very helpful when we need to get it in C++ code.
There was a problem hiding this comment.
if _setWrapSession is implemented in atom_api_session.cc then have to expose session as a builtin module to use on the js side, is that correct ? and yeah that would help us calling it in one place.
There was a problem hiding this comment.
Yeah we can expose it as a builtin module, but we should keep it undocumented for now before we have full support for multi-session.
cf77fd5 to
4062ca5
Compare
|
Thanks! |
…atch app: add will-download event to defaultSession
Fixes #2491