Limits of preload() with cross‑origin HTTPS images that trigger certificate errors
26K reputation · 07 Mar 2026, 00:43 UTC
The goal is to understand whether the p5.js preload() function considers an asset load complete when the browser blocks the request due to an invalid SSL/TLS certificate. When a sketch is served over HTTPS and attempts to load an image from an external domain presenting a self‑signed or expired certificate, the browser’s mixed‑content check aborts the network transaction before any data is handed to p5.js.
Does preload() treat the blocked request as a failed load and invoke the error callback, allowing setup() to run? If the error callback is not called, does preload() timeout after a period, or does it wait indefinitely? How does the presence of the p5.js Web Editor’s CDN‑hosted fallback affect this behavior?