diff --git a/lib/ace/config.js b/lib/ace/config.js index 1a60fbde..f4e4c89a 100644 --- a/lib/ace/config.js +++ b/lib/ace/config.js @@ -153,7 +153,8 @@ function init(packaged) { var scriptOptions = {}; var scriptUrl = ""; - var currentScript = (document.currentScript || document._currentScript ); + // Use currentScript.ownerDocument in case this file was loaded from imported document. (HTML Imports) + var currentScript = (document.currentScript || document._currentScript ); // native or polyfill var currentDocument = currentScript && currentScript.ownerDocument || document; var scripts = currentDocument.getElementsByTagName("script");