Skip to content

Instantly share code, notes, and snippets.

@raindev
Last active February 18, 2021 16:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save raindev/01b8a8e3381f3f1103d4d2329c182704 to your computer and use it in GitHub Desktop.
Save raindev/01b8a8e3381f3f1103d4d2329c182704 to your computer and use it in GitHub Desktop.
A JS bookmarklet to get URLs of Google Chat threads
javascript:(function() {
Array.from(document.getElementsByTagName('c-wiz'))
.map(tag => ({
threadId: tag.getAttribute('data-topic-id'),
firstMessage: tag.children[0].getAttribute('aria-label')
}))
.filter(thread => thread.threadId != null && thread.firstMessage != null)
.forEach(thread => console.log(window.location.href + '/' + thread.threadId
+ " : " + thread.firstMessage))
}())
@raindev
Copy link
Author

raindev commented Feb 8, 2021

Create a browser bookmark with URL set to the content of the file. Open the bookmark when a tab with Google Chat room is active and it will print the results to the browser console.

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