Feature request, support PDFjs url rewrite
See original GitHub issueOne 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:
- Created 5 years ago
- Comments:5 (2 by maintainers)
Top GitHub Comments
Hi @prototype23
Could you please provide a complete example in which I can reproduce this behavior?
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.