
Security News
Axios Supply Chain Attack Reaches OpenAI macOS Signing Pipeline, Forces Certificate Rotation
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.
@solid-primitives/script-loader
Advanced tools
Creates a primitive to load scripts dynamically, either for external services or jsonp requests
npm install @solid-primitives/script-loader
# or
yarn add @solid-primitives/script-loader
# or
pnpm add @solid-primitives/script-loader
createScriptLoader expects a props object with a src property. All the other props will be spread to the script element.
The src prop is required and will be used to set the src or textContent attribute. It can be a string or an accessor.
import { createScriptLoader } from "@solid-primitives/script-loader";
// For example, to use recaptcha:
createScriptLoader({
src: "https://www.google.com/recaptcha/enterprise.js?render=my_token",
async onLoad() {
await grecaptcha.enterprise.ready();
const token = await grecaptcha.enterprise.execute("my_token", { action: "login" });
// do your stuff...
},
});
// or pinterest embeds:
createScriptLoader({
src: '!function(a,b,c){var d,e,f;d="PIN_"+~~((new Date).getTime()/864e5),...',
onLoad() {
window?.PinUtils?.build();
},
});
function createScriptLoader(props: ScriptProps): HTMLScriptElement | undefined; // script element with be undefined only on the server
type ScriptProps = Omit<ComponentProps<"script">, "src" | "textContent"> & {
/** URL or source of the script to load. */
src: string | Accessor<string>;
};
TODO
See CHANGELOG.md
FAQs
Primitive to load scripts dynamically
The npm package @solid-primitives/script-loader receives a total of 906 weekly downloads. As such, @solid-primitives/script-loader popularity was classified as not popular.
We found that @solid-primitives/script-loader demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 3 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
OpenAI rotated macOS signing certificates after a malicious Axios package reached its CI pipeline in a broader software supply chain attack.

Security News
Open source is under attack because of how much value it creates. It has been the foundation of every major software innovation for the last three decades. This is not the time to walk away from it.

Security News
Socket CEO Feross Aboukhadijeh breaks down how North Korea hijacked Axios and what it means for the future of software supply chain security.