Skip to content

Commit

Permalink
Merge pull request #3 from GetFeedback/fix/gfpcol-2191/fix-asynchroni…
Browse files Browse the repository at this point in the history
…city

[GFPCOL-2191] fix asynchronicity
  • Loading branch information
moroale93 committed Sep 2, 2021
2 parents d52b592 + febffea commit ae2679e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 12 deletions.
12 changes: 4 additions & 8 deletions lightningjs-embed.js
Original file line number Diff line number Diff line change
Expand Up @@ -100,13 +100,14 @@ window.lightningjs || (function(modules){
// this helper is used to build the inner iframe where
// the module will live in its own window context
function buildInnerFrameHtml() {
return [
"<head></head><",body, "'\"></", body, ">"
].join("")
return [
"<head></head><",body,"><",script," src=\"", internalModule.l,"\"></",script,"></", body,">",
].join("");
}

// try to get a handle on the document body
var body = "body",
script = "script",
documentBody = theDocument[body];

// if the document body does not exist yet, wait 100ms
Expand Down Expand Up @@ -173,11 +174,6 @@ window.lightningjs || (function(modules){
var frameDocument = innerFrame[contentWindow][documentString];
frameDocument.write(buildInnerFrameHtml());
frameDocument.close();
if (innerFrame.addEventListener) {
innerFrame.addEventListener('load', loadScript);
} else {
innerFrame.attachEvent('onload', loadScript);
}
} catch(D) {
innerFrame[srcAttr] = domainSrc + 'd.write("' + buildInnerFrameHtml().replace(/"/g, String.fromCharCode(92) + '"') + '");d.close();'
}
Expand Down
5 changes: 1 addition & 4 deletions lightningjs-embed.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

0 comments on commit ae2679e

Please sign in to comment.