Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

scroll-restoration-polyfill

Package Overview
Dependencies
Maintainers
1
Versions
3
Alerts
File Explorer

Advanced tools

Socket logo

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.

  • 0.6.1
  • latest
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
345
decreased by-27.52%
Maintainers
1
Weekly downloads
 
Created
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

Package last updated on 16 Sep 2016

Did you know?

Socket

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
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc