How can I disable the native file save dialog for particular file types?



I am trying to integrate pdf.js library with my electron app. However, when the application/pdf content is detected in my app; it shows me the native file save dialog. Is there any way I can disable this dialog (only for pdf files and not for other files like .docx or .xml or etc.) so that I can gracefully open the pdf file in my pdf.js viewer without having to click on “Cancel” button in the dialog every time.



Refer to this thread for knowing further on this issue: