quick-exit
v1.0.1
Published
Quick exit function for sensitive web page
Downloads
22
Maintainers
Readme
Quick exit
Quick exit function for sensitive web page
Install
npm install quick-exit
Config parameters
| Option | Type | Default |
| --------- | ------ | ------------------ |
| safeUrl
| String | https://google.com |
Usage
Vanilla
import quickExit from 'quick-exit';
const config = {
safeUrl: 'https://google.com',
};
const element = document.querySelector('button.quick');
element.addEventListener('click', () => quickExit(config), false);
React
import quickExit from 'quick-exit';
import React from 'react';
const Element = () => <button onClick={() => quickExit()}>Quick exit</button>;
Quick exit steps
- Remove all visual display via CSS
- Remove head title
- Replace current URL with safe url (redirect)
- Clears persistent data e.g. cookies, sessions, local storage
- Opens new tab with safe url
- Focus on new safe url tab