mirror of
https://github.com/bitwarden/browser
synced 2026-01-09 12:03:33 +00:00
fix edge support
This commit is contained in:
@@ -2,16 +2,14 @@ document.addEventListener('DOMContentLoaded', () => {
|
||||
const isSafari = (typeof safari !== 'undefined') && navigator.userAgent.indexOf('Safari') !== -1 &&
|
||||
navigator.userAgent.indexOf('Chrome') === -1;
|
||||
|
||||
if (isSafari) {
|
||||
safari.self.addEventListener('message', (msgEvent: any) => {
|
||||
doDownload(msgEvent.message);
|
||||
}, false);
|
||||
} else if (navigator.userAgent.indexOf(' Edge/') !== -1) {
|
||||
chrome.runtime.onMessage.addListener((msg: any, sender: any, sendResponse: any) => {
|
||||
doDownload(msg);
|
||||
});
|
||||
if (!isSafari) {
|
||||
return;
|
||||
}
|
||||
|
||||
safari.self.addEventListener('message', (msgEvent: any) => {
|
||||
doDownload(msgEvent.message);
|
||||
}, false);
|
||||
|
||||
function doDownload(msg: any) {
|
||||
if (msg.command === 'downloaderPageData' && msg.data) {
|
||||
const blob = new Blob([msg.data.blobData], msg.data.blobOptions);
|
||||
|
||||
Reference in New Issue
Block a user