Skip to content
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

Usage in iframes #25

Open
josephrocca opened this issue Nov 30, 2024 · 1 comment
Open

Usage in iframes #25

josephrocca opened this issue Nov 30, 2024 · 1 comment

Comments

@josephrocca
Copy link

josephrocca commented Nov 30, 2024

Currently Chrome's auto-translation feature doesn't translate iframes. I opened a Chrome issue about this a while ago and it was immediately wontfixed. In my case I have a Scratch/JSBin type site that runs userland/untrusted code inside an iframe (which is sandboxed / cross-origin).

This site needs auto-translation more than the average website because the users on the platform are very lingually diverse, and obviously aren't e.g. 'companies' who have time to create translations for every language. Most people obviously just create their thing in their own language.

So this proposal is exciting to me as long as it's possible to make it work within iframes.

This comment:

mentions the possibility of disallowing use in iframes:

Those sites would need to coordinate among each other within the same browsing session. I think that should not be possible if we restrict to top-level navigables with no opener. (E.g. by requiring COOP.) That's a pretty strong restriction however, in particular disallowing iframed widgets, so we might want to explore other ways of loosening it when possible...

So I figured I'd create this issue to effectively 'vote for' iframe support. I don't have a well-informed opinion on how it should made possible. I think I could even "proxy" the requests to the parent frame in the worst case? But in the proxying case I'd probably have to build a full 'polyfill' within the child frame, since I'd want to make the API available in 'userland' too, without users having to learn a non-web-standard API.

Also potentially relevant RE inheritance:

@tomayac
Copy link

tomayac commented Nov 30, 2024

The usual way for powerful features like this would be to go through Permissions Policy. This way, you would opt in your iframe like this:

<iframe allow="translation" src="foo.html"></iframe>

This might be the way to go here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants