# How to fix or troubleshoot iframe content not displaying unless refreshing page?

**URL:** <https://community.weweb.io/t/how-to-fix-or-troubleshoot-iframe-content-not-displaying-unless-refreshing-page/10066>\
**Category:** Ask us anything\
**Created:** [August 2, 2024, 3:48pm UTC](https://community.weweb.io/t/how-to-fix-or-troubleshoot-iframe-content-not-displaying-unless-refreshing-page/10066 "2024-08-02T15:48:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ericp](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@ericp](https://community.weweb.io/u/ericp)\
**Post date:** [August 2, 2024, 3:48pm UTC](https://community.weweb.io/t/how-to-fix-or-troubleshoot-iframe-content-not-displaying-unless-refreshing-page/10066/1 "2024-08-02T15:48:14Z")

</div>

I have a page with an HTML element and iframe that displays a PDF that is stored in Google Cloud Storage using the Google Drive PDF viewer. Half the time the iframe is blank and I need to refresh the page for it to show up. The url of the pdf comes from a collection fetched on the page load.

How do I go about figuring out why the contents aren’t loading? Is there something I can add to a workflow on page load that would help?

Here is an example of the code:

```auto
<iframe src="https://docs.google.com/viewer?url=https://storage.googleapis.com/cdn.irrigationcheckups.com/63efc9e4-05a2-4fbb-b95f-6fa1e319eb73/reports/1780-1722555154187.pdf&embedded=true" style="width:100%; height:100%;"></iframe>

```

---

<div class="post-metadata">

**Author:** ![dorilama](https://sea2.discourse-cdn.com/flex016/user_avatar/community.weweb.io/dorilama/32/10403_2.png) [@dorilama](https://community.weweb.io/u/dorilama)\
**Post date:** [August 2, 2024, 4:30pm UTC](https://community.weweb.io/t/how-to-fix-or-troubleshoot-iframe-content-not-displaying-unless-refreshing-page/10066/2 "2024-08-02T16:30:33Z")

</div>

With the html element an easy thing you can try is to disable “Refresh on resize” in the settings panel.

---

<div class="post-metadata">

**Author:** ![ericp](https://avatars.discourse-cdn.com/v4/letter/e/ea666f/32.png) [@ericp](https://community.weweb.io/u/ericp)\
**Post date:** [August 3, 2024, 1:16am UTC](https://community.weweb.io/t/how-to-fix-or-troubleshoot-iframe-content-not-displaying-unless-refreshing-page/10066/3 "2024-08-03T01:16:18Z")

</div>

Unfortunately that didn’t make a difference.

After spending more time looking into potential causes, I’m led to believe its CORS related trying to use Google Cloud Storage files with the Drive pdf viewer. So I abandoned that route and gave the Adobe PDF Embed api a try. After much trial and error, finally got it working after implementing a delay on the script to ensure the SDK finished loading.
