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

Unable to render an html string by passing 'content' #4

Open
kirakik opened this issue Nov 23, 2017 · 4 comments
Open

Unable to render an html string by passing 'content' #4

kirakik opened this issue Nov 23, 2017 · 4 comments

Comments

@kirakik
Copy link

kirakik commented Nov 23, 2017

Hello,

We've been using this library for a few months, and recently we had a requirement to update the html from iFrame we use to pass it a dynamic string, which means we can no longer use a static html file. I've tried replacing src by content like so:

<ReactIframeResizer iframeResizerOptions={iframeResizerOptions} content={string} />

Where string is:

const text = `<html>
  <head>
    <link rel="stylesheet" title="main" type="text/css" href="teststyle.css" media="screen" />
    <script id="RestoNGo-script" src="testapp.js" data-api-key="apiKey" data-culture="en-CA"></script>
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1, user-scalable=0" />	    
  </head>
  <body>
    <div id="Test-App"></div>
  </body>
</html>`;

This does not work, as the iFrame no longer displays anything. Does anyone have a clue to what could be going on?

@kirakik
Copy link
Author

kirakik commented Dec 8, 2017

Hey @zeroasterisk, I found out that using it this way caused an issue with Safari's security. I tried it a different way, by creating a backend route that returns the html, however this then causes other issues:

screen shot 2017-12-07 at 10 53 54 pm

I have not yet found a way around this.

@zeroasterisk
Copy link
Owner

zeroasterisk commented Dec 8, 2017 via email

@kirakik
Copy link
Author

kirakik commented Dec 8, 2017

Yes @zeroasterisk, it works fine when not using the resizer

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