question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Issue with code loaded in a separate iFrame

See original GitHub issue

I have a somewhat strange usage for Preact. I am the owner of a library ( GWTReact) that allows you to use React in Java via the Google GWT compiler. I am interested in also supporting Preact (with the react compat library). From my initial testing it basically works except for one case where arrays of child elements are passed. GWT loads the transpiled Java code in an iFrame which is different than the Preact script is loaded. The following line of code is the problem:

    function h(nodeName, attributes) {
    .
    .
    while (stack.length) if ((child = stack.pop()) instanceof Array)  ....... {

The problem is that instanceof doesn’t work if the array was created by code in the other iFrame. So I changed it to Array.isArray and it works fine

    function h(nodeName, attributes) {
    .
    .
    while (stack.length) if ((child = stack.pop()) && Array.isArray(child)) ....... {

Issue Analytics

  • State:closed
  • Created 7 years ago
  • Comments:5 (3 by maintainers)

github_iconTop GitHub Comments

1reaction
pstockleycommented, Mar 29, 2017

Great. Thanks a lot.

0reactions
developitcommented, Mar 29, 2017

@pstockley I’ve found a way to remove the Array constructor reliance in 8.0 😃

Read more comments on GitHub >

github_iconTop Results From Across the Web

iframe in iframe won't load - Stack Overflow
I run into some trouble with an cross domain iframe hack. I have an iframe "if1" on my page that contains another iframe...
Read more >
The ultimate guide to iframes - LogRocket Blog
The load event. It is triggered when the iframe is fully loaded. In other words, all static assets have been downloaded, and all...
Read more >
How to Load HTML, CSS, and JS Code into an iFrame
Solution: Blob URLs · First we used srcdoc to load data instead of loading from a URL · Then we used the boomerang...
Read more >
How to load a hyperlink from one iframe to another iframe
Our problem will be solved if we keep the value of the target as the name of the destination iframe where the hyperlink...
Read more >
[Solved] Iframe loading problem - CodeProject
Use event onload of your iframe . Just one example: http://www.w3schools.com/jsref/event_frame_onload.asp[^]. ... this i frame is inside div and ...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found