Created
October 3, 2024 14:59
-
-
Save unrevised6419/279d82e12686da4e365ad28512fe47d1 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
let key = document.querySelector(`[data-testid="issue.views.issue-base.foundation.breadcrumbs.current-issue.item"]`).textContent; | |
let title = document.querySelector(`[data-testid="issue.views.issue-base.foundation.summary.heading"]`).textContent; | |
let link = document.querySelector(`[data-testid="issue.views.issue-base.foundation.breadcrumbs.current-issue.item"]`).href; | |
let date = new Date().toLocaleDateString('it-IT'); | |
let textMessage = `🔵 [${key}] - ${title} - ${date}`; | |
let htmlMessage = `🔵 [<a href="${link}">${key}</a>] - ${title} - ${date}`; | |
let textBlob = new Blob([textMessage], { type: 'text/plain' }); | |
let htmlBlob = new Blob([htmlMessage], { type: 'text/html' }); | |
let clipboardItem = new ClipboardItem({ [textBlob.type]: textBlob, [htmlBlob.type]: htmlBlob }); | |
globalThis.navigator.clipboard.write([clipboardItem]); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment