Skip to content

JavaScript-based safelink engine to convert all outgoing page links into safelink URL automatically

License

Notifications You must be signed in to change notification settings

zerosdev/ZSE-Safelink-JS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

26 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Zeros Safelink Engine (ZSE)

JavaScript safelink engine to convert all outgoing page links into safelink URL automatically

This library provide easy way to convert all of your page links into your Safelink URL. For example :

<a href="https://youroutgoinglink.com">Your Outgoing Link</a>

will be converted to :

<a href="https://yoursafelink.com/out?go=aHR0cHM6Ly95b3Vyb3V0Z29pbmdsaW5rLmNvbQ==">Your Outgoing Link</a>

This library also has cookie management, so you can decide to keep your visitors always directed to your safelink page or not.

This is proof of how easy this library is :

  1. You need to include the main library into your bottom of every page you want to enable safelink (above of </body> tag)
<script src="/path/to/your/ZSE.min.js"></script>
  1. Start for setting up your safelink
<script>

ZSE.safelink("http://your-safelink.com/go?url=")
  .except(['zeros.co.id'])
  .delay(1)
  .repeat(5, 60)
  .run();

</script>
  1. You're ready to go!

Available Options

.safelink()

Define your safelink URL. This option must have value. if not, error will be thrown. For example :

.safelink('https://your-safelink.com/go?url=')

.except()

Add some domains that SHOULD NOT be converted. This option should have an array value. For example :

.except(['facebook.com','youtube.com','zeros.co.id'])

.only()

Add some domains that SHOULD BE converted. This option should have an array value. For example :

.only(['twitter.com','github.com'])

.delay()

Enable / disable delay for safelink (in minute). 0 = disable = all links will always be converted. Default value is 5 minute. For example:

.delay(15)

.repeat()

Add custom repetition. If this method not configured, the conversion will always executed. For example to repeat safelink conversion 3 times every 60 minutes :

.repeat(3, 60)

.linkCount()

Get link count form current page. This option will return integer value

.run()

Run / execute engine

Note

  1. If there is an error, this engine will not be executed and error message will appear in your browser's console.
  2. This code is open for public development
  3. This code is distributed under MIT License, you can redistribute this code WITHOUT removing or changing creator's credit

About

JavaScript-based safelink engine to convert all outgoing page links into safelink URL automatically

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Languages