Skip to content

Download attribute on link elements not working inside of webview #1909

Closed

Description

@stefanjudis

Thanks for the nice project, folks.

I'm using electron to wrap our web application in a webview and distribute this application this way.

Unfortunately we discovered that links with the download attribute don't work.

E.g. http://davidwalsh.name/demo/html5-download.php

Works perfectly fine in Chrome but unfortunately does not inside of the webview in electron.

I digged the issues already and couldn't find any information on this specific case.

Any ideas on this are more than welcome. :bowtie:

Thanks. :)

Activity

  1. steelbrain commented on Jun 9, 2015

    @steelbrain
    Contributor

    I am not sure if downloads of any kind are implemented at the moment.

  2. stefanjudis commented on Jun 9, 2015

    @stefanjudis
    Author

    Okay, is there a getting started guide out there?

    If it's desired to have this behavior I might spend some time digging into it. :)

  3. zcbenz commented on Jun 10, 2015

    @zcbenz
    Contributor

    Currently you have to hook to the click event of the link and use http module together with fs to save the file to user's disk.

  4. straccio commented on Jun 10, 2015

    @straccio

    I have the same need (download a file from the renderer), i have currently implemented a download function like your suggestion using IPC in order to permit the renderer to ask to the main process to download a file by passing the URL, but the request need to be authenticated through session and cookie, there is a way to share the session and the cookie? Or using one chromium Download Manager plugin?

    Best regards

    Solved passing cookies to the main process from the renderer.
    But i have found something else.... If in the main browserWindow from the dev tool i execute "window.location.assign(urlToPdfFile)' the window show the pdf file after the download because the disposition is inline, but if i do the same thing through window.open or by the main process through opening another BrowserWindow the page is blank.

  5. changed the title [-]Download attribute on link elements not working[/-] [+]Download attribute on link elements not working inside of webview[/+] on Jun 15, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions