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

How to aware the comments <iframe> was loaded? #850

Open
razonyang opened this issue Jan 11, 2023 · 0 comments · May be fixed by #854
Open

How to aware the comments <iframe> was loaded? #850

razonyang opened this issue Jan 11, 2023 · 0 comments · May be fixed by #854

Comments

@razonyang
Copy link

razonyang commented Jan 11, 2023

Hi, I want to change the theme at runtime, but I got the following error when loading the iframe lazily (loading="lazy").

index.ts:13 Failed to execute 'postMessage' on 'DOMWindow': The target origin provided ('https://giscus.app') does not match the recipient window's origin ('http://localhost:13131').

So I'm wondering if there is an option to add the onload attribute on the <iframe>, so that I could be aware whether the iframe is ready to change theme.

Use case: I have a dark/light toggle button on my UI, users can change the color at will. I need to adjust giscus theme to the UI color at the first load.

@razonyang razonyang linked a pull request Jan 13, 2023 that will close this issue
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

Successfully merging a pull request may close this issue.

1 participant