- Paste one of these into https://caiorss.github.io/bookmarklet-maker/
- Click "Generate Bookmarklet"
- Click and drag the blue thing into your bookmarks bar
Last active
January 27, 2025 19:32
-
-
Save locofocos/3fbe5dc0c3683eaf99a5fa2c63f14360 to your computer and use it in GitHub Desktop.
Asana bookmarklets
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
document.querySelector('.PageToolbarStructure-rightChildren .ProjectPageToolbarHiddenChildrenWhenNoTasks-child div[role="button"]').click(); | |
setTimeout(() => { | |
Array.from(document.querySelectorAll('.MultiFilterQuickFiltersRefreshed-content .QuickFilterButton')).find((e) => e.innerText == 'Just my tasks').click(); | |
document.querySelector('.PageToolbarStructure-rightChildren .ProjectPageToolbarHiddenChildrenWhenNoTasks-child div[role="button"]').click(); | |
}, 50) |
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
// copy pretty asana link to clipboard | |
// so you can paste a link into Slack, and people can see the task title without leaving the conversation | |
async function copyHyperlinkToClipboard(title, url) { | |
if (!title || !url) { | |
console.error("Both title and URL are required."); | |
return; | |
} | |
// Generate the HTML anchor element as a string | |
const html = `<a href="${url}" target="_blank" rel="noopener noreferrer">${title}</a>`; | |
try { | |
// Create a Blob containing the HTML | |
const blobHtml = new Blob([html], { type: 'text/html' }); | |
const blobPlain = new Blob([title], { type: 'text/plain' }); | |
// Create a ClipboardItem | |
const clipboardItem = new ClipboardItem({ 'text/html': blobHtml, 'text/plain': blobPlain }); | |
// Write to the clipboard | |
await navigator.clipboard.write([clipboardItem]); | |
console.log("HTML hyperlink copied to clipboard!"); | |
} catch (error) { | |
console.error("Failed to copy to clipboard:", error); | |
} | |
} | |
copyHyperlinkToClipboard(document.querySelector("[aria-label='Task Name'").innerHTML, window.location.href); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment