question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

PDF inside iframe not showing in chrome

See original GitHub issue

Current behavior

According to the comments made by @jennifer-shehane in #2835 , PDFs loaded within iframes used to work in chrome in the past, but they don’t now.

Screen Shot 2022-04-29 at 12 50 40 PM

I’m using cypress 9.6 with chrome 100. This works fine if I instead choose edge (101) or firefox (98).

Desired behavior

No response

Test code to reproduce

Clone this example repo by @jennifer-shehane and do:

$ npm install
$ npm install cypress@9.6
$ npm run cypress:open

Select Chrome (I’m using v100) and run the test. You’ll see something like my screenshot above instead of seeing the PDF inside the iframe.

Cypress Version

9.6

Other

No response

Issue Analytics

  • State:open
  • Created a year ago
  • Comments:6 (1 by maintainers)

github_iconTop GitHub Comments

1reaction
sean-mystylecommented, Jun 10, 2022

I have the same issue with Chrome Version 102.0.5005.115 (Official Build) (64-bit)

A few months ago using a Base64 PDF generated inline in an iframe as src via javascript on page, the Chrome PDF Viewer used to load. Now, it does not, just blank, with no errors in console or network tabs in developer tools.

Still works OK as expected in FireFox. I’m guessing this is a Chrome issue…

1reaction
mjhenkescommented, May 3, 2022

Using chrome v100 and this simple test, pdfs are not preview-able.

Requires testing.pdf file in project root.

index.html

<html>
<body>
  <iframe src="testing.pdf"></iframe>
</body>
</html>

spec.js

it('Visiting iframe with pdf src', function () {
  cy.visit('index.html')
})

This appears at first glance to be an issue with cypress interfacing with chrome. This issue was not seen with:

  • Firefox 99
  • Chromium 94
  • Edge 101
Read more comments on GitHub >

github_iconTop Results From Across the Web

Google chrome dose not show pdf in iframe - Stack Overflow
The solution for me was opening the PDF in Adobe Acrobat and under the "Protect" tab, select "Remove Hidden Information".
Read more >
510800 - Issues with pdf viewer and iframe - chromium
PDF viewer is not showing the pdf in iframe or object tag. Works good on IE and FF since are using acrobat. Does...
Read more >
4 Ways to Fix iFrame When it's Not Working in Chrome
1. Disable/enable iFrames from Internet Options · 2. Stop your antivirus service · 3. Disable all add-ons from your browser · 4. Download...
Read more >
Cannot view PDF files inside an iframe on Chrome for Android
For anyone looking for more information on this topic, I never figured out a way to display the pdf in an iframe.
Read more >
Why doesn't the PDF in the iframe display the same in all ...
Why doesn't the PDF in the iframe display the same in all supported browsers? · 1. In each browser, the built-in window with...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found