1
0
mirror of https://github.com/bitwarden/browser.git synced 2024-12-22 16:29:09 +01: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>

View File

@ -94,11 +94,6 @@ const plugins = [
filename: 'notification/bar.html',
chunks: ['notification/bar']
}),
new HtmlWebpackPlugin({
template: './src/downloader/index.html',
filename: 'downloader/index.html',
chunks: ['downloader/downloader'],
}),
new CopyWebpackPlugin([
'./src/manifest.json',
{ from: './src/_locales', to: '_locales' },
@ -145,11 +140,9 @@ const config = {
'background': './src/background.ts',
'content/autofill': './src/content/autofill.js',
'content/autofiller': './src/content/autofiller.ts',
'content/downloader': './src/content/downloader.ts',
'content/notificationBar': './src/content/notificationBar.ts',
'content/shortcuts': './src/content/shortcuts.ts',
'notification/bar': './src/notification/bar.js',
'downloader/downloader': './src/downloader/downloader.ts',
},
optimization: {
minimize: false,