How to traps change on facebook page?

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • sarwasunda
    New Member
    • Aug 2010
    • 1

    #1

    How to traps change on facebook page?

    Sorry for my English. Can you help me please! I'm very newbie on coding. I want this code loads on every changes (status, tab,feed,etc) and can replace class element on my facebook pages

    Code:
    var words={"Masukkan Kembali":"Asupkeun deui","yang":"nu","":""};
    //////////////////////////
    // prepareRegex by JoeSimmons
    //////////////////////////
    String.prototype.prepareRegex = function() {
    return this.replace(/([\[\]\^\&\$\.\(\)\?\/\\\+\{\}\|])/g, "\\$1");
    };
    
    function isOkTag(tag) {
    return (",pre,blockquote,code,input,button,textarea".indexOf(","+tag) == -1);
    }
    
    var regexs=new Array(),
    	replacements=new Array();
    for(var word in words) {
    if(word != "") {
    regexs.push(new RegExp("\\b"+word.prepareRegex().replace(/\*/g,'[^ ]*')+"\\b", 'gi'));
    replacements.push(words[word]);
    }
    }
    
    var texts = document.evaluate(".//text()[normalize-space(.)!='']",document.body,null,6,null), text="";
    for(var i=0,l=texts.snapshotLength; (this_text=texts.snapshotItem(i)); i++) {
    	if(isOkTag(this_text.parentNode.tagName.toLowerCase()) && (text=this_text.textContent)) {
    	for(var x=0,l=regexs.length; x<l; x++) {
    	text = text.replace(regexs[x], replacements[x]);
    	this_text.textContent = text;
    	}
    	}
    }
  • RamananKalirajan
    Contributor
    • Mar 2008
    • 608

    #2
    Add the function call on body onmouseup and onkeyup. So that for each and every action you will get the script triggered.

    Thanks and Regards
    Ramanan Kalirajan

    Comment

    Working...