OSINTools / Facebook Public Profile Action Remover

// ==UserScript==
// @name           Facebook Public Profile Action Remover
// @namespace      OSINTools
// @description    Remove (hide) Facebook elements which could cause the current user to affect the target profile. Also removes some features which will alter how the page looks. Disclaimer: Doesn't remove all affective buttons/links.
// @grant          none
// @include        http://*facebook.com/*
// @include        https://*facebook.com/*
// @version       1.1.2
// ==/UserScript==

function remove_fb(){
	//Classes to remove.
	var shareClasses = ['UFIReplyLink','uiMentionsInput', 'UFIAddCommentInput' ,'actions _70j', 'FriendRequestAdd', 'share_action_link', 'addButton', 'UFICommentCloseButton', 'PageLikeButton', 
											'UFILikeLink', 'comment_link', 'friendInviterContainer', 'like_link'];
	var ids = ['pages_actions_pagelet']
	
	for (var i=0;i<shareClasses.length;i++){
		var elementsWithIt = document.evaluate('//*[contains(@class, "'+shareClasses[i]+'")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
		for (var j = 0; j < elementsWithIt.snapshotLength; j++) {
			elementsWithIt.snapshotItem(j).parentNode.removeChild(elementsWithIt.snapshotItem(j));
		}
	}
		for (var i=0;i<ids.length;i++){
		var elementsWithIt = document.evaluate('//*[contains(@id, "'+ids[i]+'")]', document, null, XPathResult.UNORDERED_NODE_SNAPSHOT_TYPE, null);
		for (var j = 0; j < elementsWithIt.snapshotLength; j++) {
			elementsWithIt.snapshotItem(j).parentNode.removeChild(elementsWithIt.snapshotItem(j));
		}
	}
}

remove_fb();

document.addEventListener('DOMNodeInserted',function(e){
	window.setTimeout(function(){
		remove_fb();
				}, 250);
})