0.1.7 • Published 6 months ago

url-change-event v0.1.7

Weekly downloads
25
License
MIT
Repository
github
Last release
6 months ago

url-change-event

a wrapper event that listen & control URL changes 中文

Installation

you can install with npm install url-change-event

    /* in ES 5 */
    require('url-change-event')
    /* in ES 6 */
    import 'url-change-event'

or

    <script src="url-change-event.js"></script>

Due to override some history method, you should import this lib before your code.

Usage

window.addEventListener('urlchangeevent', function(e) {
    // your code here
})

UrlChangeEvent instance

Properties

  • oldURL {URL} - the url before change.
  • newURL {URL | null} - the url after change. WARNING: when event.action is beforeunload, this value is null.
  • action {pushState|replaceState|popstate|beforeunload} - the action that causes the url to change.

Method

  • preventDefault - prevent url change

License

MIT licensed

0.1.8-beta.1

6 months ago

0.1.8-beta.2

6 months ago

0.1.7

1 year ago

0.1.4

2 years ago

0.1.6

1 year ago

0.1.5

1 year ago

0.1.3

2 years ago

0.1.2

4 years ago

0.1.0

4 years ago

0.1.1

4 years ago

0.0.6

4 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago