Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-47732

Request Feature: Support attribute 'download' at 'a' tag in WebView

    XMLWordPrintable

Details

    • Suggestion
    • Resolution: Incomplete
    • Not Evaluated
    • None
    • 5.4.2, 5.5.0
    • WebView
    • None
    • qwebview. Windows

    Description

      I use this javascript code to save my data from page:

      function download(filename, text) {
      var pom = document.createElement('a');
      pom.setAttribute('href', 'data:text/plain;charset=utf-8,' + encodeURIComponent(text));
      pom.setAttribute('download', filename);

      if (document.createEvent)

      { var event = document.createEvent('MouseEvents'); event.initEvent('click', true, true); pom.dispatchEvent(event); }

      else

      { pom.click(); }

      }

      This code set preferred filename in 'download' attribute.
      When I download file from page preferred filename (data from 'download' attribute) will be lost.

      I cannot get it from any properties of object QNetworkRequest.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            stromme Christian
            Yaroslav Yaroslav
            Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved:

              Gerrit Reviews

                There are no open Gerrit changes