2.0.0 • Published 7 years ago

prevent-unload v2.0.0

Weekly downloads
4
License
MIT
Repository
github
Last release
7 years ago

prevent-unload

Code Style Prev NPM Version Build Status Dependency Status

Prevent page unloading from the user's action

Install

$ npm install --save prevent-unload

Usage

import preventUnload, {cancel} from 'prevent-unload';

const handler = preventUnload();
cancel(handler);

API

preventUnload(message)

  • message String (optional) - Message to display on confirm popup. Default is platform specified.

Apply page unloading prevention. If user attempt to close current web page after calling the method, then browser blocks page unloading and shows up popup with specified message.

This method returns reference of handler, which can be used for cancel the behavior.

preventUnload.cancel(handler)

  • handler Function - Handler reference to cancel event.

Cancel page unloading prevention.

License

MIT

2.0.0

7 years ago

1.1.13

7 years ago

1.1.12

8 years ago

1.1.11

8 years ago

1.1.10

8 years ago

1.1.9

8 years ago

1.1.8

8 years ago

1.1.7

8 years ago

1.1.6

8 years ago

1.1.5

8 years ago

1.1.4

8 years ago

1.1.3

8 years ago

1.1.2

8 years ago

1.1.1

8 years ago

1.1.0

8 years ago

1.0.0

8 years ago

0.0.4

8 years ago

0.0.3

8 years ago

0.0.2

8 years ago

0.0.1

8 years ago