purescript/trypurescript

Can't click links in the iframe

hdgarrood opened this issue · 6 comments

Attempting to click a link inside the iframe does nothing. Perhaps we can listen for load events from outside, and navigate to the new locations manually.

Does the iframe just need different sandbox permissions? I don’t actually know what the spectrum is.

Oh right yes. I think allow-top-navigation or perhaps allow-top-navigation-by-user-activation might be what we want. https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe

I haven't yet managed to get allow-top-navigation to work. I think you also need to add target=_top to your links, but that alone doesn't appear to be sufficient. Also, adding target=_top is a bit inconvenient, but then again perhaps it's not such a bad thing, eg for examples which make use of the history API you probably do want to keep the two browsing contexts separate.

Is the use case just following internal gist links? If that's the case we are probably better off trying to figure out a specialized workaround. The point of being sandboxed is that it can't do anything funny.

Yes, that makes sense to me.

Solved by #140