(html)
| 69 | export const P5_SCRIPT_TAG = '<script src="' + P5_SCRIPT_URL + '"></script>'; |
| 70 | |
| 71 | export function createP5Iframe(html) { |
| 72 | html = html || P5_SCRIPT_TAG; |
| 73 | |
| 74 | var elt = document.createElement('iframe'); |
| 75 | |
| 76 | document.body.appendChild(elt); |
| 77 | elt.style.visibility = 'hidden'; |
| 78 | |
| 79 | elt.contentDocument.open(); |
| 80 | elt.contentDocument.write(html); |
| 81 | elt.contentDocument.close(); |
| 82 | |
| 83 | return { |
| 84 | elt: elt, |
| 85 | teardown: function() { |
| 86 | elt.parentNode.removeChild(elt); |
| 87 | } |
| 88 | }; |
| 89 | } |
no test coverage detected