Skip to content

Instantly share code, notes, and snippets.

@MrOrz
Created April 18, 2012 11:36
Show Gist options
  • Save MrOrz/2413022 to your computer and use it in GitHub Desktop.
Save MrOrz/2413022 to your computer and use it in GitHub Desktop.
This bookmart script adds fbid of each post in facebook into the selector button on the top-right of each post.
(function(){
var elems = document.querySelectorAll('.uiUnifiedStory.uiStreamStory.genericStreamStory');
for(var i = 0; i < elems.length; ++i){
var el = elems[i], a = el.querySelector('.uiSelectorButton.highlightSelectorButton');
if(!a){continue;}
a.href = JSON.parse(el.dataset.ft).fbid;
}
return false;
}())
/* minified and book-mark ready:
javascript:(function(){for(var b=document.querySelectorAll(".uiUnifiedStory.uiStreamStory.genericStreamStory"),a=0;a<b.length;++a){var c=b[a],d=c.querySelector(".uiSelectorButton.highlightSelectorButton");d&&(d.href=JSON.parse(c.dataset.ft).fbid)}return!1})();
*/
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment