Skip to content

Instantly share code, notes, and snippets.

@cowboy
Created April 13, 2013 02:59
Show Gist options
  • Save cowboy/5376701 to your computer and use it in GitHub Desktop.
Save cowboy/5376701 to your computer and use it in GitHub Desktop.
jQuery: "export" Facebook messenger logs to console
// todo: find way to load jQuery into a FB page without getting the "Refused to
// load the script because it violates the following Content Security Policy" error
// step 1
document.getElementById("webMessengerRecentMessages").innerHTML
// step 2
$(".-cx-PRIVATE-uiImageBlock__content").each(function() {
var name = $(this).find(".-cx-PRIVATE-webMessengerMessageGroup__authorName").text();
$(this).find(".-cx-PRIVATE-webMessengerMessageGroup__message p").each(function() {
console.log("<" + name + "> " + $(this).text());
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment