Jupyter notebook: hyperlink to locally stored pdf docs stopped working in Chrome
An easy fix is to use an <embed>
element instead of an <iframe>
.
You can define a helper function in your notebook:
from IPython.core.display import HTMLdef pdf(url): return HTML('<embed src="%s" type="application/pdf" width="100%%" height="600px" />' % url)
To display your PDF, use the following:
pdf('./data-ref/pluto_datadictionary.pdf')
Note: the pdf file should be stored next to your jupyter notebook
The original iframe issue is related to the Content Security Policy applied to iframes by Chrome.