mirror of
https://github.com/bitwarden/browser.git
synced 2024-11-06 09:20:43 +01:00
hide file download features on edge
This commit is contained in:
parent
751281a59c
commit
bf703b6880
@ -1,8 +1,9 @@
|
|||||||
angular
|
angular
|
||||||
.module('bit.tools')
|
.module('bit.tools')
|
||||||
|
|
||||||
.controller('toolsController', function ($scope, SweetAlert, i18nService, $analytics) {
|
.controller('toolsController', function ($scope, SweetAlert, i18nService, $analytics, utilsService) {
|
||||||
$scope.i18n = i18nService;
|
$scope.i18n = i18nService;
|
||||||
|
$scope.showExport = !utilsService.isEdge();
|
||||||
$scope.launchWebVault = function (createOrg) {
|
$scope.launchWebVault = function (createOrg) {
|
||||||
$analytics.eventTrack('Launch Web Vault' + (createOrg ? ' For Share' : ''));
|
$analytics.eventTrack('Launch Web Vault' + (createOrg ? ' For Share' : ''));
|
||||||
chrome.tabs.create({ url: 'https://vault.bitwarden.com/#/' + (createOrg ? '?org=free' : '') });
|
chrome.tabs.create({ url: 'https://vault.bitwarden.com/#/' + (createOrg ? '?org=free' : '') });
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
.module('bit.tools')
|
.module('bit.tools')
|
||||||
|
|
||||||
.controller('toolsExportController', function ($scope, $state, toastr, $q, $analytics,
|
.controller('toolsExportController', function ($scope, $state, toastr, $q, $analytics,
|
||||||
i18nService, cryptoService, userService, folderService, loginService) {
|
i18nService, cryptoService, userService, folderService, loginService, $window) {
|
||||||
$scope.i18n = i18nService;
|
$scope.i18n = i18nService;
|
||||||
|
|
||||||
$('#master-password').focus();
|
$('#master-password').focus();
|
||||||
@ -89,16 +89,21 @@
|
|||||||
|
|
||||||
function downloadFile(csvString) {
|
function downloadFile(csvString) {
|
||||||
var csvBlob = new Blob([csvString]);
|
var csvBlob = new Blob([csvString]);
|
||||||
if (window.navigator.msSaveOrOpenBlob) {
|
var fileName = makeFileName();
|
||||||
window.navigator.msSaveBlob(csvBlob, makeFileName());
|
|
||||||
|
if ($window.navigator.msSaveOrOpenBlob) {
|
||||||
|
// Currently bugged in Edge. See
|
||||||
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8178877/
|
||||||
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8477778/
|
||||||
|
$window.navigator.msSaveBlob(csvBlob, fileName);
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
var a = window.document.createElement('a');
|
var a = $window.document.createElement('a');
|
||||||
a.href = window.URL.createObjectURL(csvBlob, { type: 'text/plain' });
|
a.href = $window.URL.createObjectURL(csvBlob, { type: 'text/plain' });
|
||||||
a.download = makeFileName();
|
a.download = fileName;
|
||||||
document.body.appendChild(a);
|
$window.document.body.appendChild(a);
|
||||||
a.click();
|
a.click();
|
||||||
document.body.removeChild(a);
|
$window.document.body.removeChild(a);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -35,7 +35,7 @@
|
|||||||
<span class="text">{{i18n.importLogins}}</span>
|
<span class="text">{{i18n.importLogins}}</span>
|
||||||
<span class="detail">{{i18n.importLoginsInfo}}</span>
|
<span class="detail">{{i18n.importLoginsInfo}}</span>
|
||||||
</a>
|
</a>
|
||||||
<a class="list-section-item wrap" ui-sref="export({animation: 'in-slide-up'})">
|
<a class="list-section-item wrap" ui-sref="export({animation: 'in-slide-up'})" ng-if="showExport">
|
||||||
<span class="leading-icon" style="color: #ff6f6f;"><i class="fa fa-cloud-download fa-fw"></i></span>
|
<span class="leading-icon" style="color: #ff6f6f;"><i class="fa fa-cloud-download fa-fw"></i></span>
|
||||||
<span class="text">{{i18n.exportVault}}</span>
|
<span class="text">{{i18n.exportVault}}</span>
|
||||||
<span class="detail">{{i18n.exportVaultInfo}}</span>
|
<span class="detail">{{i18n.exportVaultInfo}}</span>
|
||||||
|
@ -4,6 +4,7 @@ angular
|
|||||||
.controller('vaultEditLoginController', function ($scope, $state, $stateParams, loginService, folderService,
|
.controller('vaultEditLoginController', function ($scope, $state, $stateParams, loginService, folderService,
|
||||||
cryptoService, $q, toastr, SweetAlert, utilsService, $analytics, i18nService) {
|
cryptoService, $q, toastr, SweetAlert, utilsService, $analytics, i18nService) {
|
||||||
$scope.i18n = i18nService;
|
$scope.i18n = i18nService;
|
||||||
|
$scope.showAttachments = !utilsService.isEdge();
|
||||||
var loginId = $stateParams.loginId;
|
var loginId = $stateParams.loginId;
|
||||||
var fromView = $stateParams.fromView;
|
var fromView = $stateParams.fromView;
|
||||||
var from = $stateParams.from;
|
var from = $stateParams.from;
|
||||||
|
@ -4,6 +4,7 @@ angular
|
|||||||
.controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, toastr, $q,
|
.controller('vaultViewLoginController', function ($scope, $state, $stateParams, loginService, toastr, $q,
|
||||||
$analytics, i18nService, utilsService, totpService, $timeout, tokenService, $window, cryptoService, SweetAlert) {
|
$analytics, i18nService, utilsService, totpService, $timeout, tokenService, $window, cryptoService, SweetAlert) {
|
||||||
$scope.i18n = i18nService;
|
$scope.i18n = i18nService;
|
||||||
|
$scope.showAttachments = !utilsService.isEdge();
|
||||||
var from = $stateParams.from,
|
var from = $stateParams.from,
|
||||||
totpInterval = null;
|
totpInterval = null;
|
||||||
|
|
||||||
@ -143,12 +144,20 @@ angular
|
|||||||
}).then(function (decBuf) {
|
}).then(function (decBuf) {
|
||||||
var blob = new Blob([decBuf]);
|
var blob = new Blob([decBuf]);
|
||||||
|
|
||||||
var a = $window.document.createElement('a');
|
if ($window.navigator.msSaveOrOpenBlob) {
|
||||||
a.href = $window.URL.createObjectURL(blob);
|
// Currently bugged in Edge. See
|
||||||
a.download = attachment.fileName;
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8178877/
|
||||||
$window.document.body.appendChild(a);
|
// https://developer.microsoft.com/en-us/microsoft-edge/platform/issues/8477778/
|
||||||
a.click();
|
$window.navigator.msSaveBlob(csvBlob, attachment.fileName);
|
||||||
$window.document.body.removeChild(a);
|
}
|
||||||
|
else {
|
||||||
|
var a = $window.document.createElement('a');
|
||||||
|
a.href = $window.URL.createObjectURL(blob);
|
||||||
|
a.download = attachment.fileName;
|
||||||
|
$window.document.body.appendChild(a);
|
||||||
|
a.click();
|
||||||
|
$window.document.body.removeChild(a);
|
||||||
|
}
|
||||||
|
|
||||||
$timeout(function () {
|
$timeout(function () {
|
||||||
attachment.downloading = false;
|
attachment.downloading = false;
|
||||||
|
@ -57,7 +57,7 @@
|
|||||||
<label for="favorite">{{i18n.favorite}}</label>
|
<label for="favorite">{{i18n.favorite}}</label>
|
||||||
<input id="favorite" name="Favorite" type="checkbox" ng-model="login.favorite">
|
<input id="favorite" name="Favorite" type="checkbox" ng-model="login.favorite">
|
||||||
</div>
|
</div>
|
||||||
<a class="list-section-item" href="#" stop-click ng-click="attachments()">
|
<a class="list-section-item" href="#" stop-click ng-click="attachments()" ng-if="showAttachments">
|
||||||
{{i18n.attachments}}
|
{{i18n.attachments}}
|
||||||
<i class="fa fa-chevron-right"></i>
|
<i class="fa fa-chevron-right"></i>
|
||||||
</a>
|
</a>
|
||||||
|
@ -76,7 +76,7 @@
|
|||||||
<div class="list-section-item pre">{{login.notes}}</div>
|
<div class="list-section-item pre">{{login.notes}}</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
<div class="list-section" ng-if="isPremium && login.attachments && login.attachments.length">
|
<div class="list-section" ng-if="showAttachments && isPremium && login.attachments && login.attachments.length">
|
||||||
<div class="list-section-header">
|
<div class="list-section-header">
|
||||||
{{i18n.attachments}}
|
{{i18n.attachments}}
|
||||||
</div>
|
</div>
|
||||||
|
Loading…
Reference in New Issue
Block a user