I am using following code to display pdf using google with iframe.. It's working fine. But I want to disable "pop-out" option (which on click opening my pdf in new tab with google docs) shown on right upper corner beside zoomin option on my webpage. Is it possible?
Currently I am using following code -
<iframe src="http://docs.google.com/gview?url=http://example.com/files/myfile.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0">
Can use sandbox
to stop the popup
working inside iframe
<iframe
sandbox="allow-scripts allow-same-origin"
/>
allow-scripts
: to run javascript inside iframe. allow-same-origin
: to allow loading file from google viewer.
without allow-popups
, nothing will happen when users click on pop-out
icon.
Source: https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With