Rendering Svelte Component in an iFrame #14
Unanswered
ugurkellecioglu
asked this question in
Q&A
Replies: 1 comment 1 reply
-
Hello! Looks like this is a I found an example of component rendering in import Frame from "src/components/Frame.svelte";
import Options from "src/components/Options.svelte";
const iframe = document.createElement("iframe");
iframe.onload = (ev) => {
new Frame({
target: iframe.contentWindow.document.body,
props: {
component: Options,
count: 12,
},
});
};
document.body.append(iframe); and the styles are successfully applied inside |
Beta Was this translation helpful? Give feedback.
1 reply
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
Hi! Thanks for such a great project :)
I have created a Svelte component and I can render it in the body with - (all codes executed in content.js)
which is fine, but I'd like to render it in an iframe to not be affected by other styles on the injected page (I hope that makes sense).
This code snippet works for rendering the component in the iframe, but the styles won't work.
Do you know how I can inject a component in an iframe without losing styling?
Beta Was this translation helpful? Give feedback.
All reactions