How to mask unwanted words in site?

7 replies
I know a little bit of JS Codding but I have no idea how to mask words or numbers for selected site? For ex. examplecode. web
Containing words: sh*t or pe*. I don't want see those words. How can I make .js file which changes those words into for ex. Flower and water? Or 100 into 50? They won't change sites content but only my clientside browser's perception to those words!

I just need some ideas and suggestions? :thumbsup:
#mask #site #unwanted #words
  • Profile picture of the author chretit
    The hardest about this for me was trying to decipher what the second cuss word is supposed to be: pe*. ??? I'm embarrassed that I don't know that one. Edit: oh, I just worked it out - one asterisk threw me, it's a couple of asterisks too short, surely?

    Anyway... There are a few questions that would be interesting to know:
    Is it a dynamic website based on a content management system such as WordPress, Drupal, .NET, etc or a custom built dynamic website?

    The reason I ask is: if it has a server side programming component you might be able to use that to censor words stored in a ban list (text file) on the server. For example, if it's a song lyrics site where users upload content you could filter text server-side just before it gets served to the browser. Just to give you another option.

    But of course you mentioned JavaScript so you can do something similar by loading the banned word list (could be an XML or JSON formatted text file) and then using JavaScript DOM and string functions to look for unwanted words and filter them out.

    Depending on your needs, with both methods you can censor some words completely or just change their text colour ala IMDB spoiler tag.

    Good luck and tell us how it goes
    {{ DiscussionBoard.errors[7071719].message }}
  • Profile picture of the author Sumaheris
    How about firefox does this will work? Where place my dom script?

    I'm not talking about my own website, I mean other website such as facebook.

    Thanks for advice!
    {{ DiscussionBoard.errors[7071756].message }}
  • Profile picture of the author chretit
    Oh, I see. Sorry, I misunderstood. I haven’t looked into it (I will in a second), but you’d think someone has already made a browser plug-in like that for Firefox or Chrome. That’s interesting, I’ll have a look on Google, meanwhile someone else here might already know the answer and will help you.

    PS don't worry about the dom script for now, if there's a browser plugin for Firefox, it'll probably be easy to use.

    EDIT: a quick search for: firefox plugin to censor website words
    brings up something called Profound.Censor on Mozilla's website, have a look maybe it's what you're looking for. And there are probably other similar scripts.
    {{ DiscussionBoard.errors[7071826].message }}
  • Profile picture of the author mesmsgs
    Use String.replace() !

    Ex:
    String.replace(searchvalue,newvalue)
    {{ DiscussionBoard.errors[7075739].message }}
    • Profile picture of the author Sitesupplier
      Originally Posted by mesmsgs View Post

      Use String.replace() !

      Ex:
      String.replace(searchvalue,newvalue)
      He doesn't want to write JavaScript to filter words on his own site, he wants a generic filter to block certain words on any website he visits. He just needs some free add-ons. I suppose he could write one himself that uses JavaScript's replace() function, but if he could do that I'm sure he wouldn't be asking a question about it here.
      {{ DiscussionBoard.errors[7077218].message }}
  • Profile picture of the author mesmsgs
    @Sitesupplier

    I am pretty sure that firefox and opera's plugins are coded in javascript
    {{ DiscussionBoard.errors[7086296].message }}
  • Profile picture of the author WebVyz
    Signature

    Gen Press Team - GenPress.net
    Automatically turn any WordPress WebSite into a growing and traffic grabbing Authority Content Site optimized for ALL relevant keywords & phrases.

    {{ DiscussionBoard.errors[7129551].message }}

Trending Topics