![Oracle Drags Its Feet in the JavaScript Trademark Dispute](https://cdn.sanity.io/images/cgdhsj6q/production/919c3b22c24f93884c548d60cbb338e819ff2435-1024x1024.webp?w=400&fit=max&auto=format)
Security News
Oracle Drags Its Feet in the JavaScript Trademark Dispute
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
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
The npm package failed-to-load receives a total of 4,597 weekly downloads. As such, failed-to-load popularity was classified as popular.
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.
Security News
Oracle seeks to dismiss fraud claims in the JavaScript trademark dispute, delaying the case and avoiding questions about its right to the name.
Security News
The Linux Foundation is warning open source developers that compliance with global sanctions is mandatory, highlighting legal risks and restrictions on contributions.
Security News
Maven Central now validates Sigstore signatures, making it easier for developers to verify the provenance of Java packages.