Skip to content

Instantly share code, notes, and snippets.

@jfredrickson
Last active August 22, 2022 22:08
Show Gist options
  • Save jfredrickson/f5e5cb998d738552af53c144d9fb0082 to your computer and use it in GitHub Desktop.
Save jfredrickson/f5e5cb998d738552af53c144d9fb0082 to your computer and use it in GitHub Desktop.
Google Meet bookmarklet

This makes it easy to copy the phone number and PIN for a Google Meet.

Setup

  1. Copy the minified script below (it's easier to copy if you open the Raw version)
  2. Create a bookmark in your web browser
  3. In the bookmark URL field, paste the minified script

Usage

On the Ready to join? page before joining a Google Meet session, run the bookmarklet. A box should appear at the top right corner of the page with options to copy the phone number and PIN.

javascript:!function(){const e=[".controls {\n z-index: 999;\n position: absolute;\n top: 5px;\n right: 5px;\n background-color: #f0f0f0;\n border: 2px solid #e0e0e0;\n padding: 1em;\n }",".controlButton {\n padding: 0.5em 1em;\n }",".controlButton:active {\n background-color: #e0e0e0;\n }"],n=document.createElement("style");document.head.appendChild(n),e.forEach(((e,t)=>{n.sheet.insertRule(e,t)}));function t(e,n){const t=document.createElement("a");return t.classList.add("controlButton"),t.href="#",t.innerText=e,t.addEventListener("click",(e=>{e.preventDefault(),n()})),t}Array.from(document.querySelectorAll("button")).find((e=>e.innerText.match("Join and use a phone for audio"))).click(),setTimeout((()=>{const e=Array.from(document.querySelectorAll("div")),o=e.find((e=>e.innerText.match(/^\+1 [0-9]{3}-[0-9]{3}-[0-9]{4}$/))).innerText,r=e.find((e=>e.innerText.match(/^[0-9]{3} [0-9]{3} [0-9]{3}#$/))).innerText,d=document.createElement("div");d.classList.add("controls"),document.body.appendChild(d);const c=t(`Copy phone number (${o})`,(()=>{navigator.clipboard.writeText(o)}));d.appendChild(c);const i=t(`Copy PIN (${r})`,(()=>{navigator.clipboard.writeText(r)}));d.appendChild(i);const a=t("Close",(()=>{d.remove(),n.remove()}));d.appendChild(a)}),500)}();
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment