stb-util-referrer

1.3.0 • Public • Published

Determine application referrer

NPM version Dependencies Status Gitter

util-referrer is a function to receive a link to the previous application. It's necessary to make a correct exit from the current application to go back.

Installation

npm install stb-util-referrer

Usage

Add to the scope:

var referrer = require('stb-util-referrer');

Go back to the previous application:

location.href = referrer() || 'http://google.com/';

Debug mode

There is a global var DEBUG which activates additional consistency checks and protection logic not available in release mode.

In debug mode the util method is exposed to the global namespace as window.utilReferrer.

Contribution

If you have any problem or suggestion please open an issue here. Pull requests are welcomed with respect to the JavaScript Code Style.

License

stb-util-referrer is released under the GPL-3.0 License.

Package Sidebar

Install

npm i stb-util-referrer

Weekly Downloads

1

Version

1.3.0

License

GPL-3.0

Last publish

Collaborators

  • mullock