mirror of
https://github.com/PR0M3TH3AN/bitvid.git
synced 2026-11-03 19:35:28 +00:00
Refactor clipboard copy to use navigator.clipboard API
- Replaced deprecated `document.execCommand("copy")` with `navigator.clipboard.writeText` in `EmbedVideoModal.js`.
- Simplified fallback mechanism in `EmbedVideoModal.js` to select text and prompt user for manual copy.
- Removed `document.execCommand("copy")` fallback in `LoginModalController.js` and updated tests.
- Added unit tests for `EmbedVideoModal` copy functionality.
- Updated `LoginModalController` tests to cover NIP-46 copy button behavior.
Co-authored-by: PR0M3TH3AN <[email protected]>
This commit is contained in:
1 parent
84e7f50f96
commit
24290d4c19
4 files changed
+284
-17
No files matched your search
@@ -1550,11 +1550,8 @@ export default class LoginModalController {
|
||||
if (!copied && handshakeInput.select) {
|
||||
try {
|
||||
handshakeInput.select();
|
||||
if (this.document?.execCommand) {
|
||||
copied = this.document.execCommand("copy");
|
||||
}
|
||||
} catch (error) {
|
||||
copied = false;
|
||||
// ignore
|
||||
}
|
||||
}
|
||||
if (copied) {
|
||||
|
||||
Reference in new issue
Block a user