Facebook Chat Bracket Memes

Replaces [[xxx]] expressions with their respective pictures on facebook chat. "The New Edition"

Du musst eine Erweiterung wie Tampermonkey, Greasemonkey oder Violentmonkey installieren, um dieses Skript zu installieren.

You will need to install an extension such as Tampermonkey to install this script.

You will need to install an extension such as Tampermonkey or Violentmonkey to install this script.

You will need to install an extension such as Tampermonkey or Userscripts to install this script.

You will need to install an extension such as Tampermonkey to install this script.

Sie müssten eine Skript Manager Erweiterung installieren damit sie dieses Skript installieren können

(Ich habe schon ein Skript Manager, Lass mich es installieren!)

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install an extension such as Stylus to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

You will need to install a user style manager extension to install this style.

(I already have a user style manager, let me install it!)

// ==UserScript==
// @name        Facebook Chat Bracket Memes
// @namespace   omareco14
// @include     *facebook.com/*
// @version     1.0
// @grant       none
// @description Replaces [[xxx]] expressions with their respective pictures on facebook chat. "The New Edition"
// @author      omareco14
// ==/UserScript==

        setInterval(function(){
              var all = document.getElementsByClassName("_5yl5");
              for(var i = 0; i<all.length;i++){
                     if(all[i].innerHTML.indexOf("[[") != -1){
                           var meme = all[i].innerHTML.substring(all[i].innerHTML.indexOf("[[")+2,all[i].innerHTML.indexOf("]]"));
                           all[i].innerHTML = all[i].innerHTML.replace("[["+meme+"]]", '<img title="'+meme+'" alt="'+meme+'" height=16 width=16 src="https://graph.facebook.com/'+meme+'/picture?width=10&height=10">');
                    }
              }
              var all2 = document.getElementsByClassName("UFICommentBody");
              for(var i = 0; i<all2.length;i++){
                     if(all2[i].innerHTML.indexOf("[[") != -1){
                           var meme = all2[i].innerHTML.substring(all2[i].innerHTML.indexOf("[[")+2,all2[i].innerHTML.indexOf("]]"));
                           all2[i].innerHTML = all2[i].innerHTML.replace("[["+meme+"]]", '<img title="'+meme+'" alt="'+meme+'" height=16 width=16 src="https://graph.facebook.com/'+meme+'/picture?width=10&height=10">');
                    }
              }
              var all3 = document.getElementsByClassName("_5wj- _5pbx userContent");
              for(var i = 0; i<all3.length;i++){
                     if(all3[i].innerHTML.indexOf("[[") != -1){
                           var meme = all3[i].innerHTML.substring(all3[i].innerHTML.indexOf("[[")+2,all3[i].innerHTML.indexOf("]]"));
                           all3[i].innerHTML = all3[i].innerHTML.replace("[["+meme+"]]", '<img title="'+meme+'" alt="'+meme+'" height=16 width=16 src="https://graph.facebook.com/'+meme+'/picture?width=10&height=10">');
                    }
              }
        },10);