Skip to content

Instantly share code, notes, and snippets.

@fortserious
Last active March 22, 2016 17:07
Show Gist options
  • Save fortserious/1f3794ae50b3fe129c04 to your computer and use it in GitHub Desktop.
Save fortserious/1f3794ae50b3fe129c04 to your computer and use it in GitHub Desktop.
facebook like options suppressor
// ==UserScript==
// @name facebook like option suppressor
// @namespace www.rossdoran.com
// @version 0.1
// @description i don't like this
// @match https://www.facebook.com/*
// @require http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js
// @require https://gist.github.com/raw/2625891/waitForKeyElements.js
// @copyright ross doran 2016
// @run-at document-start
// ==/UserScript==
// prevent icons and like option popup from displaying, ever
$('head').append('<style type="text/css">i._3j7r._2p78._2p7a._4-op, i._3j7n._2p78._2p7a._4-op, i._3j7l._2p78._2p7a._4-op, i._3j7m._2p78._2p7a._4-op, i._3j7o._2p78._2p7a._4-op, i._3j7q._2p78._2p7a._4-op, ._1oxj, .wow, .like, .love, .haha, .anger, .sorry, ._iu- {display:none !important;}</style>');
waitForKeyElements ("._4arz", function(){
// iterate through "<x> liked this" notifiers under status
$("._4arz").each(function()
{
if (!$(this).hasClass("likefixed")) // skip if checked
{
var testText = $(this).text();
if ($.isNumeric(testText)) // if notifier is "4"
testText += " people like this.";
else if (testText.indexOf('and') > -1) // else if notifier is "Friend, friend and friend"
{
testText += " like this.";
}
else // else. (notifier is "Friend")
testText += " likes this.";
$(this).text(testText)
$(this).addClass("likefixed") // mark as fixed
$(this).css("margin-left","-105px") // move back to far left justification
}
}
)
});
waitForKeyElements ("._4l_v", function(){
// remove 'reacted to' from notifications panel
$("._4l_v:contains('reacted to')").each(function()
{
if (!$(this).hasClass("likefixed"))
{
$(this).text($(this).text().replace("reacted to","liked")) // replace text
$(this).addClass("likefixed")
}
})
}
);
// remove reaction tabs from 'people who liked this' popup
waitForKeyElements ("ul._43o4", function(){
$("ul._43o4").first().first().first().first().text("People who like this") // hacky. changes text from 'all' back to 'people who liked this post'
$("ul._43o4 li:not(:first)").each(function() // removes all other tabs from ul
{
$(this).remove()
})
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment