JS全屏代码,解决PDF.js在iframe中部分浏览器全屏功能错误

PDF.js在iframe模式在火狐浏览器中按钮被屏蔽

经分析,viewer.js 发现了判断逻辑

debug发现 第二个判断后为true ,support = false 不全屏

JS全屏代码,解决PDF.js在iframe中部分浏览器全屏功能错误

于是在页面 iframe 中加上 mozallowfullscreen="true"  ,测试通过,可以全屏了

<iframe id='previewPdf' :src=" fileUrl" height="560"
        width="100%" scrolling="no" frameborder="0" allowfullscreen="true"
        webkitallowfullscreen="true" mozallowfullscreen="true" oallowfullscreen="true" msallowfullscreen="true">
</iframe>

相关文章:

  • 2021-10-25
  • 2022-12-23
  • 2022-12-23
  • 2021-12-12
  • 2022-03-05
  • 2022-12-23
  • 2021-11-20
  • 2021-12-29
猜你喜欢
  • 2022-12-23
  • 2022-12-23
  • 2021-05-24
  • 2021-10-01
  • 2022-03-09
  • 2022-02-17
  • 2022-12-23
相关资源
相似解决方案