Skip to content

Instantly share code, notes, and snippets.

@valioDOTch
Last active February 2, 2024 08:36
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save valioDOTch/51b875732bfe02b39d340e5e8ad364cd to your computer and use it in GitHub Desktop.
Save valioDOTch/51b875732bfe02b39d340e5e8ad364cd to your computer and use it in GitHub Desktop.
Miro share project board bookmarklet
/*
* Code for a bookmarklet to get a shareable link to Miro project
*
* installation: use the URL of this Gist on https://www.yourjs.com/bookmarklet/ to add a Bookmarklet to your browser bar.
*
* usage: click on the bookmarklet, after opening up a Miro project.
* it will add a link icon (🔗) on the right hand side of the project title (next to the ➕ plus icon)
* When you click on the link, a dialog appears that provides you with a URL to share in chats or emails.
* Be aware that this might break.
*
* last working test: 13th of July 2022
*
* authors: Pat Mächler
* license: CC-0
*
*/
let dashboardData = JSON.parse(localStorage["rtb_saved_dashboard"]).tree.dashboard;
let href="https://miro.com/app/dashboard/?spaceId="+dashboardData.currentSpaceId+"&projectId="+dashboardData.currentProject.id;
let link=document.createElement("a");
link.innerText="🔗";
link.href ="#";
link.addEventListener("click",()=>{window.prompt("Copy this link to share this project",href);});
document.getElementsByTagName("project-header")[0].childNodes[0].childNodes[0].appendChild(link);
@icyerasor
Copy link

Great Share, Thanks!
L23 isn't working anymore though: Uncaught TypeError: document.getElementsByTagName(...)[0] is undefined?

document.querySelector('[aria-label="Edit project"]').appendChild(link); does work.
as does
document.querySelector('[aria-label="Edit project"]').parentNode.parentNode.appendChild(link); to have it at the back again.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment