MS Edge - window.print()在MS边缘不是帧上下文

Jus*_*tin 8 html javascript printing iframe microsoft-edge

与其他浏览器相比,Microsoft Edge不会始终如一地处理window.print().

在大多数浏览器中,从页面上的iframe内调用window.print()只会打印该iframe的内容.但是在边缘,它将始终打印整个文档.

这是故意的吗?有解决方法吗?

关于JSFiddle的例子.

Iframe.html的

...
<body>
    <a href="#" onclick="window.print()">print iframe document</a>
</body>
...
Run Code Online (Sandbox Code Playgroud)

的index.html

...
<body>
    <a href="#" onclick="window.print()">print outer document</a>
    <iframe src="iframe.html"></iframe>
</body>
...
Run Code Online (Sandbox Code Playgroud)

Dmi*_*kov 6

这是微软公认的问题,引用:

Posted by Microsoft on 7/29/2015 at 12:46 AM
We were able to confirm the issue, and will be working to resolve it in a future release
Run Code Online (Sandbox Code Playgroud)

还没有解决方法.