1.3.0 • Published 10 years ago
stb-util-referrer v1.3.0
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-referrerUsage
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
DEBUGwhich 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.
1.3.0
10 years ago