8000 Better callback value for webContents.print() · Issue #18980 · electron/electron · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content
Better callback value for webContents.print() #18980
Closed
@popod

Description

@popod

Preflight Checklist

  • I have read the Contributing Guidelines for this project.
  • I agree to follow the Code of Conduct that this project adheres to.
  • I have searched the issue tracker for an issue that matches the one I want to file, without success.

Issue Details

  • Electron Version: 5.0.5
  • Operating System: macOS Mojave 10.14.5 / Windows too ?
  • Last Known Working Electron version: not known

Expected Behavior

When using webContents.print(), if the user click the cancel button on the print dialog (or on the "PDF" button) this should: return a callback value of "false" (error) or "true" (success), but with more details that only "true" or "false". Something like an error/success message that tell that the cancel button has been clicked..

This could be:

  • success when the document is sent to the printer
  • cancelled when the cancel button is clicked
  • pdf / other-action? when the PDF button is clicked
  • failed when an error occurs

Actual Behavior

In my application, I only want to display a success notification to the user when the print process is successfully launched and an error message when they is an error. For now, false-positive notifications are display when :

  • the cancel button is clicked on the print dialog (return is false), we do not know if it is an error or a cancel event and when an error occurs (return is false too), we do not know if it is an error or a cancel event.
  • the "PDF" button (only on macOS?) is clicked (return is true) and we would know if this is a print success or something else to display a "successfully print" notification to the user.

Not tested, but Windows should have the same problem !


Perhaps linked with #15568 but more specific ?
@codebytere perhaps something that is linked with #17400

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions

    0