Skip to content

jack-chapman/redacted

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

11 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

๐Ÿ‘€ Redacted

Quick and easy custom* censorship

* custom config coming soon.

Fair warning: This is hardly tested at all. Use at your own risk.

๐Ÿ”ง Installation

Download the minified version of redacted here

Alternatively, you could clone this repo and run npm install, then npm build to make your own copy.

โœ๏ธ How to use Redacted

First, drop the minified version of Redacted right at the bottom of the <body> in your HTML file:

<body>
  ...
  <script src="redacted.min.js" type="text/javascript"></script>
</body>

Then, make an instance of Redacted and pass in a selector string for the elements you want to censor.

Redacted uses document.querySelectorAll under the hood, so anything you can select with that, Redacted will be able to find.

Once that's done, call the censor method on your Redacted instance.

Here's an example:

<body>
  <p>
    This sentence has a word that is <span class="censor-me">censored</span>
  <p>
  ...
  <script src="redacted.min.js" type="text/javascript"></script>
  <script>
    new Redacted('.censor-me').censor();
  </script>
</body>

โŒ What you can't censor

You can basically just censor text, so don't bother trying to censor images or something because you'll just be disappointed...

About

๐Ÿ‘€ quick and easy custom censorship โœ๏ธ

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published