Security News
Supply Chain Attack Detected in Solana's web3.js Library
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
gatsby-plugin-preconnect
Advanced tools
Gatsby plugin to add the crossorigin attribute to every <link rel="preload"> tag
Quickly add a <link rel="preconnect" crossorigin>
tag for every specified domain.
npm install --save gatsby-plugin-preconnect
It simply adds a <link rel="preconnect" href="https://example.com" crossorigin>
to the page (see the
Resource Prioritization - Preconnect
guide).
// In your gatsby-config.js
plugins: [
{
resolve: 'gatsby-plugin-preconnect',
options: {
domains: ['https://foo.com', 'https://bar.com'],
},
},
]
crossOrigin
is set to true
by default but it can be customized, below all the available options
plugins: [
{
resolve: 'gatsby-plugin-preconnect',
options: {
domains: [
'https://foo.com',
'https://bar.com',
{ domain: 'https://enablecors.com', crossOrigin: true },
{ domain: 'https://disablecors.com', crossOrigin: false },
{ domain: 'https://corswithanonymous.com', crossOrigin: 'anonymous' },
{ domain: 'https://corswithcreds.com', crossOrigin: 'use-credentials' },
],
},
},
]
All the available values for crossOrigin
are listed below, every other value makes the plugin throw an error
Value | Equivalent value |
---|---|
undefined | "anonymous" |
true | "anonymous" |
"anonymous" | "anonymous" |
"use-credentials" | "use-credentials" |
false | (attribute not added) |
PR or issues are welcome 👋
npm run build
on the root
then, in every test project, you need to run npm run plugin:link
to locally use itThanks goes to these wonderful people (emoji key):
Stefano Magni 💻 📖 | Dugagjin Lashi 💻 👀 | Sean King 🤔 | Andrew Schneider 💻 📖 ⚠️ | Andreas Donig 🤔 |
This project follows the all-contributors specification. Contributions of any kind welcome!
FAQs
Gatsby plugin to add the crossorigin attribute to every <link rel="preload"> tag
The npm package gatsby-plugin-preconnect receives a total of 8,125 weekly downloads. As such, gatsby-plugin-preconnect popularity was classified as popular.
We found that gatsby-plugin-preconnect demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 1 open source maintainer 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
A supply chain attack has been detected in versions 1.95.6 and 1.95.7 of the popular @solana/web3.js library.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.