diff --git a/HEADER.js b/HEADER.js index 2c9ab4d1417..f9a157f47b2 100644 --- a/HEADER.js +++ b/HEADER.js @@ -10,7 +10,10 @@ else if (typeof define === 'function' && define.amd) { } /* _AMD_END_ */ if (typeof document !== 'undefined' && typeof window !== 'undefined') { - fabric.document = document; + if (document instanceof HTMLDocument) + fabric.document = document; + else + fabric.document = document.implementation.createHTMLDocument(""); fabric.window = window; } else {