Comparing version 5.0.0-rc2 to 5.0.0
{ | ||
"name": "penpal", | ||
"version": "5.0.0-rc2", | ||
"version": "5.0.0", | ||
"description": "A promise-based library for communicating with iframes via postMessage.", | ||
@@ -5,0 +5,0 @@ "author": "Aaron Hardy <aaron@aaronhardy.com>", |
[![npm version](https://badge.fury.io/js/penpal.svg)](https://badge.fury.io/js/penpal) | ||
### Upgrading from version 4? See [version 5 release notes](https://github.com/Aaronius/penpal/releases/tag/v5.0.0) for details. | ||
[See documentation for 4.x](https://github.com/Aaronius/penpal/tree/4.x) | ||
[See documentation for 3.x](https://github.com/Aaronius/penpal/tree/3.x) | ||
# Penpal | ||
@@ -45,3 +50,12 @@ | ||
iframe.src = 'http://example.com/iframe.html'; | ||
document.body.appendChild(iframe); | ||
if ( | ||
document.readyState === 'complete' || | ||
document.readyState === 'interactive' | ||
) { | ||
document.body.appendChild(iframe); | ||
} else { | ||
document.addEventListener('DOMContentLoaded', () => { | ||
document.body.appendChild(iframe); | ||
}); | ||
} | ||
@@ -48,0 +62,0 @@ const connection = connectToChild({ |
No v1
QualityPackage is not semver >=1. This means it is not stable and does not support ^ ranges.
Found 1 instance in 1 package
88565
1
197