
Research
Malicious npm Packages Impersonate Flashbots SDKs, Targeting Ethereum Wallet Credentials
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
failed-to-load
Advanced tools
Find script tag that have failed to load when document's readyState is complete
Find script tags that have failed to load when document's readyState is complete.
Add this attribute "onload" with "this.loaded=1" in its value (onload="this.loaded=1"
)
<script src="my-script-922a511f02d148e4c9390526d85ca519.js" onload="this.loaded=1"></script>
<script src="other-script-693e810ff27604e6da274da4c77e136c.js" onload="this.loaded=1"></script>
Register check for window load
import { register } from 'failed-to-load';
register();
This will throw an ayncronous error to be caught by your global onerror callback.
Error{
message: `Failed to load necessary script tags upon window load
my-script-922a511f02d148e4c9390526d85ca519.js
other-script-693e810ff27604e6da274da4c77e136c.js`,
code: 'ERROR_NECESSARY_SCRIPT_NOT_LOADED',
files: [
[object HTMLScriptElement],
[object HTMLScriptElement]
]
}
Alternatively, you can register a callback to catch the error (then it will not be thrown)
register(
error => logger.warn(error)
);
Check and report manually:
import { check } from 'failed-to-load';
window.addEventListener('load', () => {
const missing = check();
if (missing.length) {
logger.warn({
message: 'script files not loaded on page load',
files: missing.map(({ src }) => src)
})
}
});
FAQs
Find script tag that have failed to load when document's readyState is complete
We found that failed-to-load demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 4 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.
Research
Four npm packages disguised as cryptographic tools steal developer credentials and send them to attacker-controlled Telegram infrastructure.
Security News
Ruby maintainers from Bundler and rbenv teams are building rv to bring Python uv's speed and unified tooling approach to Ruby development.
Security News
Following last week’s supply chain attack, Nx published findings on the GitHub Actions exploit and moved npm publishing to Trusted Publishers.