From bcb7a08065e216e920a5ed51d51c00f8d4c49e79 Mon Sep 17 00:00:00 2001 From: Kyle Spearrin Date: Wed, 21 Aug 2019 20:44:23 -0400 Subject: [PATCH] downloader page cant use safari apis --- src/downloader/downloader.ts | 33 +-------------------------------- 1 file changed, 1 insertion(+), 32 deletions(-) diff --git a/src/downloader/downloader.ts b/src/downloader/downloader.ts index ab02de7e03..4c7473764e 100644 --- a/src/downloader/downloader.ts +++ b/src/downloader/downloader.ts @@ -1,34 +1,3 @@ document.addEventListener('DOMContentLoaded', () => { - const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 && - navigator.userAgent.indexOf('Chrome') === -1; - - if (!isSafari) { - return; - } - - safari.self.addEventListener('message', (msgEvent: any) => { - // tslint:disable-next-line - console.log('GOT MESSAGE'); - // tslint:disable-next-line - console.log(msgEvent); - doDownload(JSON.parse(msgEvent.message.msg)); - }, false); - - function doDownload(msg: any) { - if (msg.command === 'downloaderPageData' && msg.data) { - const blob = new Blob([msg.data.blobData], msg.data.blobOptions); - if (navigator.msSaveOrOpenBlob) { - navigator.msSaveBlob(blob, msg.data.fileName); - } else { - const a = document.createElement('a'); - a.href = URL.createObjectURL(blob); - a.download = msg.data.fileName; - document.body.appendChild(a); - a.click(); - document.body.removeChild(a); - } - } - - window.setTimeout(() => window.close(), 1500); - } + // TODO });