Skip to content
This repository has been archived by the owner on Mar 13, 2018. It is now read-only.

Commit

Permalink
Support asynchronous loading of HTMLImports polyfill
Browse files Browse the repository at this point in the history
  • Loading branch information
dfreedm committed Oct 2, 2013
1 parent 4f59035 commit 55470b2
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions src/boot.js
Original file line number Diff line number Diff line change
Expand Up @@ -26,9 +26,11 @@ function bootstrap() {
new CustomEvent('HTMLImportsLoaded', {bubbles: true})
);
});
};
}

if (document.readyState === 'complete') {
// Allow for asynchronous loading when minified
// readyState 'interactive' is expected when loaded with 'async' or 'defer' attributes
if (document.readyState === 'complete' || document.readyState === 'interactive') {
bootstrap();
} else {
window.addEventListener('DOMContentLoaded', bootstrap);
Expand Down

0 comments on commit 55470b2

Please sign in to comment.