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:
@@ -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);
|
||||
});
|
||||
@@ -1,3 +0,0 @@
|
||||
document.addEventListener('DOMContentLoaded', () => {
|
||||
// TODO
|
||||
});
|
||||
@@ -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>
|
||||
@@ -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>
|
||||
|
||||
Reference in New Issue
Block a user