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 :
- 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>
- 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>
- You're ready to go!
.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
- If there is an error, this engine will not be executed and error message will appear in your browser's console.
- This code is open for public development
- This code is distributed under MIT License, you can redistribute this code WITHOUT removing or changing creator's credit