New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details →
Socket
Book a DemoSign in
Socket

arobase

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

arobase

http://jexhson.github.io/arobase/

latest
Source
npmnpm
Version
1.0.4
Version published
Maintainers
1
Created
Source

Arobase

http://jexhson.github.io/arobase/

Arobase is a simple and lightweight email obfuscator library for modern browsers. It tries to obfuscate email addresses on a web page from bots but keep it readable for human: transform characters into HTML numbers and insert random padding (non printable characters) between letters. By default it also append the page hostname to the address.

Basic Usage

Before you try anything, you need to include arobase.min.js in your page, via the usual tags:

<script src="arobase.min.js" async></script>

Then you can obfuscate an email address by simply adding a class arobase to an element:

<address class="arobase">john.doe</address>

This will render a clickable email like john.doe@<current_page_domain>.

Arobase is also available via npm and bower.

Options

Options are set using HTML attributes (such as data-domain). All options can be combined together.

Mailbox

To customize the mailbox (the part before @) just add a data-mailbox. It allows you to set a custom text if JavaScript is disable.

<address class="arobase" data-mailbox="john.doe">
    Oops JS not activated
</address>

This will render as previously.

Domain

To set a custom domain (the part just after @ but before the last .) just add a data-domain.

<address class="arobase" data-domain="example">
    john.doe
</address>

This will render an email like john.doe@example.<current_tld>.

If current page have not top level domain (like localhost), the dot and the tld parts are skipped.

Top level domain (tld)

To set a custom top level domain (like .com or .net) just add a data-tld.

<address class="arobase" data-tld="foo">john.doe</address>

This will render an email like john.doe@<current_domain>.foo.

Warning: this does not remove the current TLD, if your <current_domain> is example.com and you set data-tld="foo" it will display john.doe@example.com.foo. If you just want to display john.doe@example.foo you must define data-domain.

License

Arobase is released under the MIT License. See LICENSE file for details.

The official site for the library is at http://jexhson.github.io/arobase/.

Keywords

email

FAQs

Package last updated on 08 Jan 2016

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts