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

browser: provide a default filename when unable to generate from download data #7169

merged 3 commits into from Sep 16, 2016


None yet
3 participants

deepak1556 commented Sep 10, 2016

Also we didn't handle alt+click on links with no download attribute, chrome downloads for that gesture but we generate a new-window event. This patch fixes it in a separate commit, can be reverted if not desired.

Fixes #7151

@@ -404,6 +404,11 @@ void WebContents::OnCreateWindow(const GURL& target_url,
content::WebContents* WebContents::OpenURLFromTab(
content::WebContents* source,
const content::OpenURLParams& params) {
if (params.disposition == SAVE_TO_DISK) {

This comment has been minimized.


zcbenz Sep 16, 2016


This changes current behavior and not all users want to have the ability download things from the app, we can probably just make it explicit in the new-window event and document it.

This comment has been minimized.


deepak1556 Sep 16, 2016


Fixed, thanks!


zcbenz approved these changes Sep 16, 2016

@zcbenz zcbenz merged commit 9dad947 into electron:master Sep 16, 2016

0 of 2 checks passed

continuous-integration/appveyor/pr AppVeyor build failed
continuous-integration/travis-ci/pr The Travis CI build failed

This comment has been minimized.


kevinsawicki commented Sep 16, 2016

Looks like the spec introduced here is consistently failing on AppVeyor with the following error:

not ok 253 session module DownloadItem can generate a default filename
  AssertionError: 'download' == 'download.pdf'
      at EventEmitter.<anonymous> (C:\projects\electron\spec\api-session-spec.js:333:18)
      at EventEmitter.g (events.js:286:16)
      at emitMany (events.js:127:13)
      at EventEmitter.emit (events.js:201:7)

It doesn't appear to be failing though on our internal Windows build machines which is really strange.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment