
Security News
Attackers Are Hunting High-Impact Node.js Maintainers in a Coordinated Social Engineering Campaign
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.
react-speculation-rules
Advanced tools
React component for setting pre-render and pre-fetch speculation rules using the speculation rule API.
Specify the rules for pre-fetching and pre-rendering resources and pages using the speculation rules API.
This component generates a <script> tag with speculation rules, so it's recommended to place the component towards the bottom of the page.
Installation: npm install react-speculation-rules
Import the package into your app:
import {SpeculationRules} from "react-speculation-rules";
<SpeculationRules preRenderEagerness="moderate" preFetchEagerness="moderate" hrefMatches={["/*", "/example-page-one"]} excludeHrefs={["/logout", "/*\\?*(^|&)add-to-cart=*", ".no-prerender"]} excludeSelectors={["[rel~=nofollow]"]} prefetchUrls={["/", "/example-page-two"]}></SpeculationRules>
- `preRenderEagerness`
[Required] Takes a sting of "immediate", "eager", "moderate" or "conservative".
- `preFetchEagerness`
[Required] Takes a sting of "immediate", "eager", "moderate" or "conservative".
- `hrefMatches`
[Optional] Takes an array of url strings.
- `excludeHrefs`
[Optional] Takes an array of url strings.
- `excludeSelectors`
[Optional] Takes an array of HTML selector strings.
- `prefetchUrls`
[Optional] Takes an array of url strings.
- `referrerPolicy`
[Optional] Takes a string.
- `requires`
[Opitonal] currently only accepts "anonymous-client-ip-when-cross-origin" which is its default value.
FAQs
Speculation API component for react.
The npm package react-speculation-rules receives a total of 0 weekly downloads. As such, react-speculation-rules popularity was classified as not popular.
We found that react-speculation-rules demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 0 open source maintainers collaborating on the project.
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.

Security News
Multiple high-impact npm maintainers confirm they have been targeted in the same social engineering campaign that compromised Axios.

Security News
Axios compromise traced to social engineering, showing how attacks on maintainers can bypass controls and expose the broader software supply chain.

Security News
Node.js has paused its bug bounty program after funding ended, removing payouts for vulnerability reports but keeping its security process unchanged.