如何使用google doc iframe禁用pdf查看器中的弹出选项?

Dr *_*ish 9 html iframe google-docs

我使用以下代码使用谷歌与iframe显示pdf ..它工作正常.但我想在我的网页上的zoomin选项旁边的右上角显示禁用"弹出"选项(在点击打开我的pdf在新标签页面中显示谷歌文档).可能吗?

目前我正在使用以下代码 -

<iframe src="http://docs.google.com/gview?url=http://example.com/files/myfile.pdf&embedded=true" style="width:600px; height:500px;" frameborder="0">
Run Code Online (Sandbox Code Playgroud)

leL*_*dor 10

可用于sandbox停止popup内部工作iframe

<iframe 
    sandbox="allow-scripts allow-same-origin"
/>
Run Code Online (Sandbox Code Playgroud)

allow-scripts:在 iframe 内运行 javascript。
allow-same-origin:允许从谷歌查看器加载文件。
如果没有allow-popups,当用户单击 pop-out图标时不会发生任何事情。

来源:https://developer.mozilla.org/en-US/docs/Web/HTML/Element/iframe


rom*_*n m 0

在您的页面上运行此 javascript(使用 jQuery 的示例)(我假设该类对于所有客户端都是相同的)

$('.ndfHFb-c4YZDc-Wrql6b').remove();
Run Code Online (Sandbox Code Playgroud)