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.

Feature request, support PDFjs url rewrite

See original GitHub issue

One method to view a pdf with PDFjs in a website, is to use an iframe like this:

<iframe src="http://my.site/pdfjs/web/viewer.html?file=http%3A%2F%2Fmy.site%2Fmyfiles%2Fmypdf.pdf"></iframe>

Iframe url, targets the PDFjs viewer and viewer opens the file defined on the parameter file. For more details you can read here .

Testcafe is rewriting that url like <iframe src="http://10.10.23.53:50642/GkN25mFKQ!i/http://my.site/pdfjs/web/viewer.html?file=http%3A%2F%2Fmy.site%2Fmyfiles%2Fmypdf.pdf" src-hammerhead-stored-value="http://my.site/pdfjs/web/viewer.html?file=http%3A%2F%2Fmy.site%2Fmyfiles%2Fmypdf.pdf"></iframe> missing to replace the second url on the file param. Result is to successfully load the PDFjs viewer but receive a cross domain error for the file.

On my previous question it was clear that we can’t skip that testcafe behaviour. But can we at least improve it 😇 in order to change the second param too?

On my tests changing the second param, like this ?file=http://10.10.23.53:50642/GkN25mFKQ!i/http%3A%2F%2Fmy.site%2Fmyfiles%2Fmypdf.pdf is making PDFjs to work normally!

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
miherlosevcommented, Oct 29, 2018

Hi @prototype23

Could you please provide a complete example in which I can reproduce this behavior?

0reactions
lock[bot]commented, Mar 28, 2019

This thread has been automatically locked since it is closed and there has not been any recent activity. Please open a new issue for related bugs or feature requests. We recommend you ask TestCafe API, usage and configuration inquiries on StackOverflow.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Feature Request - Support custom keybindings #8077 - GitHub
Hi. I am an avid user of vimium and it has increased my productivity massively. However vimium does not work with pdf tabs...
Read more >
Reading pdf from url with node.js using PDF.js - Stack Overflow
But when I run this, I get the following error: message: 'The browser/environment lacks native support for critical functionality used by the ...
Read more >
Getting Started
Getting Started ; An introduction to ·.js with examples. ; Before downloading ·.js please take a moment to understand the different layers of...
Read more >
How to Use PDF.js in 2 Easy Steps: Embed PDF in your Website
Get step-by-step direction on how to use a PDFjs Viewer in your website to display PDFs. Step 1: download & extract PDFjs package....
Read more >
ngx-extended-pdf-viewer - npm
Version 15 updates to pdf.js 2.16 (default branch) and pdf.js 3.0 ... we can discuss the change, create a fork, and send me...
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