Skip to content

feat: add app iframe controls #18421

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Jun 19, 2025
Merged

feat: add app iframe controls #18421

merged 2 commits into from
Jun 19, 2025

Conversation

code-asher
Copy link
Member

@code-asher code-asher commented Jun 17, 2025

I was not able to implement back/forward as we have no way of interacting with history in a cross-origin iframe.

The URL input was also a problem because there is no way to know if the cross-origin iframe's URL changes (due to a link inside the iframe for example), so it risks becoming stale.

In the future we can maybe do something where we serve our own HTML that sets up a message channel with the parent to communicate history changes, and then it replaces itself with the real content (similar to weno), or alternatively we munge the original content and inject our message channel code directly into it, although this will only work for apps we ourselves serve, nothing externally hosted will work this way.

fixes #18178

@code-asher code-asher requested a review from BrunoQuaresma June 18, 2025 00:06
@code-asher code-asher force-pushed the bq/iframe-controls branch 2 times, most recently from fadbf77 to 89c67d4 Compare June 18, 2025 00:14
@code-asher code-asher removed the request for review from BrunoQuaresma June 18, 2025 00:22
@code-asher code-asher marked this pull request as draft June 18, 2025 00:22
@code-asher
Copy link
Member Author

Moved to draft, need to sort out some quirkiness with the scroll bar...

@code-asher code-asher force-pushed the bq/iframe-controls branch from 89c67d4 to 35f6d0e Compare June 18, 2025 18:06
@code-asher code-asher marked this pull request as ready for review June 18, 2025 18:14
@code-asher code-asher requested a review from BrunoQuaresma June 18, 2025 18:14
@code-asher
Copy link
Member Author

Wait, sorry for all the pings, but turns out reload() is not accessible cross-origin either. 😢 Going to remove it.

@code-asher code-asher removed the request for review from BrunoQuaresma June 18, 2025 18:19
@code-asher code-asher marked this pull request as draft June 18, 2025 18:19
@code-asher code-asher force-pushed the bq/iframe-controls branch 2 times, most recently from b7e7c0d to 14674b4 Compare June 18, 2025 18:46
@code-asher code-asher force-pushed the bq/iframe-controls branch from 14674b4 to 85cd8e9 Compare June 18, 2025 18:48
@code-asher
Copy link
Member Author

All right so unfortunately all we can actually add is a home button and a button to open in a new tab, but this is finally good to go.

@code-asher code-asher marked this pull request as ready for review June 18, 2025 18:56
@code-asher code-asher requested a review from BrunoQuaresma June 18, 2025 18:56
@code-asher code-asher merged commit 63b5f0b into main Jun 19, 2025
37 checks passed
@code-asher code-asher deleted the bq/iframe-controls branch June 19, 2025 17:22
@github-actions github-actions bot locked and limited conversation to collaborators Jun 19, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

tasks: support refreshing a iFrame, home, and manually navigating
2 participants