diff --git a/src/core/PaperScript.js b/src/core/PaperScript.js index a77686c9..5179f22a 100644 --- a/src/core/PaperScript.js +++ b/src/core/PaperScript.js @@ -298,7 +298,13 @@ var PaperScript = this.PaperScript = new function() { } } - DomEvent.add(window, { load: load }); + // Catch cases where paperjs is loaded after the browser event has already occurred. + if ( document.readyState === "complete" ) { + // Handle it asynchronously + setTimeout( load ); + } else { + DomEvent.add(window, { load: load }); + } // Produces helpers to e.g. check for both 'canvas' and 'data-paper-canvas' // attributes: