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

Iframe cannot be opened in Firefox insecure context #221

Open
chladnefazole opened this issue Aug 1, 2022 · 0 comments
Open

Iframe cannot be opened in Firefox insecure context #221

chladnefazole opened this issue Aug 1, 2022 · 0 comments

Comments

@chladnefazole
Copy link

chladnefazole commented Aug 1, 2022

We are using this project in a Firefox/Chrome web extension. RasterizeHTML is included as a content script (ie. insecure context).

PROBLEM: Firefox is blocking Rasterize from opening an iFrame in the insecure context. Basically, all actions on the iframe.contentDocument are banned: open, write, close, etc.

I fixed the problem locally by changing the following:

iframe.contentDocument.open()
...
iframe.contentDocument.write("<!DOCTYPE html>");
iframe.contentDocument.write(html);
iframe.contentDocument.close();

to:
iframe.srcdoc = `<!DOCTYPE html>${html}`;

We cannot use Rasterize from the extension's background scripts (ie. from a secure context) because in Chrome manifest V3, background scripts will not have access to the DOM.

Would it be possible for someone at Rasterize to address this issue, so that we can use your CDN directly with no security errors in FF insecure context?

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

1 participant