1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-17 16:53:34 +00:00

remove old downloader page/script

This commit is contained in:
Kyle Spearrin
2019-08-23 09:58:48 -04:00
parent c132ba1642
commit cedca132f6
5 changed files with 0 additions and 58 deletions

View File

@@ -1,34 +0,0 @@
document.addEventListener('DOMContentLoaded', (event) => {
const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf(' Safari/') !== -1 &&
navigator.userAgent.indexOf('Chrome') === -1;
if (!isSafari) {
return;
}
safari.self.addEventListener('message', (msgEvent: any) => {
const msg = JSON.parse(msgEvent.message.msg);
if (msg.command === 'downloaderPageData') {
let data: any = msg.data.blobData;
if (msg.data.blobOptions == null || msg.data.blobOptions.type !== 'text/plain') {
const binaryString = window.atob(msg.data.blobData);
const bytes = new Uint8Array(binaryString.length);
for (let i = 0; i < binaryString.length; i++) {
bytes[i] = binaryString.charCodeAt(i);
}
data = bytes.buffer;
}
const blob = new Blob([data], 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);
}
}
}, false);
});

View File

@@ -1,3 +0,0 @@
document.addEventListener('DOMContentLoaded', () => {
// TODO
});

View File

@@ -1,10 +0,0 @@
<!DOCTYPE html>
<html>
<head>
<title>Downloading File</title>
<meta charset="utf-8" />
</head>
<body style="padding: 30px; text-align: center; font-family: Arial; font-size: 18px;">
<div id="dl-message">Downloading...</div>
</body>
</html>

View File

@@ -53,10 +53,6 @@
<key>Script</key>
<string>app/content/shortcuts.js</string>
</dict>
<dict>
<key>Script</key>
<string>app/content/downloader.js</string>
</dict>
</array>
<key>SFSafariToolbarItem</key>
<dict>