stb-util-referrer
v1.3.0
Published
Determine application referrer.
Downloads
4
Maintainers
Readme
Determine application referrer
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.