Quick exit function for sensitive web page
npm install quick-exit
Option | Type | Default |
---|---|---|
safeUrl |
String | https://google.com |
import quickExit from 'quick-exit';
const config = {
safeUrl: 'https://google.com',
};
const element = document.querySelector('button.quick');
element.addEventListener('click', () => quickExit(config), false);
import quickExit from 'quick-exit';
import React from 'react';
const Element = () => <button onClick={() => quickExit()}>Quick exit</button>;
- 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