mirror of
https://github.com/bitwarden/browser
synced 2025-12-12 06:13:38 +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>
|
<key>Script</key>
|
||||||
<string>app/content/shortcuts.js</string>
|
<string>app/content/shortcuts.js</string>
|
||||||
</dict>
|
</dict>
|
||||||
<dict>
|
|
||||||
<key>Script</key>
|
|
||||||
<string>app/content/downloader.js</string>
|
|
||||||
</dict>
|
|
||||||
</array>
|
</array>
|
||||||
<key>SFSafariToolbarItem</key>
|
<key>SFSafariToolbarItem</key>
|
||||||
<dict>
|
<dict>
|
||||||
|
|||||||
@@ -94,11 +94,6 @@ const plugins = [
|
|||||||
filename: 'notification/bar.html',
|
filename: 'notification/bar.html',
|
||||||
chunks: ['notification/bar']
|
chunks: ['notification/bar']
|
||||||
}),
|
}),
|
||||||
new HtmlWebpackPlugin({
|
|
||||||
template: './src/downloader/index.html',
|
|
||||||
filename: 'downloader/index.html',
|
|
||||||
chunks: ['downloader/downloader'],
|
|
||||||
}),
|
|
||||||
new CopyWebpackPlugin([
|
new CopyWebpackPlugin([
|
||||||
'./src/manifest.json',
|
'./src/manifest.json',
|
||||||
{ from: './src/_locales', to: '_locales' },
|
{ from: './src/_locales', to: '_locales' },
|
||||||
@@ -145,11 +140,9 @@ const config = {
|
|||||||
'background': './src/background.ts',
|
'background': './src/background.ts',
|
||||||
'content/autofill': './src/content/autofill.js',
|
'content/autofill': './src/content/autofill.js',
|
||||||
'content/autofiller': './src/content/autofiller.ts',
|
'content/autofiller': './src/content/autofiller.ts',
|
||||||
'content/downloader': './src/content/downloader.ts',
|
|
||||||
'content/notificationBar': './src/content/notificationBar.ts',
|
'content/notificationBar': './src/content/notificationBar.ts',
|
||||||
'content/shortcuts': './src/content/shortcuts.ts',
|
'content/shortcuts': './src/content/shortcuts.ts',
|
||||||
'notification/bar': './src/notification/bar.js',
|
'notification/bar': './src/notification/bar.js',
|
||||||
'downloader/downloader': './src/downloader/downloader.ts',
|
|
||||||
},
|
},
|
||||||
optimization: {
|
optimization: {
|
||||||
minimize: false,
|
minimize: false,
|
||||||
|
|||||||
Reference in New Issue
Block a user