Skip to content

Instantly share code, notes, and snippets.

@Pezmc
Created July 26, 2019 11:49
Show Gist options
  • Save Pezmc/982377cf62e40d26429418848abfdf3d to your computer and use it in GitHub Desktop.
Save Pezmc/982377cf62e40d26429418848abfdf3d to your computer and use it in GitHub Desktop.
Bookmarklet to get the current Basecamp URL as a helpful markdown link
function copytext(a) {
var b = document.createElement("textarea");
b.innerText = a, document.body.appendChild(b), b.select(), document.execCommand("copy"), b.remove()
}
parts = new Set();
parts.add(document.querySelector('meta[name="current-bucket-name').content);
parts.add(document.querySelector('meta[name="current-dock-tool-title"]').content);
parts.add(document.querySelector('meta[name="current-recording-title"]').content);
page_name = Array.from(parts).join(" › ");
copytext(`[${page_name}](${window.location})`);
@Pezmc
Copy link
Author

Pezmc commented Jul 26, 2019

Ready to use:

javascript:void function(){function e(e){var t=document.createElement("textarea");t.innerText=e,document.body.appendChild(t),t.select(),document.execCommand("copy"),t.remove()}parts=new Set,parts.add(document.querySelector('meta[name="current-bucket-name').content),parts.add(document.querySelector('meta[name="current-dock-tool-title"]').content),parts.add(document.querySelector('meta[name="current-recording-title"]').content),page_name=Array.from(parts).join(" › "),e(`[${page_name}](${window.location})`)}();

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