1
0
mirror of https://github.com/bitwarden/browser synced 2025-12-16 08:13:42 +00:00

Fix "copy link to clipboard" for large file Sends (#949)

* Throw error if execCommand('copy') is disabled

* Use dialog for file Send creation success

* Show popup modal after long Send file uploads

* fix linting

* bump jslib
This commit is contained in:
Thomas Rittson
2021-04-28 07:40:36 +10:00
committed by GitHub
parent dd56c9bc87
commit b3a4f833a1
3 changed files with 16 additions and 2 deletions

View File

@@ -245,7 +245,10 @@ export class WebPlatformUtilsService implements PlatformUtilsService {
textarea.select();
try {
// Security exception may be thrown by some browsers.
doc.execCommand('copy');
const copyEnabled = doc.execCommand('copy');
if (!copyEnabled) {
throw new Error('Command unsupported or disabled');
}
} catch (e) {
// tslint:disable-next-line
console.warn('Copy to clipboard failed.', e);