Socket
Socket
Sign inDemoInstall

scroll-restoration-polyfill

Package Overview
Dependencies
2
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    scroll-restoration-polyfill

Prevent the scroll restoration caused by the popstate event or back/forward buttons.


Version published
Weekly downloads
516
decreased by-20.98%
Maintainers
1
Install size
15.5 kB
Created
Weekly downloads
 

Readme

Source

scroll-restoration-polyfill

Prevent the scroll restoration caused by the popstate event or back/forward buttons. Demo

gzipped size Travis build status npm version

Warning: it works in Chrome, Safari, and Firefox 46+, but there's no IE/Edge support yet.

Usage

The polyfill has no API. Once included, just use the official API as described on Chrome Developers:

// Prevent the scroll, always
history.scrollRestoration = 'manual';

// Stop preventing the scroll
history.scrollRestoration = 'auto';

Install

Pick your favorite:

<script src="dist/scroll-restoration-polyfill.browser.js"></script>
npm install --save scroll-restoration-polyfill
require('scroll-restoration-polyfill');
import 'scroll-restoration-polyfill';

Dependencies

Two lightweight dependencies, already included in scroll-restoration-polyfill's scroll-restoration-polyfill's gzipped size

License

MIT © Federico Brigante

Keywords

FAQs

Last updated on 16 Sep 2016

Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc