Git Product home page Git Product logo

zse-safelink-js's Introduction

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

zse-safelink-js's People

Contributors

zerosdev avatar

Stargazers

 avatar  avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.