mirror of
https://github.com/the-djmaze/snappymail.git
synced 2026-11-03 02:48:49 +03:00
parent
9b17dd7d41
commit
1246a455f3
1 changed files with 12 additions and 1 deletions
|
|
@ -104,7 +104,18 @@ export class AttachmentModel extends AbstractModel {
|
|||
* @returns {boolean}
|
||||
*/
|
||||
pdfPreview() {
|
||||
return null != navigator.mimeTypes['application/pdf'] && FileType.Pdf === this.fileType;
|
||||
/**
|
||||
* navigator.pdfViewerEnabled is the supported way to ask this.
|
||||
* navigator.mimeTypes is deprecated and browsers now expose a PDF entry
|
||||
* there only while the built in viewer is on, so the old check quietly
|
||||
* returned false in cases where a preview would have worked and took
|
||||
* the eye badge with it.
|
||||
*/
|
||||
return FileType.Pdf === this.fileType
|
||||
&& (undefined !== navigator.pdfViewerEnabled
|
||||
? navigator.pdfViewerEnabled
|
||||
: null != navigator.mimeTypes['application/pdf']
|
||||
);
|
||||
}
|
||||
|
||||
/**
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue