Installations
npm install smoothscroll-polyfill
Developer Guide
Typescript
No
Module System
CommonJS
Node Version
8.11.1
NPM Version
5.6.0
Score
99.8
Supply Chain
93.7
Quality
79.6
Maintenance
100
Vulnerability
100
License
Releases
Unable to fetch releases
Contributors
Unable to fetch Contributors
Languages
JavaScript (51.75%)
HTML (48.25%)
Developer
Download Statistics
Total Downloads
165,583,071
Last Day
53,204
Last Week
479,601
Last Month
2,518,104
Last Year
30,521,061
GitHub Statistics
3,850 Stars
136 Commits
338 Forks
44 Watching
10 Branches
21 Contributors
Bundle Size
3.97 kB
Minified
1.40 kB
Minified + Gzipped
Package Meta Information
Latest Version
0.4.4
Package Id
smoothscroll-polyfill@0.4.4
Size
40.33 kB
NPM Version
5.6.0
Node Version
8.11.1
Publised On
26 Mar 2019
Total Downloads
Cumulative downloads
Total Downloads
165,583,071
Last day
-55.6%
53,204
Compared to previous day
Last week
-20.9%
479,601
Compared to previous week
Last month
0.6%
2,518,104
Compared to previous month
Last year
-11.8%
30,521,061
Compared to previous year
Daily Downloads
Weekly Downloads
Monthly Downloads
Yearly Downloads
Dev Dependencies
8
Smooth Scroll behavior polyfill
The Scroll Behavior specification has been introduced as an extension of the Window
interface to allow for the developer to opt in to native smooth scrolling. To date this has only been implemented in Chrome, Firefox and Opera.
Check out all the methods covered here: https://iamdustan.github.io/smoothscroll
Installation and use
Download the production ready file here and include it in your project, or install it as a package.
1# npm 2npm install smoothscroll-polyfill --save 3 4# yarn 5yarn add smoothscroll-polyfill
When including the polyfill in a script tag, it will run immediately after loaded.
If you are importing it as a dependency, make sure to call the polyfill
method:
1import smoothscroll from 'smoothscroll-polyfill'; 2 3// kick off the polyfill! 4smoothscroll.polyfill();
In both cases, the script will detect if the spec is natively supported and take action only when necessary.
The code requires requestAnimationFrame polyfill for browsers which don't support it.
Force polyfill implementation
If you prefer to always override the native scrolling methods, place this global variable before requiring the module or including the polyfill file.
1window.__forceSmoothScrollPolyfill__ = true;
We strongly recommend not to do this unless your project strongly needs it.
Contribute
The requirements to contribute are yarn and the latest LTS Node.js version.
First, fork the repository and do yarn install
in the root folder to get all the dependencies to work with. Create a feature branch, write your stuff and run yarn test
to check code style and prevent bugs.
In this project we use Prettier to format the final published code, you can run yarn format
before committing. If you don't, a precommit hook will prevent you from pushing code that hasn't been formatted properly.
Are you done? Awesome, submit a pull request explaining your changes.
This is a polyfill, not library, so make sure the behavior you are introducing is in the spec.
On tests files we are using ES2015, but the polyfill is written in ES5 for browser compatibility.
Watch tests
If you want to watch tests as you write your code run yarn test --watch
.
Browser Support
Successfully working in:
- natively supported in Chrome
- natively supported in Firefox
- Safari 6+
- Internet Explorer 9+
- Microsoft Edge 12+
- Opera Next
Standards documentation
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
license file detected
Details
- Info: project has a license file: LICENSE:0
- Info: FSF or OSI recognized license: MIT License: LICENSE:0
Reason
Found 9/13 approved changesets -- score normalized to 6
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
- Warn: no security policy file detected
- Warn: no security file to analyze
- Warn: no security file to analyze
- Warn: no security file to analyze
Reason
project is not fuzzed
Details
- Warn: no fuzzer integrations found
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
- Warn: 0 commits out of 26 are checked with a SAST tool
Reason
48 existing vulnerabilities detected
Details
- Warn: Project is vulnerable to: GHSA-v88g-cgmw-v5xw
- Warn: Project is vulnerable to: GHSA-93q8-gq69-wqmw
- Warn: Project is vulnerable to: GHSA-67hx-6x53-jw92
- Warn: Project is vulnerable to: GHSA-cwfw-4gq5-mrqx
- Warn: Project is vulnerable to: GHSA-g95f-p29q-9xw4
- Warn: Project is vulnerable to: GHSA-grv7-fg5c-xmjg
- Warn: Project is vulnerable to: GHSA-3xgq-45jj-v275
- Warn: Project is vulnerable to: GHSA-hr2v-3952-633q
- Warn: Project is vulnerable to: GHSA-ff7x-qrg7-qggm
- Warn: Project is vulnerable to: GHSA-qrmc-fj45-qfc2
- Warn: Project is vulnerable to: GHSA-8r6j-v8pm-fqw3
- Warn: Project is vulnerable to: MAL-2023-462
- Warn: Project is vulnerable to: GHSA-xf7w-r453-m56c
- Warn: Project is vulnerable to: GHSA-pfrx-2q88-qq97
- Warn: Project is vulnerable to: GHSA-44pw-h2cw-w3vq
- Warn: Project is vulnerable to: GHSA-jp4x-w63m-7wgm
- Warn: Project is vulnerable to: GHSA-c429-5p7v-vgjp
- Warn: Project is vulnerable to: GHSA-43f8-2h32-f4cj
- Warn: Project is vulnerable to: GHSA-qqgx-2p2h-9c37
- Warn: Project is vulnerable to: GHSA-p9w8-2mpq-49h9
- Warn: Project is vulnerable to: GHSA-2pr6-76vf-7546
- Warn: Project is vulnerable to: GHSA-8j8c-7jfh-h6hx
- Warn: Project is vulnerable to: GHSA-896r-f27r-55mw
- Warn: Project is vulnerable to: GHSA-9c47-m6qq-7p4h
- Warn: Project is vulnerable to: GHSA-4xc9-xhrj-v574
- Warn: Project is vulnerable to: GHSA-x5rq-j2xg-h7qm
- Warn: Project is vulnerable to: GHSA-jf85-cpcp-j695
- Warn: Project is vulnerable to: GHSA-p6mc-m468-83gw
- Warn: Project is vulnerable to: GHSA-29mw-wpgm-hmr9
- Warn: Project is vulnerable to: GHSA-35jh-r3h4-6jhm
- Warn: Project is vulnerable to: GHSA-h726-x36v-rx45
- Warn: Project is vulnerable to: GHSA-952p-6rrq-rcjv
- Warn: Project is vulnerable to: GHSA-f8q6-p94x-37v3
- Warn: Project is vulnerable to: GHSA-vh95-rmgr-6w4m / GHSA-xvch-5gv4-984h
- Warn: Project is vulnerable to: GHSA-hrpp-h998-j3pp
- Warn: Project is vulnerable to: GHSA-6g33-f262-xjp4
- Warn: Project is vulnerable to: GHSA-p8p7-x288-28g6
- Warn: Project is vulnerable to: GHSA-gcx4-mw62-g8wm
- Warn: Project is vulnerable to: GHSA-c2qf-rxjj-qqgw
- Warn: Project is vulnerable to: GHSA-2m39-62fm-q8r3
- Warn: Project is vulnerable to: GHSA-mf6x-7mm4-x2g7
- Warn: Project is vulnerable to: GHSA-j44m-qm6p-hp7m
- Warn: Project is vulnerable to: GHSA-3jfq-g458-7qm9
- Warn: Project is vulnerable to: GHSA-5955-9wpr-37jh
- Warn: Project is vulnerable to: GHSA-f5x3-32g6-xq36
- Warn: Project is vulnerable to: GHSA-72xf-g2v4-qvf3
- Warn: Project is vulnerable to: GHSA-7p7h-4mm5-852v
- Warn: Project is vulnerable to: GHSA-38fc-wpqx-33j7
Score
2.9
/10
Last Scanned on 2024-12-16
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn MoreOther packages similar to smoothscroll-polyfill
@types/smoothscroll-polyfill
TypeScript definitions for smoothscroll-polyfill
scroll-into-view-if-needed
Ponyfill for upcoming Element.scrollIntoView() APIs like scrollMode: if-needed, behavior: smooth and block: center
smoothscroll-anchor-polyfill
Apply smooth scroll to anchor links to replicate CSS scroll-behavior
smooth-scroll-into-view-if-needed
Ponyfill for smooth scrolling elements into view (if needed!)