Skip to content

Instantly share code, notes, and snippets.

@mkanenobu
Last active January 24, 2022 22:01
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save mkanenobu/5cf6c2b3b580ba0c30814997cbf3fa51 to your computer and use it in GitHub Desktop.
Save mkanenobu/5cf6c2b3b580ba0c30814997cbf3fa51 to your computer and use it in GitHub Desktop.
Log google meet chat text.
var attribute = "data-sender-name";
// HACK
var getChatTextDoms = () =>
Array.prototype.slice
.call(document.querySelectorAll("*"))
.filter((el) => typeof el.attributes[attribute] !== "undefined");
var texts = getChatTextDoms();
var result = "";
Object.values(texts).forEach((textDom) => {
result += textDom.innerText + "\n\n";
});
window.prompt("Copy to clipboard: Ctrl+C, Enter", result);
// For bookmarklet
// javascript:var attribute="data-sender-name",getChatTextDoms=function(){return Array.prototype.slice.call(document.querySelectorAll("*")).filter(function(a){return"undefined"!==typeof a.attributes[attribute]})},texts=getChatTextDoms(),result="";Object.values(texts).forEach(function(a){result+=a.innerText+"\n\n"});window.prompt("Copy to clipboard: Ctrl+C, Enter",result);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment