(_window, _document, _navigator)
| 426 | </svg></div></div>` |
| 427 | |
| 428 | async function copyToClipboard(_window, _document, _navigator) { |
| 429 | const email = _document.querySelector(EMAIL_CLASS) |
| 430 | if (email) { |
| 431 | const selection = _window?.getSelection()?.selectAllChildren(email) |
| 432 | |
| 433 | await _navigator.clipboard.writeText(email.textContent || '') |
| 434 | // Unselect text |
| 435 | _window.getSelection()?.removeAllRanges() |
| 436 | |
| 437 | const divContainer = _document.querySelector(`#${CLIPBOARD_CONTAINER_DIV_ID}`) |
| 438 | |
| 439 | if (divContainer) { |
| 440 | // Replace element with our other one |
| 441 | divContainer.outerHTML = copiedCheckMarkHTML |
| 442 | } |
| 443 | } |
| 444 | } |
| 445 | |
| 446 | function registerCopyToClipboardEventListener(_window, _document, _navigator, divElement) { |
| 447 | divElement.addEventListener('click', () => { |
no outgoing calls
no test coverage detected